diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-06 20:51:16 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-06 20:51:16 +0000 |
commit | 4e59e814cc1264300b597c3d62a8ccb4da264889 (patch) | |
tree | 3da745987d40a5ff16cade564043ea701af3f239 /chrome/plugin | |
parent | 718b1465c8916ac5b912ee57d6448ff8d772e414 (diff) | |
download | chromium_src-4e59e814cc1264300b597c3d62a8ccb4da264889.zip chromium_src-4e59e814cc1264300b597c3d62a8ccb4da264889.tar.gz chromium_src-4e59e814cc1264300b597c3d62a8ccb4da264889.tar.bz2 |
Fix problems with unloading/reloading/updating extensions that contain NPAPI
plugins, by ensuring that an extension's plugins are shut down and unloaded when the extension unloads.
BUG=34670
BUG=32806
Review URL: http://codereview.chromium.org/1596009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43756 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/plugin_channel.cc | 5 | ||||
-rw-r--r-- | chrome/plugin/plugin_channel.h | 3 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 6 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.h | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index bf14db2..c5913c3 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -153,6 +153,11 @@ PluginChannel* PluginChannel::GetPluginChannel(int renderer_id, return channel; } +// static +void PluginChannel::NotifyRenderersOfPendingShutdown() { + Broadcast(new PluginHostMsg_PluginShuttingDown()); +} + PluginChannel::PluginChannel() : renderer_handle_(0), renderer_id_(-1), diff --git a/chrome/plugin/plugin_channel.h b/chrome/plugin/plugin_channel.h index 22bcd99..609316a6 100644 --- a/chrome/plugin/plugin_channel.h +++ b/chrome/plugin/plugin_channel.h @@ -26,6 +26,9 @@ class PluginChannel : public PluginChannelBase { static PluginChannel* GetPluginChannel(int renderer_id, MessageLoop* ipc_message_loop); + // Send a message to all renderers that the process is going to shutdown. + static void NotifyRenderersOfPendingShutdown(); + ~PluginChannel(); virtual bool Send(IPC::Message* msg); diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index bd06bbd..688fe91 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -127,6 +127,8 @@ void PluginThread::OnControlMessageReceived(const IPC::Message& msg) { IPC_BEGIN_MESSAGE_MAP(PluginThread, msg) IPC_MESSAGE_HANDLER(PluginProcessMsg_CreateChannel, OnCreateChannel) IPC_MESSAGE_HANDLER(PluginProcessMsg_PluginMessage, OnPluginMessage) + IPC_MESSAGE_HANDLER(PluginProcessMsg_NotifyRenderersOfPendingShutdown, + OnNotifyRenderersOfPendingShutdown) #if defined(OS_MACOSX) IPC_MESSAGE_HANDLER(PluginProcessMsg_PluginFocusNotify, OnPluginFocusNotify) @@ -165,6 +167,10 @@ void PluginThread::OnPluginMessage(const std::vector<unsigned char> &data) { ChildProcess::current()->ReleaseProcess(); } +void PluginThread::OnNotifyRenderersOfPendingShutdown() { + PluginChannel::NotifyRenderersOfPendingShutdown(); +} + #if defined(OS_MACOSX) void PluginThread::OnPluginFocusNotify(uint32 instance_id) { WebPluginDelegateImpl* focused_instance = diff --git a/chrome/plugin/plugin_thread.h b/chrome/plugin/plugin_thread.h index b5eeefc..deca8d4 100644 --- a/chrome/plugin/plugin_thread.h +++ b/chrome/plugin/plugin_thread.h @@ -35,6 +35,7 @@ class PluginThread : public ChildThread { // Callback for when a channel has been created. void OnCreateChannel(int renderer_id, bool off_the_record); void OnPluginMessage(const std::vector<uint8> &data); + void OnNotifyRenderersOfPendingShutdown(); #if defined(OS_MACOSX) void OnAppActivated(); void OnPluginFocusNotify(uint32 instance_id); |