From 77993d1399524545b78eff8281ac483b9c067837 Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Mon, 30 Nov 2009 03:27:28 +0000 Subject: 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 --- chrome/common/plugin_messages.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'chrome/common/plugin_messages.h') diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h index c4c70fb..0bfddee 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -105,6 +105,14 @@ struct PluginMsg_UpdateGeometry_Param { gfx::Rect clip_rect; TransportDIB::Handle windowless_buffer; TransportDIB::Handle background_buffer; + +#if defined(OS_MACOSX) + // This field contains a key that the plug-in process is expected to return + // to the renderer in its ACK message, unless the value is -1, in which case + // no ACK message is required. Other than the special -1 value, the values + // used in ack_key are opaque to the plug-in process. + int ack_key; +#endif }; @@ -418,13 +426,21 @@ struct ParamTraits { WriteParam(m, p.clip_rect); WriteParam(m, p.windowless_buffer); WriteParam(m, p.background_buffer); +#if defined(OS_MACOSX) + WriteParam(m, p.ack_key); +#endif } static bool Read(const Message* m, void** iter, param_type* r) { return ReadParam(m, iter, &r->window_rect) && ReadParam(m, iter, &r->clip_rect) && ReadParam(m, iter, &r->windowless_buffer) && - ReadParam(m, iter, &r->background_buffer); + ReadParam(m, iter, &r->background_buffer) +#if defined(OS_MACOSX) + && + ReadParam(m, iter, &r->ack_key) +#endif + ; } static void Log(const param_type& p, std::wstring* l) { l->append(L"("); @@ -435,6 +451,10 @@ struct ParamTraits { LogParam(p.windowless_buffer, l); l->append(L", "); LogParam(p.background_buffer, l); +#if defined(OS_MACOSX) + l->append(L", "); + LogParam(p.ack_key, l); +#endif l->append(L")"); } }; -- cgit v1.1