summaryrefslogtreecommitdiffstats
path: root/content/common/plugin_messages.h
diff options
context:
space:
mode:
authortschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-25 22:13:52 +0000
committertschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-25 22:13:52 +0000
commit9cf755682fcff0aa79e64c6f4fcb7ced80547d67 (patch)
tree227975248d1e781ac949dcde1a2291c11919d838 /content/common/plugin_messages.h
parentb8fede4e01b906a65ca9eb816e2cab0694810270 (diff)
downloadchromium_src-9cf755682fcff0aa79e64c6f4fcb7ced80547d67.zip
chromium_src-9cf755682fcff0aa79e64c6f4fcb7ced80547d67.tar.gz
chromium_src-9cf755682fcff0aa79e64c6f4fcb7ced80547d67.tar.bz2
Avoid double-buffering windowless plugins and instead use buffer flipping when feasible. This can significantly reduce the CPU usage of pages that host windowless plugins (down by ~15% absolute CPU usage on my old MacBookPro, or about a 40% relative decrease).
Also simplify the OS X code for managing TransportDIBs by creating them in uncached mode and transfering the FileDescriptors using dup+auto-close. TEST=(OS X 10.5) Google voice and video chat (O3D), YouTube, www.dkmsoftware.com/Yubotu.htm, and trailers.apple.com, incl. with violent resizing, and analyzed perf with Shark; (OS X 10.5, OS X 10.6, Linux, Windows) http://www.communitymx.com/content/source/E5141/wmodeopaque.htm, http://www.communitymx.com/content/source/E5141/wmodetrans.htm, http://www.communitymx.com/content/source/E5141/wmodenone.htm, hand-crafted perf test using Flash with wmode=opaque, analyzed perf with Activity Monitor / top / Process Explorer, verified in the debugger that buffer flips do not cause NPP_SetWindow calls BUG=none Review URL: http://codereview.chromium.org/7171024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/plugin_messages.h')
-rw-r--r--content/common/plugin_messages.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/content/common/plugin_messages.h b/content/common/plugin_messages.h
index 0b01cc8..4909bc2 100644
--- a/content/common/plugin_messages.h
+++ b/content/common/plugin_messages.h
@@ -52,16 +52,10 @@ IPC_STRUCT_BEGIN(PluginMsg_UpdateGeometry_Param)
IPC_STRUCT_MEMBER(gfx::Rect, window_rect)
IPC_STRUCT_MEMBER(gfx::Rect, clip_rect)
IPC_STRUCT_MEMBER(bool, transparent)
- IPC_STRUCT_MEMBER(TransportDIB::Handle, windowless_buffer)
+ IPC_STRUCT_MEMBER(TransportDIB::Handle, windowless_buffer0)
+ IPC_STRUCT_MEMBER(TransportDIB::Handle, windowless_buffer1)
+ IPC_STRUCT_MEMBER(int, windowless_buffer_index)
IPC_STRUCT_MEMBER(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.
- IPC_STRUCT_MEMBER(int, ack_key)
-#endif
IPC_STRUCT_END()
//-----------------------------------------------------------------------------
@@ -323,8 +317,9 @@ IPC_MESSAGE_ROUTED1(PluginHostMsg_URLRequest,
IPC_MESSAGE_ROUTED1(PluginHostMsg_CancelResource,
int /* id */)
-IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect,
- gfx::Rect /* rect */)
+IPC_MESSAGE_ROUTED2(PluginHostMsg_InvalidateRect,
+ gfx::Rect /* rect */,
+ bool /* allow_buffer_flipping */)
IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetWindowScriptNPObject,
int /* route id */,
@@ -364,9 +359,6 @@ IPC_SYNC_MESSAGE_CONTROL1_0(PluginHostMsg_SetException,
IPC_MESSAGE_CONTROL0(PluginHostMsg_PluginShuttingDown)
#if defined(OS_MACOSX)
-IPC_MESSAGE_ROUTED1(PluginHostMsg_UpdateGeometry_ACK,
- int /* ack_key */)
-
IPC_MESSAGE_ROUTED1(PluginHostMsg_FocusChanged,
bool /* focused */)