Changeset 68309 in webkit
- Timestamp:
- Sep 24, 2010 4:12:24 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r68299 r68309 150 150 (QWKPreferences::setAttribute): 151 151 * UIProcess/API/qt/qwkpreferences.h: 152 153 2010-09-24 Anders Carlsson <andersca@apple.com> 154 155 Reviewed by Adam Roben. 156 157 Fill in more of PluginProcess 158 https://bugs.webkit.org/show_bug.cgi?id=46534 159 160 * DerivedSources.make: 161 Add PluginProcessProxy. 162 163 * Platform/CoreIPC/MessageID.h: 164 Add a MessageClassPluginProcessProxy message class. 165 166 * PluginProcess/PluginProcess.cpp: 167 (WebKit::PluginProcess::PluginProcess): 168 Initialize the shutdown timer. 169 170 (WebKit::PluginProcess::initializeConnection): 171 Rename this to initializeConnection to avoid conflicts in the CoreIPC message handler. 172 173 (WebKit::PluginProcess::removeWebProcessConnection): 174 Remove the given web process connection from our vector. 175 176 (WebKit::PluginProcess::initialize): 177 Create the plug-in module. 178 179 (WebKit::PluginProcess::createWebProcessConnection): 180 Create a connection handle and send it to the UI process. 181 182 (WebKit::PluginProcess::shutdownTimerFired): 183 Quit. 184 185 * PluginProcess/mac/PluginProcessMainMac.mm: 186 (WebKit::PluginProcessMain): 187 Call initializeConnection. 188 189 * Scripts/webkit2/messages.py: 190 Add CoreIPC::MachPort as a special case. 191 192 * Scripts/webkit2/messages_unittest.py: 193 Add test case. 194 195 * UIProcess/Plugins/PluginProcessProxy.cpp: 196 (WebKit::PluginProcessProxy::didCreateWebProcessConnection): 197 Add empty function. 198 199 * UIProcess/Plugins/PluginProcessProxy.messages.in: Added. 200 * WebKit2.xcodeproj/project.pbxproj: 201 Add PluginProcessProxy.messages.in. 202 203 * WebKit2Prefix.h: 204 Add an ENABLE_PLUGIN_PROCESS #define which is 0 for now. 152 205 153 206 2010-09-24 Anders Carlsson <andersca@apple.com> -
trunk/WebKit2/DerivedSources.make
r68170 r68309 2 2 $(WebKit2)/PluginProcess \ 3 3 $(WebKit2)/WebProcess/WebPage \ 4 $(WebKit2)/UIProcess/Plugins \ 4 5 # 5 6 6 7 MESSAGE_RECEIVERS = \ 7 8 PluginProcess \ 9 PluginProcessProxy \ 8 10 WebPage \ 9 11 # -
trunk/WebKit2/Platform/CoreIPC/MessageID.h
r68170 r68309 49 49 // Messages sent by the UI process to the plug-in process. 50 50 MessageClassPluginProcess, 51 52 // Messages sent by the plug-in process to the UI process. 53 MessageClassPluginProcessProxy, 51 54 }; 52 55 -
trunk/WebKit2/PluginProcess/PluginProcess.cpp
r68264 r68309 24 24 */ 25 25 26 #if ENABLE(PLUGIN_PROCESS) 27 26 28 #include "PluginProcess.h" 27 29 28 #if ENABLE(PLUGIN_PROCESS) 30 #include "MachPort.h" 31 #include "NetscapePluginModule.h" 32 #include "PluginProcessProxyMessages.h" 33 #include "WebProcessConnection.h" 29 34 30 35 namespace WebKit { 36 37 static const double shutdownTimeout = 15.0; 31 38 32 39 PluginProcess& PluginProcess::shared() … … 37 44 38 45 PluginProcess::PluginProcess() 46 : m_shutdownTimer(RunLoop::main(), this, &PluginProcess::shutdownTimerFired) 39 47 { 40 48 } … … 44 52 } 45 53 46 void PluginProcess::initialize (CoreIPC::Connection::Identifier serverIdentifier)54 void PluginProcess::initializeConnection(CoreIPC::Connection::Identifier serverIdentifier) 47 55 { 48 56 ASSERT(!m_connection); … … 50 58 m_connection = CoreIPC::Connection::createClientConnection(serverIdentifier, this, RunLoop::main()); 51 59 m_connection->open(); 60 } 61 62 void PluginProcess::removeWebProcessConnection(WebProcessConnection* webProcessConnection) 63 { 64 size_t vectorIndex = m_webProcessConnections.find(webProcessConnection); 65 ASSERT(vectorIndex != notFound); 66 67 m_webProcessConnections.remove(vectorIndex); 68 69 if (m_webProcessConnections.isEmpty()) { 70 // Start the shutdown timer. 71 m_shutdownTimer.startOneShot(shutdownTimeout); 72 } 52 73 } 53 74 … … 67 88 } 68 89 90 void PluginProcess::initialize(const String& pluginPath) 91 { 92 ASSERT(!m_pluginModule); 93 94 m_pluginModule = NetscapePluginModule::getOrCreate(pluginPath); 95 } 96 97 void PluginProcess::createWebProcessConnection() 98 { 99 // FIXME: This is platform specific! 100 101 // Create the listening port. 102 mach_port_t listeningPort; 103 mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort); 104 105 // Create a listening connection. 106 RefPtr<WebProcessConnection> connection = WebProcessConnection::create(listeningPort); 107 m_webProcessConnections.append(connection.release()); 108 109 CoreIPC::MachPort clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND); 110 m_connection->send(Messages::PluginProcessProxy::DidCreateWebProcessConnection(clientPort), 0); 111 112 // Stop the shutdown timer. 113 m_shutdownTimer.stop(); 114 } 115 116 void PluginProcess::shutdownTimerFired() 117 { 118 RunLoop::current()->stop(); 119 } 120 69 121 } // namespace WebKit 70 122 -
trunk/WebKit2/PluginProcess/PluginProcess.h
r68264 r68309 31 31 #include "Connection.h" 32 32 #include "RunLoop.h" 33 #include <wtf/Forward.h> 33 34 34 35 namespace WebKit { 35 36 37 class NetscapePluginModule; 38 class WebProcessConnection; 39 36 40 class PluginProcess : Noncopyable, CoreIPC::Connection::Client { 37 41 public: 38 42 static PluginProcess& shared(); 39 43 40 void initialize(CoreIPC::Connection::Identifier); 44 void initializeConnection(CoreIPC::Connection::Identifier); 45 void removeWebProcessConnection(WebProcessConnection* webProcessConnection); 46 47 NetscapePluginModule* netscapePluginModule() const { return m_pluginModule.get(); } 41 48 42 49 private: … … 49 56 virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID); 50 57 58 // Message handlers. 59 void initialize(const String& pluginPath); 60 void createWebProcessConnection(); 61 62 void shutdownTimerFired(); 63 51 64 // The connection to the UI process. 52 65 RefPtr<CoreIPC::Connection> m_connection; 66 67 // Our web process connections. 68 Vector<RefPtr<WebProcessConnection> > m_webProcessConnections; 69 70 // The plug-in module. 71 RefPtr<NetscapePluginModule> m_pluginModule; 72 73 // A timer used for the shutdown timeout. 74 RunLoop::Timer<PluginProcess> m_shutdownTimer; 53 75 }; 54 76 -
trunk/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm
r68264 r68309 72 72 RunLoop::initializeMainRunLoop(); 73 73 74 // Initialize the plug-in host process.75 PluginProcess::shared().initialize (serverPort);74 // Initialize the plug-in process connection. 75 PluginProcess::shared().initializeConnection(serverPort); 76 76 77 77 [NSApplication sharedApplication]; -
trunk/WebKit2/Scripts/webkit2/messages.py
r68159 r68309 283 283 def header_for_type(type): 284 284 special_cases = { 285 'CoreIPC::MachPort': '"MachPort.h"', 285 286 'WTF::String': '<wtf/text/WTFString.h>', 286 287 'WebKit::WebKeyboardEvent': '"WebEvent.h"', -
trunk/WebKit2/Scripts/webkit2/messages_unittest.py
r68287 r68309 64 64 GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins) 65 65 GetPluginProcessConnection(WTF::String pluginPath) -> (CoreIPC::Connection::Handle connectionHandle) delayed 66 67 DidCreateWebProcessConnection(CoreIPC::MachPort connectionIdentifier) 66 68 } 67 69 … … 157 159 'reply_base_class': 'CoreIPC::Arguments1<CoreIPC::Connection::Handle&>', 158 160 'delayed_reply_base_class': 'CoreIPC::Arguments1<const CoreIPC::Connection::Handle&>', 159 } 161 }, 162 { 163 'name': 'DidCreateWebProcessConnection', 164 'parameters': ( 165 ('CoreIPC::MachPort', 'connectionIdentifier'), 166 ), 167 'condition': None, 168 'base_class': 'CoreIPC::Arguments2<double, float>', 169 }, 160 170 ), 161 171 } … … 222 232 #include "MessageID.h" 223 233 234 namespace CoreIPC { 235 class MachPort; 236 } 237 224 238 namespace WTF { 225 239 class String; … … 246 260 GetPluginsID, 247 261 GetPluginProcessConnectionID, 262 DidCreateWebProcessConnectionID, 248 263 }; 249 264 … … 314 329 explicit GetPluginProcessConnection(const WTF::String& pluginPath) 315 330 : CoreIPC::Arguments1<const WTF::String&>(pluginPath) 331 { 332 } 333 }; 334 335 struct DidCreateWebProcessConnection : CoreIPC::Arguments1<const CoreIPC::MachPort&> { 336 static const Kind messageID = DidCreateWebProcessConnectionID; 337 explicit DidCreateWebProcessConnection(const CoreIPC::MachPort& connectionIdentifier) 338 : CoreIPC::Arguments1<const CoreIPC::MachPort&>(connectionIdentifier) 316 339 { 317 340 } … … 365 388 #include "ArgumentDecoder.h" 366 389 #include "HandleMessage.h" 390 #include "MachPort.h" 367 391 #include "WebEvent.h" 368 392 #include "WebPageMessages.h" … … 403 427 CoreIPC::handleMessage<Messages::WebPage::GetPluginProcessConnection>(arguments, this, &WebPage::getPluginProcessConnection); 404 428 return; 429 case Messages::WebPage::DidCreateWebProcessConnectionID: 430 CoreIPC::handleMessage<Messages::WebPage::DidCreateWebProcessConnection>(arguments, this, &WebPage::didCreateWebProcessConnection); 431 return; 405 432 } 406 433 -
trunk/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
r68170 r68309 80 80 } 81 81 82 void PluginProcessProxy::didCreateWebProcessConnection(const CoreIPC::MachPort&) 83 { 84 // FIXME: Implement. 85 } 86 82 87 } // namespace WebKit 83 88 -
trunk/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
r68170 r68309 34 34 #include <wtf/Deque.h> 35 35 36 // FIXME: This is platform specific. 37 namespace CoreIPC { 38 class MachPort; 39 } 40 36 41 namespace WebKit { 37 42 … … 55 60 // ProcessLauncher::Client 56 61 virtual void didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier); 57 62 63 // Message handlers 64 void didReceivePluginProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); 65 void didCreateWebProcessConnection(const CoreIPC::MachPort&); 66 58 67 // The plug-in host process manager. 59 68 PluginProcessManager* m_pluginProcessManager; -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r68272 r68309 48 48 1A043A09124D11A900FFBFB5 /* WebProcessConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043A07124D11A900FFBFB5 /* WebProcessConnection.h */; }; 49 49 1A043A0A124D11A900FFBFB5 /* WebProcessConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043A08124D11A900FFBFB5 /* WebProcessConnection.cpp */; }; 50 1A043B4D124D5E3600FFBFB5 /* PluginProcessProxy.messages.in in Resources */ = {isa = PBXBuildFile; fileRef = 1A043B4C124D5E3600FFBFB5 /* PluginProcessProxy.messages.in */; }; 51 1A043B5D124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043B5B124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp */; }; 52 1A043B5E124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043B5C124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h */; }; 50 53 1A0EC603124A9F2C007EF4A5 /* PluginProcessManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC601124A9F2C007EF4A5 /* PluginProcessManager.h */; }; 51 54 1A0EC604124A9F2C007EF4A5 /* PluginProcessManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0EC602124A9F2C007EF4A5 /* PluginProcessManager.cpp */; }; … … 454 457 1A043A07124D11A900FFBFB5 /* WebProcessConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessConnection.h; sourceTree = "<group>"; }; 455 458 1A043A08124D11A900FFBFB5 /* WebProcessConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebProcessConnection.cpp; sourceTree = "<group>"; }; 459 1A043B4C124D5E3600FFBFB5 /* PluginProcessProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginProcessProxy.messages.in; sourceTree = "<group>"; }; 460 1A043B5B124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginProcessProxyMessageReceiver.cpp; path = /Users/andersca/Build/Debug/DerivedSources/WebKit2/PluginProcessProxyMessageReceiver.cpp; sourceTree = "<absolute>"; }; 461 1A043B5C124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginProcessProxyMessages.h; path = /Users/andersca/Build/Debug/DerivedSources/WebKit2/PluginProcessProxyMessages.h; sourceTree = "<absolute>"; }; 456 462 1A0EC601124A9F2C007EF4A5 /* PluginProcessManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessManager.h; sourceTree = "<group>"; }; 457 463 1A0EC602124A9F2C007EF4A5 /* PluginProcessManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessManager.cpp; sourceTree = "<group>"; }; … … 1101 1107 1A0EC75D124BC7B2007EF4A5 /* PluginProcessProxy.cpp */, 1102 1108 1A0EC75C124BC7B2007EF4A5 /* PluginProcessProxy.h */, 1109 1A043B4C124D5E3600FFBFB5 /* PluginProcessProxy.messages.in */, 1103 1110 ); 1104 1111 path = Plugins; … … 1582 1589 1A0EC6BD124BBD9B007EF4A5 /* PluginProcessMessageReceiver.cpp */, 1583 1590 1A0EC6BE124BBD9B007EF4A5 /* PluginProcessMessages.h */, 1591 1A043B5B124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp */, 1592 1A043B5C124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h */, 1584 1593 C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */, 1585 1594 C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */, … … 1800 1809 1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */, 1801 1810 1A043A09124D11A900FFBFB5 /* WebProcessConnection.h in Headers */, 1811 1A043B5E124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h in Headers */, 1802 1812 ); 1803 1813 runOnlyForDeploymentPostprocessing = 0; … … 1884 1894 files = ( 1885 1895 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */, 1896 1A043B4D124D5E3600FFBFB5 /* PluginProcessProxy.messages.in in Resources */, 1886 1897 ); 1887 1898 runOnlyForDeploymentPostprocessing = 0; … … 2078 2089 1A043A0A124D11A900FFBFB5 /* WebProcessConnection.cpp in Sources */, 2079 2090 C06C6095124C144B0001682F /* WebPageCreationParameters.cpp in Sources */, 2091 1A043B5D124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp in Sources */, 2080 2092 ); 2081 2093 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebKit2Prefix.h
r65158 r68309 43 43 #define ENABLE_WEB_PROCESS_SANDBOX 1 44 44 #endif 45 46 // FIXME: Enable once this works well enough. 47 #define ENABLE_PLUGIN_PROCESS 0 45 48 46 49 #import <CoreGraphics/CoreGraphics.h>
Note: See TracChangeset
for help on using the changeset viewer.