[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 13:53:52 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 04b4c9261c8942e11daf41fd6dc805eff590296d
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 28 23:53:25 2010 +0000
Begin hooking up painting in the plug-in process
https://bugs.webkit.org/show_bug.cgi?id=46766
Reviewed by Sam Weinig.
JavaScriptCore:
* JavaScriptCore.exp:
Add tryFastRealloc, used by WebKit2.
WebKit2:
* DerivedSources.make:
Add PluginControllerProxy.
* Platform/CoreIPC/MessageID.h:
Add a MessageClassPluginControllerProxy message class.
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::PluginControllerProxy):
Initialize the paint timer.
(WebKit::PluginControllerProxy::paint):
Create a graphics context referencing our backing store and paint into it.
(WebKit::PluginControllerProxy::invalidate):
Update the dirty rect and start the paint timer if necessary.
(WebKit::PluginControllerProxy::geometryDidChange):
If we're passed a new backing store handle, reinitialize the backing store.
* PluginProcess/PluginControllerProxy.messages.in: Added.
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::didReceiveMessage):
If the message has a destination ID, forward it to the plug-in controller proxy.
* Scripts/webkit2/messages.py:
Always include WebCoreArgumentCoders.h if the type is in the WebCore namespace.
* WebKit2.xcodeproj/project.pbxproj:
Add new files.
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::geometryDidChange):
Update the size of the backing store. Create a new plug-in backing store if needed and send
it over to the plug-in process.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index abf34b2..f64dc10 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-28 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Begin hooking up painting in the plug-in process
+ https://bugs.webkit.org/show_bug.cgi?id=46766
+
+ * JavaScriptCore.exp:
+ Add tryFastRealloc, used by WebKit2.
+
2010-09-28 Philippe Normand <pnormand at igalia.com>
Reviewed by Martin Robinson.
diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp
index 293387d..ff3d9b3 100644
--- a/JavaScriptCore/JavaScriptCore.exp
+++ b/JavaScriptCore/JavaScriptCore.exp
@@ -380,6 +380,7 @@ __ZN3WTF13tryFastCallocEmm
__ZN3WTF13tryFastMallocEm
__ZN3WTF14fastMallocSizeEPKv
__ZN3WTF14numberToStringEdPt
+__ZN3WTF14tryFastReallocEPvm
__ZN3WTF15ThreadCondition4waitERNS_5MutexE
__ZN3WTF15ThreadCondition6signalEv
__ZN3WTF15ThreadCondition9broadcastEv
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index b74b99b..3b95912 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -13,6 +13,48 @@
Reviewed by Sam Weinig.
+ Begin hooking up painting in the plug-in process
+ https://bugs.webkit.org/show_bug.cgi?id=46766
+
+ * DerivedSources.make:
+ Add PluginControllerProxy.
+
+ * Platform/CoreIPC/MessageID.h:
+ Add a MessageClassPluginControllerProxy message class.
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ (WebKit::PluginControllerProxy::PluginControllerProxy):
+ Initialize the paint timer.
+
+ (WebKit::PluginControllerProxy::paint):
+ Create a graphics context referencing our backing store and paint into it.
+
+ (WebKit::PluginControllerProxy::invalidate):
+ Update the dirty rect and start the paint timer if necessary.
+
+ (WebKit::PluginControllerProxy::geometryDidChange):
+ If we're passed a new backing store handle, reinitialize the backing store.
+
+ * PluginProcess/PluginControllerProxy.messages.in: Added.
+ * PluginProcess/WebProcessConnection.cpp:
+ (WebKit::WebProcessConnection::didReceiveMessage):
+ If the message has a destination ID, forward it to the plug-in controller proxy.
+
+ * Scripts/webkit2/messages.py:
+ Always include WebCoreArgumentCoders.h if the type is in the WebCore namespace.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ Add new files.
+
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::geometryDidChange):
+ Update the size of the backing store. Create a new plug-in backing store if needed and send
+ it over to the plug-in process.
+
+2010-09-28 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
ASSERT when launching the plugin process
https://bugs.webkit.org/show_bug.cgi?id=46754
<rdar://problem/8484570>
diff --git a/WebKit2/DerivedSources.make b/WebKit2/DerivedSources.make
index 036adb2..fb6b2e9 100644
--- a/WebKit2/DerivedSources.make
+++ b/WebKit2/DerivedSources.make
@@ -5,6 +5,7 @@ VPATH = \
#
MESSAGE_RECEIVERS = \
+ PluginControllerProxy \
PluginProcess \
PluginProcessProxy \
WebPage \
diff --git a/WebKit2/Platform/CoreIPC/MessageID.h b/WebKit2/Platform/CoreIPC/MessageID.h
index ddd988d..4a22eca 100644
--- a/WebKit2/Platform/CoreIPC/MessageID.h
+++ b/WebKit2/Platform/CoreIPC/MessageID.h
@@ -54,6 +54,7 @@ enum MessageClass {
// Messages sent by the web process to the plug-in process.
MessageClassWebProcessConnection,
+ MessageClassPluginControllerProxy,
};
template<typename> struct MessageKindTraits { };
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.cpp b/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 6c91cc0..0c90d22 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -27,9 +27,11 @@
#include "PluginControllerProxy.h"
+#include "BackingStore.h"
#include "NetscapePlugin.h"
#include "NotImplemented.h"
#include "PluginProcess.h"
+#include <WebCore/GraphicsContext.h>
#include <wtf/text/WTFString.h>
using namespace WebCore;
@@ -44,6 +46,7 @@ PassOwnPtr<PluginControllerProxy> PluginControllerProxy::create(WebProcessConnec
PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID)
: m_connection(connection)
, m_pluginInstanceID(pluginInstanceID)
+ , m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint)
{
}
@@ -73,9 +76,49 @@ void PluginControllerProxy::destroy()
m_plugin = 0;
}
-void PluginControllerProxy::invalidate(const IntRect&)
+void PluginControllerProxy::paint()
{
- notImplemented();
+ ASSERT(!m_dirtyRect.isEmpty());
+
+ if (!m_backingStore)
+ return;
+
+ IntRect dirtyRect = m_dirtyRect;
+ m_dirtyRect = IntRect();
+
+ // Create a graphics context.
+ OwnPtr<GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext();
+ graphicsContext->translate(-m_frameRect.x(), -m_frameRect.y());
+
+ ASSERT(m_plugin);
+ m_plugin->paint(graphicsContext.get(), dirtyRect);
+
+ // FIXME: Let the web process know that we've painted.
+}
+
+void PluginControllerProxy::invalidate(const IntRect& rect)
+{
+ // Convert the dirty rect to window coordinates.
+ IntRect dirtyRect = rect;
+ dirtyRect.move(m_frameRect.x(), m_frameRect.y());
+
+ // Make sure that the dirty rect is not greater than the plug-in itself.
+ dirtyRect.intersect(m_frameRect);
+
+ m_dirtyRect.unite(dirtyRect);
+
+ // Check if we should start the timer.
+
+ if (m_dirtyRect.isEmpty())
+ return;
+
+ // FIXME: Check clip rect.
+
+ if (m_paintTimer.isActive())
+ return;
+
+ // Start the timer.
+ m_paintTimer.startOneShot(0);
}
String PluginControllerProxy::userAgent(const WebCore::KURL&)
@@ -133,6 +176,21 @@ void PluginControllerProxy::pluginProcessCrashed()
notImplemented();
}
+void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle)
+{
+ m_frameRect = frameRect;
+ m_clipRect = clipRect;
+
+ ASSERT(m_plugin);
+
+ if (!backingStoreHandle.isNull()) {
+ // Create a new backing store.
+ m_backingStore = BackingStore::create(frameRect.size(), backingStoreHandle);
+ }
+
+ m_plugin->geometryDidChange(frameRect, clipRect);
+}
+
} // namespace WebKit
#endif // ENABLE(PLUGIN_PROCESS)
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.h b/WebKit2/PluginProcess/PluginControllerProxy.h
index 7066202..7946380 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -31,10 +31,13 @@
#include "Connection.h"
#include "Plugin.h"
#include "PluginController.h"
+#include "RunLoop.h"
+#include "SharedMemory.h"
#include <wtf/Noncopyable.h>
namespace WebKit {
+class BackingStore;
class WebProcessConnection;
class PluginControllerProxy : PluginController {
@@ -49,9 +52,13 @@ public:
bool initialize(const Plugin::Parameters&);
void destroy();
+ void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
private:
PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID);
+ void paint();
+
// PluginController
virtual void invalidate(const WebCore::IntRect&);
virtual String userAgent(const WebCore::KURL&);
@@ -65,10 +72,26 @@ private:
virtual bool isAcceleratedCompositingEnabled();
virtual void pluginProcessCrashed();
+ // Message handlers.
+ void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle);
+
WebProcessConnection* m_connection;
uint64_t m_pluginInstanceID;
RefPtr<Plugin> m_plugin;
+
+ // The plug-in rect and clip rect in window coordinates.
+ WebCore::IntRect m_frameRect;
+ WebCore::IntRect m_clipRect;
+
+ // The dirty rect in plug-in coordinates.
+ WebCore::IntRect m_dirtyRect;
+
+ // The paint timer, used for coalescing painting.
+ RunLoop::Timer<PluginControllerProxy> m_paintTimer;
+
+ // The backing store that this plug-in draws into.
+ RefPtr<BackingStore> m_backingStore;
};
} // namespace WebKit
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.messages.in b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
new file mode 100644
index 0000000..9f11fb9
--- /dev/null
+++ b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
@@ -0,0 +1,30 @@
+# Copyright (C) 2010 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#if ENABLE(PLUGIN_PROCESS)
+
+messages -> PluginControllerProxy {
+ # Called when the plug-in geometry changes.
+ GeometryDidChange(WebCore::IntRect frameRect, WebCore::IntRect clipRect, WebKit::SharedMemory::Handle backingStoreHandle)
+}
+
+#endif
diff --git a/WebKit2/PluginProcess/WebProcessConnection.cpp b/WebKit2/PluginProcess/WebProcessConnection.cpp
index 076a2b6..fbbdb45 100644
--- a/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -87,7 +87,8 @@ void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pl
void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
- // FIXME: Implement.
+ PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
+ pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, arguments);
}
CoreIPC::SyncReplyMode WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
diff --git a/WebKit2/Scripts/webkit2/messages.py b/WebKit2/Scripts/webkit2/messages.py
index 780dc9b..4171352 100644
--- a/WebKit2/Scripts/webkit2/messages.py
+++ b/WebKit2/Scripts/webkit2/messages.py
@@ -304,6 +304,12 @@ def argument_coder_headers_for_type(type):
if type in special_cases:
return [special_cases[type]]
+ split = type.split('::')
+ if len(split) < 2:
+ return []
+ if split[0] == 'WebCore':
+ return ['"WebCoreArgumentCoders.h"']
+
return []
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 770d923..b984184 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -110,6 +110,9 @@
1A6FBD2911E69BC200DB1371 /* NetscapePlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FBD2711E69BC200DB1371 /* NetscapePlugin.cpp */; };
1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8EF4C91252403700F7067F /* PluginControllerProxy.h */; };
1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */; };
+ 1A8EF9421252AE8400F7067F /* PluginControllerProxy.messages.in in Resources */ = {isa = PBXBuildFile; fileRef = 1A8EF9411252AE8400F7067F /* PluginControllerProxy.messages.in */; };
+ 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */; };
+ 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8EF96D1252AF6B00F7067F /* PluginControllerProxyMessages.h */; };
1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
1AA56F2911E92BC80061B882 /* PluginController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA56F2811E92BC80061B882 /* PluginController.h */; };
@@ -541,6 +544,9 @@
1A6FBD2711E69BC200DB1371 /* NetscapePlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePlugin.cpp; sourceTree = "<group>"; };
1A8EF4C91252403700F7067F /* PluginControllerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginControllerProxy.h; sourceTree = "<group>"; };
1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginControllerProxy.cpp; sourceTree = "<group>"; };
+ 1A8EF9411252AE8400F7067F /* PluginControllerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginControllerProxy.messages.in; sourceTree = "<group>"; };
+ 1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginControllerProxyMessageReceiver.cpp; path = ../../../Debug/DerivedSources/WebKit2/PluginControllerProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+ 1A8EF96D1252AF6B00F7067F /* PluginControllerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginControllerProxyMessages.h; path = ../../../Debug/DerivedSources/WebKit2/PluginControllerProxyMessages.h; sourceTree = "<group>"; };
1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
@@ -963,6 +969,7 @@
1A0EC7FD124BD402007EF4A5 /* mac */,
1A8EF4CA1252403700F7067F /* PluginControllerProxy.cpp */,
1A8EF4C91252403700F7067F /* PluginControllerProxy.h */,
+ 1A8EF9411252AE8400F7067F /* PluginControllerProxy.messages.in */,
1A043975124D034800FFBFB5 /* PluginProcess.cpp */,
1A043974124D034800FFBFB5 /* PluginProcess.h */,
1A0EC6B1124BBD36007EF4A5 /* PluginProcess.messages.in */,
@@ -1654,6 +1661,8 @@
C0CE729D1247E71D00BC0EC4 /* Derived Sources */ = {
isa = PBXGroup;
children = (
+ 1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */,
+ 1A8EF96D1252AF6B00F7067F /* PluginControllerProxyMessages.h */,
1A0EC6BD124BBD9B007EF4A5 /* PluginProcessMessageReceiver.cpp */,
1A0EC6BE124BBD9B007EF4A5 /* PluginProcessMessages.h */,
1A043B5B124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp */,
@@ -1887,6 +1896,7 @@
1A043F6A12514D8B00FFBFB5 /* WebProcessConnectionMessages.h in Headers */,
1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */,
C09AE5E9125257C20025825D /* WKNativeEvent.h in Headers */,
+ 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1973,6 +1983,7 @@
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
1A043B4D124D5E3600FFBFB5 /* PluginProcessProxy.messages.in in Resources */,
1A043F5A12514CF300FFBFB5 /* WebProcessConnection.messages.in in Resources */,
+ 1A8EF9421252AE8400F7067F /* PluginControllerProxy.messages.in in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2177,6 +2188,7 @@
1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */,
1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */,
C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */,
+ 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index 2541ea7..0cd0716 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -27,9 +27,12 @@
#include "PluginProxy.h"
+#include "BackingStore.h"
#include "NotImplemented.h"
#include "PluginController.h"
+#include "PluginControllerProxyMessages.h"
#include "PluginProcessConnection.h"
+#include "WebCoreArgumentCoders.h"
#include "WebProcessConnectionMessages.h"
using namespace WebCore;
@@ -117,7 +120,38 @@ PlatformLayer* PluginProxy::pluginLayer()
void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect)
{
- notImplemented();
+ ASSERT(m_isStarted);
+
+ m_frameRect = frameRect;
+
+ bool didUpdateBackingStore = false;
+ if (!m_backingStore) {
+ m_backingStore = BackingStore::create(frameRect.size());
+ didUpdateBackingStore = true;
+ } else if (frameRect.size() != m_backingStore->size()) {
+ // The backing store already exists, just resize it.
+ if (!m_backingStore->resize(frameRect.size()))
+ return;
+
+ didUpdateBackingStore = true;
+ }
+
+ SharedMemory::Handle pluginBackingStoreHandle;
+
+ if (didUpdateBackingStore) {
+ // Create a new plug-in backing store.
+ m_pluginBackingStore = BackingStore::createSharable(frameRect.size());
+ if (!m_pluginBackingStore)
+ return;
+
+ // Create a handle to the plug-in backing store so we can send it over.
+ if (!m_pluginBackingStore->createHandle(pluginBackingStoreHandle)) {
+ m_pluginBackingStore.clear();
+ return;
+ }
+ }
+
+ m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(frameRect, clipRect, pluginBackingStoreHandle), m_pluginInstanceID);
}
void PluginProxy::frameDidFinishLoading(uint64_t requestID)
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.h b/WebKit2/WebProcess/Plugins/PluginProxy.h
index 646f515..c122802 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -33,6 +33,7 @@
namespace WebKit {
+class BackingStore;
class PluginProcessConnection;
class PluginProxy : public Plugin, public CoreIPC::Connection::MessageReceiver {
@@ -88,6 +89,16 @@ private:
PluginController* m_pluginController;
+ // The plug-in rect in window coordinates.
+ WebCore::IntRect m_frameRect;
+
+ // This is the backing store that we paint when we're told to paint.
+ RefPtr<BackingStore> m_backingStore;
+
+ // This is the shared memory backing store that the plug-in paints into. When the plug-in tells us
+ // that it's painted something in it, we'll blit from it to our own backing store.
+ RefPtr<BackingStore> m_pluginBackingStore;
+
bool m_isStarted;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list