summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/webplugin_delegate_proxy.h
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 03:27:28 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 03:27:28 +0000
commit77993d1399524545b78eff8281ac483b9c067837 (patch)
tree5df5d6eb4b47b541be1b1d96c64676d0c95ab2c4 /chrome/renderer/webplugin_delegate_proxy.h
parent6c7e007f28f871e84340727f948a4da10e979f80 (diff)
downloadchromium_src-77993d1399524545b78eff8281ac483b9c067837.zip
chromium_src-77993d1399524545b78eff8281ac483b9c067837.tar.gz
chromium_src-77993d1399524545b78eff8281ac483b9c067837.tar.bz2
Add acknowledgement messages for PluginMsg_UpdateGeometry. On the Mac, use
these acknowledgements to know when it's safe to dump old TransportDIBs in the renderer process. The Mac TransportDIB implementation uses base::SharedMemory, which cannot be disposed of if an in-flight UpdateGeometry message refers to the shared memory file descriptor. BUG=27510, 26754 TEST=1. From bug 25710: a. Visit http://www.dkmsoftware.com/Yubotu.htm b. Click "Play Now" c. Resize vigorously. Expect: no sad plug-in icon. 2. Test case from bug 26754 (affected machines only): a. Visit http://news.google.com/ b. Click the [+] to the left of a YouTube link. On affected machines, you'll get a sad plug-in icon. c. Click the [+] to the left of a different YouTube link. Expect: no crash. 3. Test case from bug 26754 comment 9 (affected machines only): a. Have lots of bookmarks (import Safari defaults) b. Right-click on bookmark bar, and choose "Open All Bookmarks" Expect: no crash. This change may not actually fix the third test case. Review URL: http://codereview.chromium.org/417005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.h')
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index d9cb3b3..02dd644 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -22,6 +22,11 @@
#include "webkit/glue/webplugininfo.h"
#include "webkit/glue/webplugin_delegate.h"
+#if defined(OS_MACOSX)
+#include "base/hash_tables.h"
+#include "base/linked_ptr.h"
+#endif
+
struct NPObject;
class NPObjectStub;
struct NPVariant_Param;
@@ -133,6 +138,10 @@ class WebPluginDelegateProxy
intptr_t notify_data);
void OnDeferResourceLoading(int resource_id, bool defer);
+#if defined(OS_MACOSX)
+ void OnUpdateGeometry_ACK(int ack_key);
+#endif
+
// Draw a graphic indicating a crashed plugin.
void PaintSadPlugin(WebKit::WebCanvas* canvas, const gfx::Rect& rect);
@@ -156,6 +165,24 @@ class WebPluginDelegateProxy
// point the window has already been destroyed).
void WillDestroyWindow();
+#if defined(OS_MACOSX)
+ // The Mac TransportDIB implementation uses base::SharedMemory, which
+ // cannot be disposed of if an in-flight UpdateGeometry message refers to
+ // the shared memory file descriptor. The old_transport_dibs_ map holds
+ // old TransportDIBs waiting to die. It's keyed by the |ack_key| values
+ // used in UpdateGeometry messages. When an UpdateGeometry_ACK message
+ // arrives, the associated RelatedTransportDIBs can be released.
+ struct RelatedTransportDIBs {
+ linked_ptr<TransportDIB> backing_store;
+ linked_ptr<TransportDIB> transport_store;
+ linked_ptr<TransportDIB> background_store;
+ };
+
+ typedef base::hash_map<int, RelatedTransportDIBs> OldTransportDIBMap;
+
+ OldTransportDIBMap old_transport_dibs_;
+#endif // OS_MACOSX
+
base::WeakPtr<RenderView> render_view_;
webkit_glue::WebPlugin* plugin_;
bool windowless_;