diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 22:31:32 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 22:31:32 +0000 |
commit | d6f2af9030eaac77695a97f4d3cb643ccacc3a78 (patch) | |
tree | 04684a311b407a0a1026dbd9199d19378bd1091a /chrome/common | |
parent | a80331bf8b8353b4335f3a751a7856833ea28a18 (diff) | |
download | chromium_src-d6f2af9030eaac77695a97f4d3cb643ccacc3a78.zip chromium_src-d6f2af9030eaac77695a97f4d3cb643ccacc3a78.tar.gz chromium_src-d6f2af9030eaac77695a97f4d3cb643ccacc3a78.tar.bz2 |
linux: destroy browser-side plugin windows on plugin crash
Because the plugin windows must be destroyed by the UI thread,
we store the map of plugin PID -> plugin windows there,
on the RenderWidgetHostView.
This differs slightly from Windows, where the map is stored
on the PluginProcessHost, but is otherwise pretty similar.
TEST=crash a windowed plugin; you should see a sad plugin
icon in the place of the plugin
Review URL: http://codereview.chromium.org/155517
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20683 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/ipc_message_utils.h | 6 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index ee199e2..8661507 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -179,8 +179,10 @@ struct ParamTraits<long> { } }; -#if defined(OS_LINUX) -// unsigned long is used for serializing X window ids. +#if defined(OS_LINUX) || defined(OS_WIN) +// On Linux, unsigned long is used for serializing X window ids. +// On Windows, it's used for serializing process ids. +// On Mac, it conflicts with some other definition. template <> struct ParamTraits<unsigned long> { typedef unsigned long param_type; diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index d3046d0..5410091 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -945,8 +945,15 @@ IPC_BEGIN_MESSAGES(ViewHost) FilePath /* plugin_path */) #if defined(OS_LINUX) - IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_CreatePluginContainer, + // A renderer sends this when it needs a browser-side widget for + // hosting a windowed plugin. The PID is the PID of the *plugin* + // process, which is used to associate the browser-side container with + // the lifetime of the plugin process. + IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_CreatePluginContainer, + base::ProcessId /* pid */, gfx::PluginWindowHandle /* container */) + + // Destroy a plugin container previously created using CreatePluginContainer. IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer, gfx::PluginWindowHandle /* container */) #endif @@ -1152,7 +1159,8 @@ IPC_BEGIN_MESSAGES(ViewHost) // Sent by the renderer process to indicate that a plugin instance has // crashed. - IPC_MESSAGE_ROUTED1(ViewHostMsg_CrashedPlugin, + IPC_MESSAGE_ROUTED2(ViewHostMsg_CrashedPlugin, + base::ProcessId /* plugin process id */, FilePath /* plugin_path */) // Displays a JavaScript out-of-memory message in the infobar. |