Changeset 71270 in webkit
- Timestamp:
- Nov 3, 2010 2:44:23 PM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r71261 r71270 1 2010-11-03 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Out of process plug-ins don't support the CA drawing model 6 https://bugs.webkit.org/show_bug.cgi?id=48950 7 <rdar://problem/8626019> 8 9 * Platform/CoreIPC/HandleMessage.h: 10 (CoreIPC::callMemberFunction): 11 Add new overload. 12 13 * PluginProcess/PluginControllerProxy.cpp: 14 (WebKit::PluginControllerProxy::initialize): 15 Call platformInitialize(). 16 17 (WebKit::PluginControllerProxy::destroy): 18 Call platformDestroy(). 19 20 (WebKit::PluginControllerProxy::isAcceleratedCompositingEnabled): 21 Assume that accelerated compositing is available if we have a render server port. 22 23 (WebKit::PluginControllerProxy::geometryDidChange): 24 Call platformGeometryDidChange(). 25 26 * PluginProcess/PluginProcess.h: 27 * PluginProcess/WebProcessConnection.cpp: 28 (WebKit::WebProcessConnection::createPlugin): 29 Pass back the remote layer client ID. 30 31 * PluginProcess/WebProcessConnection.messages.in: 32 Add a remoteLayerClientID out parameter to CreatePlugin. 33 34 * PluginProcess/mac/PluginControllerProxyMac.mm: Added. 35 (WebKit::PluginControllerProxy::platformInitialize): 36 If the plug-in has a layer, create a remote layer client and associate it with the layer. 37 38 (WebKit::PluginControllerProxy::platformDestroy): 39 Invalidate the remote layer client. 40 41 (WebKit::PluginControllerProxy::remoteLayerClientID): 42 Return the remote layer client ID if one exists. 43 44 (WebKit::PluginControllerProxy::platformGeometryDidChange): 45 Update the layer bounds. 46 47 * WebKit2.xcodeproj/project.pbxproj: 48 Add new files. 49 50 * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: Added. 51 (WebKit::PluginProxy::pluginLayer): 52 Create a render layer if needed. 53 54 (WebKit::PluginProxy::needsBackingStore): 55 Return whether the plug-in needs a backing store. (It doesn't need a backing store if it's a CA plug-in). 56 57 * WebProcess/Plugins/PluginProxy.cpp: 58 (WebKit::PluginProxy::PluginProxy): 59 Initialize m_remoteLayerClientID. 60 61 (WebKit::PluginProxy::initialize): 62 Set m_remoteLayerClientID. 63 64 (WebKit::PluginProxy::paint): 65 Bail if the plug-in doesn't need a backing store. 66 67 (WebKit::PluginProxy::geometryDidChange): 68 Don't create a backing store if the plug-in doesn't need one. 69 70 * WebProcess/WebPage/LayerBackedDrawingArea.cpp: 71 (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea): 72 Remove RetainPtr initialization. 73 74 * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm: 75 (WebKit::LayerBackedDrawingArea::platformClear): 76 Use nullptr instead of 0. 77 1 78 2010-11-03 Anders Carlsson <andersca@apple.com> 2 79 -
trunk/WebKit2/Platform/CoreIPC/HandleMessage.h
r71183 r71270 128 128 } 129 129 130 template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename R1, typename R2> 131 void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, Arguments2<R1, R2>& replyArgs, C* object, MF function) 132 { 133 (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, replyArgs.argument1, replyArgs.argument2); 134 } 135 130 136 // Variadic dispatch functions. 131 137 -
trunk/WebKit2/PluginProcess/PluginControllerProxy.cpp
r71173 r71270 75 75 } 76 76 77 platformInitialize(); 78 77 79 return true; 78 80 } … … 84 86 m_plugin->destroy(); 85 87 m_plugin = 0; 88 89 platformDestroy(); 86 90 } 87 91 … … 194 198 bool PluginControllerProxy::isAcceleratedCompositingEnabled() 195 199 { 196 notImplemented(); 197 return false; 200 return PluginProcess::shared().compositingRenderServerPort(); 198 201 } 199 202 … … 246 249 247 250 m_plugin->geometryDidChange(frameRect, clipRect); 251 252 platformGeometryDidChange(frameRect, clipRect); 248 253 } 249 254 -
trunk/WebKit2/PluginProcess/PluginControllerProxy.h
r71173 r71270 36 36 #include <wtf/Noncopyable.h> 37 37 38 #if PLATFORM(MAC) 39 #include <wtf/RetainPtr.h> 40 41 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef; 42 #endif 43 38 44 namespace CoreIPC { 39 45 class DataReference; … … 59 65 void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); 60 66 CoreIPC::SyncReplyMode didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*); 67 68 #if PLATFORM(MAC) 69 uint32_t remoteLayerClientID() const; 70 #endif 61 71 62 72 private: … … 107 117 void privateBrowsingStateChanged(bool); 108 118 119 void platformInitialize(); 120 void platformDestroy(); 121 void platformGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect); 122 109 123 WebProcessConnection* m_connection; 110 124 uint64_t m_pluginInstanceID; … … 131 145 // The backing store that this plug-in draws into. 132 146 RefPtr<BackingStore> m_backingStore; 147 148 #if PLATFORM(MAC) 149 // For CA plug-ins, this holds the information needed to export the layer hierarchy to the UI process. 150 RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient; 151 #endif 133 152 }; 134 153 -
trunk/WebKit2/PluginProcess/PluginProcess.h
r71247 r71270 48 48 NetscapePluginModule* netscapePluginModule() const { return m_pluginModule.get(); } 49 49 50 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC) 51 mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; } 52 #endif 53 50 54 private: 51 55 PluginProcess(); -
trunk/WebKit2/PluginProcess/WebProcessConnection.cpp
r71127 r71270 146 146 } 147 147 148 void WebProcessConnection::createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters& parameters, const String& userAgent, bool isPrivateBrowsingEnabled, bool& result )148 void WebProcessConnection::createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters& parameters, const String& userAgent, bool isPrivateBrowsingEnabled, bool& result, uint32_t& remoteLayerClientID) 149 149 { 150 150 OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, pluginInstanceID, userAgent, isPrivateBrowsingEnabled); … … 159 159 result = pluginControllerProxyPtr->initialize(parameters); 160 160 161 if ( !result) {162 // We failed to initialize, remove the plug-in controller. This could cause us to be deleted.163 re movePluginControllerProxy(pluginControllerProxyPtr);161 if (result) { 162 remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID(); 163 return; 164 164 } 165 166 // We failed to initialize, remove the plug-in controller. This could cause us to be deleted. 167 removePluginControllerProxy(pluginControllerProxyPtr); 165 168 } 166 169 -
trunk/WebKit2/PluginProcess/WebProcessConnection.h
r71081 r71270 65 65 // Message handlers. 66 66 CoreIPC::SyncReplyMode didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*); 67 void createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters&, const String& userAgent, bool isPrivateBrowsingEnabled, bool& result );67 void createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters&, const String& userAgent, bool isPrivateBrowsingEnabled, bool& result, uint32_t& remoteLayerClientID); 68 68 void destroyPlugin(uint64_t pluginInstanceID); 69 69 -
trunk/WebKit2/PluginProcess/WebProcessConnection.messages.in
r68989 r71270 25 25 messages -> WebProcessConnection { 26 26 # Creates a plug-in instance with the given instance ID. 27 CreatePlugin(uint64_t pluginInstanceID, WebKit::Plugin::Parameters parameters, WTF::String userAgent, bool isPrivateBrowsingEnabled) -> (bool result )27 CreatePlugin(uint64_t pluginInstanceID, WebKit::Plugin::Parameters parameters, WTF::String userAgent, bool isPrivateBrowsingEnabled) -> (bool result, uint32_t remoteLayerClientID) 28 28 29 29 # Destroys the plug-in instance with the given instance ID. -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r71247 r71270 97 97 1A2D90D21281C966001EB962 /* PluginProcessCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D90D01281C966001EB962 /* PluginProcessCreationParameters.h */; }; 98 98 1A2D90D31281C966001EB962 /* PluginProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D90D11281C966001EB962 /* PluginProcessCreationParameters.cpp */; }; 99 1A2D91A61281D739001EB962 /* PluginControllerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D91A51281D739001EB962 /* PluginControllerProxyMac.mm */; }; 100 1A2D92211281DC1B001EB962 /* PluginProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D92201281DC1B001EB962 /* PluginProxyMac.mm */; }; 99 101 1A30066E1110F4F70031937C /* ResponsivenessTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A30066C1110F4F70031937C /* ResponsivenessTimer.h */; }; 100 102 1A30EAC6115D7DA30053E937 /* ConnectionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A30EAC5115D7DA30053E937 /* ConnectionMac.cpp */; }; … … 614 616 1A2D90D01281C966001EB962 /* PluginProcessCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessCreationParameters.h; sourceTree = "<group>"; }; 615 617 1A2D90D11281C966001EB962 /* PluginProcessCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessCreationParameters.cpp; sourceTree = "<group>"; }; 618 1A2D91A51281D739001EB962 /* PluginControllerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginControllerProxyMac.mm; sourceTree = "<group>"; }; 619 1A2D92201281DC1B001EB962 /* PluginProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProxyMac.mm; sourceTree = "<group>"; }; 616 620 1A30066C1110F4F70031937C /* ResponsivenessTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResponsivenessTimer.h; sourceTree = "<group>"; }; 617 621 1A30EAC5115D7DA30053E937 /* ConnectionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectionMac.cpp; sourceTree = "<group>"; }; … … 1176 1180 isa = PBXGroup; 1177 1181 children = ( 1182 1A2D91A51281D739001EB962 /* PluginControllerProxyMac.mm */, 1178 1183 1A0EC802124BD41E007EF4A5 /* PluginProcessMainMac.mm */, 1179 1184 ); … … 1276 1281 children = ( 1277 1282 1AE5B7F911E7AED200BA6767 /* NetscapePluginMac.mm */, 1283 1A2D92201281DC1B001EB962 /* PluginProxyMac.mm */, 1278 1284 ); 1279 1285 path = mac; … … 2631 2637 1A2D90BB1281C931001EB962 /* PluginProcessProxyMac.mm in Sources */, 2632 2638 1A2D90D31281C966001EB962 /* PluginProcessCreationParameters.cpp in Sources */, 2639 1A2D91A61281D739001EB962 /* PluginControllerProxyMac.mm in Sources */, 2640 1A2D92211281DC1B001EB962 /* PluginProxyMac.mm in Sources */, 2633 2641 ); 2634 2642 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
r70903 r71270 124 124 if (NPP_GetValue(NPPVpluginCoreAnimationLayer, &value) == NPERR_NO_ERROR && value) { 125 125 ASSERT(!m_pluginLayer); 126 m_pluginLayer = reinterpret_cast<CALayer *>(value);126 m_pluginLayer = reinterpret_cast<CALayer *>(value); 127 127 } 128 128 } -
trunk/WebKit2/WebProcess/Plugins/PluginProxy.cpp
r71173 r71270 63 63 , m_isStarted(false) 64 64 , m_waitingForPaintInResponseToUpdate(false) 65 , m_remoteLayerClientID(0) 65 66 { 66 67 } … … 90 91 bool result = false; 91 92 92 if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(m_pluginInstanceID, parameters, pluginController->userAgent(), pluginController->isPrivateBrowsingEnabled()), Messages::WebProcessConnection::CreatePlugin::Reply(result), 0) || !result) { 93 uint32_t remoteLayerClientID = 0; 94 if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(m_pluginInstanceID, parameters, pluginController->userAgent(), pluginController->isPrivateBrowsingEnabled()), Messages::WebProcessConnection::CreatePlugin::Reply(result, remoteLayerClientID), 0) || !result) { 93 95 m_connection->removePluginProxy(this); 94 96 return false; 95 97 } 96 98 99 m_remoteLayerClientID = remoteLayerClientID; 97 100 m_isStarted = true; 98 101 … … 112 115 void PluginProxy::paint(GraphicsContext* graphicsContext, const IntRect& dirtyRect) 113 116 { 114 if (! m_backingStore)117 if (!needsBackingStore() || !m_backingStore) 115 118 return; 116 119 … … 143 146 } 144 147 145 #if PLATFORM(MAC)146 PlatformLayer* PluginProxy::pluginLayer()147 {148 notImplemented();149 return 0;150 }151 #endif152 153 148 void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect) 154 149 { … … 156 151 157 152 m_frameRect = frameRect; 153 154 if (!needsBackingStore()) { 155 SharedMemory::Handle pluginBackingStoreHandle; 156 m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(frameRect, clipRect, pluginBackingStoreHandle), m_pluginInstanceID); 157 return; 158 } 158 159 159 160 bool didUpdateBackingStore = false; -
trunk/WebKit2/WebProcess/Plugins/PluginProxy.h
r70927 r71270 31 31 #include "Connection.h" 32 32 #include "Plugin.h" 33 34 #if PLATFORM(MAC) 35 #include <wtf/RetainPtr.h> 36 #ifdef __OBJC__ 37 @class CALayer; 38 #else 39 class CALayer; 40 #endif 41 #endif 33 42 34 43 namespace WebCore { … … 92 101 virtual PluginController* controller(); 93 102 103 bool needsBackingStore() const; 104 94 105 // Message handlers. 95 106 void loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const WebCore::HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups); … … 122 133 // Whether we're called invalidate in response to an update call, and are now waiting for a paint call. 123 134 bool m_waitingForPaintInResponseToUpdate; 135 136 // The client ID for the CA layer in the plug-in process. Will be 0 if the plug-in is not a CA plug-in. 137 uint32_t m_remoteLayerClientID; 138 139 #if PLATFORM(MAC) 140 RetainPtr<CALayer> m_pluginLayer; 141 #endif 124 142 }; 125 143 -
trunk/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp
r71261 r71270 43 43 : DrawingArea(LayerBackedDrawingAreaType, identifier, webPage) 44 44 , m_syncTimer(WebProcess::shared().runLoop(), this, &LayerBackedDrawingArea::syncCompositingLayers) 45 #if PLATFORM(MAC) && HAVE(HOSTED_CORE_ANIMATION)46 , m_remoteLayerRef(0)47 #endif48 45 , m_attached(false) 49 46 , m_shouldPaint(true) -
trunk/WebKit2/WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm
r70920 r71270 62 62 #if HAVE(HOSTED_CORE_ANIMATION) 63 63 WKCARemoteLayerClientInvalidate(m_remoteLayerRef.get()); 64 m_remoteLayerRef = 0;64 m_remoteLayerRef = nullptr; 65 65 #endif 66 66
Note: See TracChangeset
for help on using the changeset viewer.