diff --git a/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h b/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h index 1ad67a1b41044..06a34e0bf9a29 100644 --- a/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h +++ b/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h @@ -91,8 +91,8 @@ class PluginRegistrarManager { auto insert_result = registrars_.emplace(registrar_ref, std::make_unique(registrar_ref)); auto& registrar_pair = *(insert_result.first); - FlutterDesktopRegistrarSetDestructionHandler(registrar_pair.first, - OnRegistrarDestroyed); + FlutterDesktopPluginRegistrarSetDestructionHandler(registrar_pair.first, + OnRegistrarDestroyed); return static_cast(registrar_pair.second.get()); } diff --git a/shell/platform/common/cpp/client_wrapper/plugin_registrar.cc b/shell/platform/common/cpp/client_wrapper/plugin_registrar.cc index a779d6e26df53..b81411fb40e01 100644 --- a/shell/platform/common/cpp/client_wrapper/plugin_registrar.cc +++ b/shell/platform/common/cpp/client_wrapper/plugin_registrar.cc @@ -17,7 +17,7 @@ namespace flutter { PluginRegistrar::PluginRegistrar(FlutterDesktopPluginRegistrarRef registrar) : registrar_(registrar) { - auto core_messenger = FlutterDesktopRegistrarGetMessenger(registrar_); + auto core_messenger = FlutterDesktopPluginRegistrarGetMessenger(registrar_); messenger_ = std::make_unique(core_messenger); } diff --git a/shell/platform/common/cpp/client_wrapper/plugin_registrar_unittests.cc b/shell/platform/common/cpp/client_wrapper/plugin_registrar_unittests.cc index 58cb1f5fcaa48..575dcee81157d 100644 --- a/shell/platform/common/cpp/client_wrapper/plugin_registrar_unittests.cc +++ b/shell/platform/common/cpp/client_wrapper/plugin_registrar_unittests.cc @@ -39,8 +39,8 @@ class TestApi : public testing::StubFlutterApi { last_message_callback_set_ = callback; } - void RegistrarSetDestructionHandler( - FlutterDesktopOnRegistrarDestroyed callback) override { + void PluginRegistrarSetDestructionHandler( + FlutterDesktopOnPluginRegistrarDestroyed callback) override { last_destruction_callback_set_ = callback; } @@ -48,14 +48,15 @@ class TestApi : public testing::StubFlutterApi { FlutterDesktopMessageCallback last_message_callback_set() { return last_message_callback_set_; } - FlutterDesktopOnRegistrarDestroyed last_destruction_callback_set() { + FlutterDesktopOnPluginRegistrarDestroyed last_destruction_callback_set() { return last_destruction_callback_set_; } private: const uint8_t* last_data_sent_ = nullptr; FlutterDesktopMessageCallback last_message_callback_set_ = nullptr; - FlutterDesktopOnRegistrarDestroyed last_destruction_callback_set_ = nullptr; + FlutterDesktopOnPluginRegistrarDestroyed last_destruction_callback_set_ = + nullptr; }; // A PluginRegistrar whose destruction can be watched for by tests. diff --git a/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.cc b/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.cc index 1f60548952249..7cdd354a4d8ea 100644 --- a/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.cc +++ b/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.cc @@ -38,17 +38,17 @@ ScopedStubFlutterApi::~ScopedStubFlutterApi() { // Forwarding dummy implementations of the C API. -FlutterDesktopMessengerRef FlutterDesktopRegistrarGetMessenger( +FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger( FlutterDesktopPluginRegistrarRef registrar) { // The stub ignores this, so just return an arbitrary non-zero value. return reinterpret_cast(1); } -void FlutterDesktopRegistrarSetDestructionHandler( +void FlutterDesktopPluginRegistrarSetDestructionHandler( FlutterDesktopPluginRegistrarRef registrar, - FlutterDesktopOnRegistrarDestroyed callback) { + FlutterDesktopOnPluginRegistrarDestroyed callback) { if (s_stub_implementation) { - s_stub_implementation->RegistrarSetDestructionHandler(callback); + s_stub_implementation->PluginRegistrarSetDestructionHandler(callback); } } diff --git a/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.h b/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.h index ae55cdc9010f0..d7b966740fded 100644 --- a/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.h +++ b/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.h @@ -34,9 +34,9 @@ class StubFlutterApi { virtual ~StubFlutterApi() {} - // Called for FlutterDesktopRegistrarSetDestructionHandler. - virtual void RegistrarSetDestructionHandler( - FlutterDesktopOnRegistrarDestroyed callback) {} + // Called for FlutterDesktopPluginRegistrarSetDestructionHandler. + virtual void PluginRegistrarSetDestructionHandler( + FlutterDesktopOnPluginRegistrarDestroyed callback) {} // Called for FlutterDesktopMessengerSend. virtual bool MessengerSend(const char* channel, diff --git a/shell/platform/common/cpp/public/flutter_plugin_registrar.h b/shell/platform/common/cpp/public/flutter_plugin_registrar.h index e27e125530ac9..261d3cbc275ec 100644 --- a/shell/platform/common/cpp/public/flutter_plugin_registrar.h +++ b/shell/platform/common/cpp/public/flutter_plugin_registrar.h @@ -19,17 +19,18 @@ extern "C" { typedef struct FlutterDesktopPluginRegistrar* FlutterDesktopPluginRegistrarRef; // Function pointer type for registrar destruction callback. -typedef void (*FlutterDesktopOnRegistrarDestroyed)( +typedef void (*FlutterDesktopOnPluginRegistrarDestroyed)( FlutterDesktopPluginRegistrarRef); // Returns the engine messenger associated with this registrar. FLUTTER_EXPORT FlutterDesktopMessengerRef -FlutterDesktopRegistrarGetMessenger(FlutterDesktopPluginRegistrarRef registrar); +FlutterDesktopPluginRegistrarGetMessenger( + FlutterDesktopPluginRegistrarRef registrar); // Registers a callback to be called when the plugin registrar is destroyed. -FLUTTER_EXPORT void FlutterDesktopRegistrarSetDestructionHandler( +FLUTTER_EXPORT void FlutterDesktopPluginRegistrarSetDestructionHandler( FlutterDesktopPluginRegistrarRef registrar, - FlutterDesktopOnRegistrarDestroyed callback); + FlutterDesktopOnPluginRegistrarDestroyed callback); #if defined(__cplusplus) } // extern "C" diff --git a/shell/platform/glfw/client_wrapper/include/flutter/plugin_registrar_glfw.h b/shell/platform/glfw/client_wrapper/include/flutter/plugin_registrar_glfw.h index aa0f03deed16a..1d0a83e20b2f9 100644 --- a/shell/platform/glfw/client_wrapper/include/flutter/plugin_registrar_glfw.h +++ b/shell/platform/glfw/client_wrapper/include/flutter/plugin_registrar_glfw.h @@ -23,7 +23,7 @@ class PluginRegistrarGlfw : public PluginRegistrar { explicit PluginRegistrarGlfw(FlutterDesktopPluginRegistrarRef core_registrar) : PluginRegistrar(core_registrar) { window_ = std::make_unique( - FlutterDesktopRegistrarGetWindow(core_registrar)); + FlutterDesktopPluginRegistrarGetWindow(core_registrar)); } virtual ~PluginRegistrarGlfw() = default; @@ -39,7 +39,8 @@ class PluginRegistrarGlfw : public PluginRegistrar { // If set, then the parent window should disable input callbacks // while waiting for the handler for messages on that channel to run. void EnableInputBlockingForChannel(const std::string& channel) { - FlutterDesktopRegistrarEnableInputBlocking(registrar(), channel.c_str()); + FlutterDesktopPluginRegistrarEnableInputBlocking(registrar(), + channel.c_str()); } private: diff --git a/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.cc b/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.cc index 8875a1b51d23d..c12e54fd4dad7 100644 --- a/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.cc +++ b/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.cc @@ -183,10 +183,10 @@ FlutterDesktopPluginRegistrarRef FlutterDesktopGetPluginRegistrar( return reinterpret_cast(2); } -void FlutterDesktopRegistrarEnableInputBlocking( +void FlutterDesktopPluginRegistrarEnableInputBlocking( FlutterDesktopPluginRegistrarRef registrar, const char* channel) { if (s_stub_implementation) { - s_stub_implementation->RegistrarEnableInputBlocking(channel); + s_stub_implementation->PluginRegistrarEnableInputBlocking(channel); } } diff --git a/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.h b/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.h index 765a02e45f7f5..fd96dd4becc27 100644 --- a/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.h +++ b/shell/platform/glfw/client_wrapper/testing/stub_flutter_glfw_api.h @@ -89,8 +89,8 @@ class StubFlutterGlfwApi { // Called for FlutterDesktopShutDownEngine. virtual bool ShutDownEngine() { return true; } - // Called for FlutterDesktopRegistrarEnableInputBlocking. - virtual void RegistrarEnableInputBlocking(const char* channel) {} + // Called for FlutterDesktopPluginRegistrarEnableInputBlocking. + virtual void PluginRegistrarEnableInputBlocking(const char* channel) {} }; // A test helper that owns a stub implementation, making it the test stub for diff --git a/shell/platform/glfw/flutter_glfw.cc b/shell/platform/glfw/flutter_glfw.cc index 6ed101449e9ca..e34d706741a94 100644 --- a/shell/platform/glfw/flutter_glfw.cc +++ b/shell/platform/glfw/flutter_glfw.cc @@ -138,7 +138,7 @@ struct FlutterDesktopPluginRegistrar { FlutterDesktopEngineState* engine; // Callback to be called on registrar destruction. - FlutterDesktopOnRegistrarDestroyed destruction_handler; + FlutterDesktopOnPluginRegistrarDestroyed destruction_handler; }; // State associated with the messenger used to communicate with the engine. @@ -963,24 +963,24 @@ bool FlutterDesktopShutDownEngine(FlutterDesktopEngineRef engine) { return (result == kSuccess); } -void FlutterDesktopRegistrarEnableInputBlocking( +void FlutterDesktopPluginRegistrarEnableInputBlocking( FlutterDesktopPluginRegistrarRef registrar, const char* channel) { registrar->engine->message_dispatcher->EnableInputBlockingForChannel(channel); } -FlutterDesktopMessengerRef FlutterDesktopRegistrarGetMessenger( +FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger( FlutterDesktopPluginRegistrarRef registrar) { return registrar->engine->messenger.get(); } -void FlutterDesktopRegistrarSetDestructionHandler( +void FlutterDesktopPluginRegistrarSetDestructionHandler( FlutterDesktopPluginRegistrarRef registrar, - FlutterDesktopOnRegistrarDestroyed callback) { + FlutterDesktopOnPluginRegistrarDestroyed callback) { registrar->destruction_handler = callback; } -FlutterDesktopWindowRef FlutterDesktopRegistrarGetWindow( +FlutterDesktopWindowRef FlutterDesktopPluginRegistrarGetWindow( FlutterDesktopPluginRegistrarRef registrar) { FlutterDesktopWindowControllerState* controller = registrar->engine->window_controller; diff --git a/shell/platform/glfw/public/flutter_glfw.h b/shell/platform/glfw/public/flutter_glfw.h index e8b4513877852..5b26cf7481976 100644 --- a/shell/platform/glfw/public/flutter_glfw.h +++ b/shell/platform/glfw/public/flutter_glfw.h @@ -221,8 +221,8 @@ FLUTTER_EXPORT bool FlutterDesktopShutDownEngine( // Returns the window associated with this registrar's engine instance. // // This is a GLFW shell-specific extension to flutter_plugin_registrar.h -FLUTTER_EXPORT FlutterDesktopWindowRef -FlutterDesktopRegistrarGetWindow(FlutterDesktopPluginRegistrarRef registrar); +FLUTTER_EXPORT FlutterDesktopWindowRef FlutterDesktopPluginRegistrarGetWindow( + FlutterDesktopPluginRegistrarRef registrar); // Enables input blocking on the given channel. // @@ -235,7 +235,7 @@ FlutterDesktopRegistrarGetWindow(FlutterDesktopPluginRegistrarRef registrar); // default of disabled. // // This is a GLFW shell-specific extension to flutter_plugin_registrar.h -FLUTTER_EXPORT void FlutterDesktopRegistrarEnableInputBlocking( +FLUTTER_EXPORT void FlutterDesktopPluginRegistrarEnableInputBlocking( FlutterDesktopPluginRegistrarRef registrar, const char* channel); diff --git a/shell/platform/windows/flutter_windows.cc b/shell/platform/windows/flutter_windows.cc index 1871021e40e9e..65a0268812a21 100644 --- a/shell/platform/windows/flutter_windows.cc +++ b/shell/platform/windows/flutter_windows.cc @@ -196,14 +196,14 @@ void FlutterDesktopResyncOutputStreams() { // Implementations of common/cpp/ API methods. -FlutterDesktopMessengerRef FlutterDesktopRegistrarGetMessenger( +FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger( FlutterDesktopPluginRegistrarRef registrar) { return registrar->engine->messenger(); } -void FlutterDesktopRegistrarSetDestructionHandler( +void FlutterDesktopPluginRegistrarSetDestructionHandler( FlutterDesktopPluginRegistrarRef registrar, - FlutterDesktopOnRegistrarDestroyed callback) { + FlutterDesktopOnPluginRegistrarDestroyed callback) { registrar->engine->SetPluginRegistrarDestructionCallback(callback); } diff --git a/shell/platform/windows/flutter_windows_engine.cc b/shell/platform/windows/flutter_windows_engine.cc index 76af353ab0b52..36aa92dc212ee 100644 --- a/shell/platform/windows/flutter_windows_engine.cc +++ b/shell/platform/windows/flutter_windows_engine.cc @@ -217,7 +217,7 @@ FlutterDesktopPluginRegistrarRef FlutterWindowsEngine::GetRegistrar() { } void FlutterWindowsEngine::SetPluginRegistrarDestructionCallback( - FlutterDesktopOnRegistrarDestroyed callback) { + FlutterDesktopOnPluginRegistrarDestroyed callback) { plugin_registrar_destruction_callback_ = callback; } diff --git a/shell/platform/windows/flutter_windows_engine.h b/shell/platform/windows/flutter_windows_engine.h index d18a414ee5838..49c0fc7f2a8cf 100644 --- a/shell/platform/windows/flutter_windows_engine.h +++ b/shell/platform/windows/flutter_windows_engine.h @@ -63,7 +63,7 @@ class FlutterWindowsEngine { // Sets |callback| to be called when the plugin registrar is destroyed. void SetPluginRegistrarDestructionCallback( - FlutterDesktopOnRegistrarDestroyed callback); + FlutterDesktopOnPluginRegistrarDestroyed callback); FLUTTER_API_SYMBOL(FlutterEngine) engine() { return engine_; } @@ -115,7 +115,8 @@ class FlutterWindowsEngine { // A callback to be called when the engine (and thus the plugin registrar) // is being destroyed. - FlutterDesktopOnRegistrarDestroyed plugin_registrar_destruction_callback_; + FlutterDesktopOnPluginRegistrarDestroyed + plugin_registrar_destruction_callback_; // The manager for WindowProc delegate registration and callbacks. std::unique_ptr window_proc_delegate_manager_;