summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-14 23:24:32 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-14 23:24:32 +0000
commit3ebb3eb23535757d0525eec1dc903dd237571104 (patch)
tree961b5616d23086ccc42bff031103b96c2c3ff145 /chrome
parent54ff8593182da0591ecb2715bcf42aec51f4f3db (diff)
downloadchromium_src-3ebb3eb23535757d0525eec1dc903dd237571104.zip
chromium_src-3ebb3eb23535757d0525eec1dc903dd237571104.tar.gz
chromium_src-3ebb3eb23535757d0525eec1dc903dd237571104.tar.bz2
Reverting 20683.
Review URL: http://codereview.chromium.org/155539 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc5
-rw-r--r--chrome/browser/renderer_host/render_view_host.h2
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc5
-rw-r--r--chrome/browser/renderer_host/render_widget_host.h4
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view.h5
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc25
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.h9
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.h4
-rw-r--r--chrome/common/ipc_message_utils.h6
-rw-r--r--chrome/common/render_messages_internal.h12
-rw-r--r--chrome/renderer/render_view.cc5
-rw-r--r--chrome/renderer/render_view.h4
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc4
13 files changed, 20 insertions, 70 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index ff6b8e3..b41c04c 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1361,10 +1361,7 @@ void RenderViewHost::OnMissingPluginStatus(int status) {
integration_delegate->OnMissingPluginStatus(status);
}
-void RenderViewHost::OnCrashedPlugin(base::ProcessId pid,
- const FilePath& plugin_path) {
- view()->PluginProcessCrashed(pid);
-
+void RenderViewHost::OnCrashedPlugin(const FilePath& plugin_path) {
RenderViewHostDelegate::BrowserIntegration* integration_delegate =
delegate_->GetBrowserIntegrationDelegate();
if (integration_delegate)
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 90a4d53..a43c5a2 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -525,7 +525,7 @@ class RenderViewHost : public RenderWidgetHost,
void OnUserMetricsRecordAction(const std::wstring& action);
void OnMissingPluginStatus(int status);
- void OnCrashedPlugin(base::ProcessId pid, const FilePath& plugin_path);
+ void OnCrashedPlugin(const FilePath& plugin_path);
void OnMessageReceived(IPC::Message* msg) { }
void OnReceivedSavableResourceLinksForCurrentPage(
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index b6369d8..cdadd9e 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -754,9 +754,8 @@ void RenderWidgetHost::OnMsgImeUpdateStatus(int control,
#if defined(OS_LINUX)
void RenderWidgetHost::OnMsgCreatePluginContainer(
- base::ProcessId pid,
- gfx::PluginWindowHandle* container) {
- *container = view_->CreatePluginContainer(pid);
+ gfx::PluginWindowHandle *container) {
+ *container = view_->CreatePluginContainer();
}
void RenderWidgetHost::OnMsgDestroyPluginContainer(
diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h
index 88bcf18..e133670 100644
--- a/chrome/browser/renderer_host/render_widget_host.h
+++ b/chrome/browser/renderer_host/render_widget_host.h
@@ -8,7 +8,6 @@
#include <queue>
#include <vector>
-#include "base/process.h"
#include "base/gfx/native_widget_types.h"
#include "base/gfx/size.h"
#include "base/scoped_ptr.h"
@@ -395,8 +394,7 @@ class RenderWidgetHost : public IPC::Channel::Listener {
// having to bring in render_messages.h in a header file.
void OnMsgImeUpdateStatus(int control, const gfx::Rect& caret_rect);
#if defined(OS_LINUX)
- void OnMsgCreatePluginContainer(base::ProcessId pid,
- gfx::PluginWindowHandle* container);
+ void OnMsgCreatePluginContainer(gfx::PluginWindowHandle *container);
void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle container);
#elif defined(OS_MACOSX)
void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params);
diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h
index b5609e2..0837bc7 100644
--- a/chrome/browser/renderer_host/render_widget_host_view.h
+++ b/chrome/browser/renderer_host/render_widget_host_view.h
@@ -159,13 +159,10 @@ class RenderWidgetHostView {
#endif
#if defined(OS_LINUX)
- virtual gfx::PluginWindowHandle CreatePluginContainer(
- base::ProcessId plugin_process_id) = 0;
+ virtual gfx::PluginWindowHandle CreatePluginContainer() = 0;
virtual void DestroyPluginContainer(gfx::PluginWindowHandle container) = 0;
#endif
- virtual void PluginProcessCrashed(base::ProcessId pid) { }
-
void set_activatable(bool activatable) {
activatable_ = activatable;
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 3bb7425..2693be6 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -16,7 +16,6 @@
#include "base/string_util.h"
#include "base/task.h"
#include "base/time.h"
-#include "chrome/browser/plugin_process_host.h"
#include "chrome/common/native_web_keyboard_event.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/x11_util.h"
@@ -726,31 +725,11 @@ void RenderWidgetHostViewGtk::ReceivedSelectionText(GtkClipboard* clipboard,
UTF8ToUTF16(text)));
}
-gfx::PluginWindowHandle RenderWidgetHostViewGtk::CreatePluginContainer(
- base::ProcessId plugin_process_id) {
- gfx::PluginWindowHandle handle =
- plugin_container_manager_.CreatePluginContainer();
- plugin_pid_map_.insert(std::make_pair(plugin_process_id, handle));
- return handle;
+gfx::PluginWindowHandle RenderWidgetHostViewGtk::CreatePluginContainer() {
+ return plugin_container_manager_.CreatePluginContainer();
}
void RenderWidgetHostViewGtk::DestroyPluginContainer(
gfx::PluginWindowHandle container) {
plugin_container_manager_.DestroyPluginContainer(container);
-
- for (PluginPidMap::iterator i = plugin_pid_map_.begin();
- i != plugin_pid_map_.end(); ++i) {
- if (i->second == container) {
- plugin_pid_map_.erase(i);
- break;
- }
- }
-}
-
-void RenderWidgetHostViewGtk::PluginProcessCrashed(base::ProcessId pid) {
- for (PluginPidMap::iterator i = plugin_pid_map_.find(pid);
- i != plugin_pid_map_.end() && i->first == pid; ++i) {
- plugin_container_manager_.DestroyPluginContainer(i->second);
- }
- plugin_pid_map_.erase(pid);
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
index d4a40ef..1caa1ac 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
@@ -60,10 +60,8 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
virtual void PasteFromSelectionClipboard();
virtual void ShowingContextMenu(bool showing);
virtual BackingStore* AllocBackingStore(const gfx::Size& size);
- virtual gfx::PluginWindowHandle CreatePluginContainer(
- base::ProcessId plugin_process_id);
+ virtual gfx::PluginWindowHandle CreatePluginContainer();
virtual void DestroyPluginContainer(gfx::PluginWindowHandle container);
- virtual void PluginProcessCrashed(base::ProcessId pid);
gfx::NativeView native_view() const { return view_.get(); }
@@ -145,11 +143,6 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
// Helper class that lets us allocate plugin containers and move them.
GtkPluginContainerManager plugin_container_manager_;
-
- // A map of plugin process id -> windows related to that process.
- // Lets us clean up immediately when a plugin process crashes.
- typedef std::multimap<base::ProcessId, gfx::PluginWindowHandle> PluginPidMap;
- PluginPidMap plugin_pid_map_;
};
#endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h
index aa24b0c..dcc3e1a 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test/test_render_view_host.h
@@ -82,9 +82,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
#endif
#if defined(OS_LINUX)
- virtual gfx::PluginWindowHandle CreatePluginContainer(base::ProcessId) {
- return 0;
- }
+ virtual gfx::PluginWindowHandle CreatePluginContainer() { return 0; }
virtual void DestroyPluginContainer(gfx::PluginWindowHandle container) { }
#endif
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index 8661507..ee199e2 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -179,10 +179,8 @@ struct ParamTraits<long> {
}
};
-#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.
+#if defined(OS_LINUX)
+// unsigned long is used for serializing X window ids.
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 5410091..d3046d0 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -945,15 +945,8 @@ IPC_BEGIN_MESSAGES(ViewHost)
FilePath /* plugin_path */)
#if defined(OS_LINUX)
- // 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 */,
+ IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_CreatePluginContainer,
gfx::PluginWindowHandle /* container */)
-
- // Destroy a plugin container previously created using CreatePluginContainer.
IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer,
gfx::PluginWindowHandle /* container */)
#endif
@@ -1159,8 +1152,7 @@ IPC_BEGIN_MESSAGES(ViewHost)
// Sent by the renderer process to indicate that a plugin instance has
// crashed.
- IPC_MESSAGE_ROUTED2(ViewHostMsg_CrashedPlugin,
- base::ProcessId /* plugin process id */,
+ IPC_MESSAGE_ROUTED1(ViewHostMsg_CrashedPlugin,
FilePath /* plugin_path */)
// Displays a JavaScript out-of-memory message in the infobar.
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 15d7771..436de6e 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -255,9 +255,8 @@ void RenderView::PluginDestroyed(WebPluginDelegateProxy* proxy) {
first_default_plugin_ = NULL;
}
-void RenderView::PluginCrashed(base::ProcessId pid,
- const FilePath& plugin_path) {
- Send(new ViewHostMsg_CrashedPlugin(routing_id_, pid, plugin_path));
+void RenderView::PluginCrashed(const FilePath& plugin_path) {
+ Send(new ViewHostMsg_CrashedPlugin(routing_id_, plugin_path));
}
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 0b1a38a..ba6374d 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -325,8 +325,8 @@ class RenderView : public RenderWidget,
// Called when a plugin is destroyed.
void PluginDestroyed(WebPluginDelegateProxy* proxy);
- // Called when a plugin has crashed.
- void PluginCrashed(base::ProcessId pid, const FilePath& plugin_path);
+ // Called when a plugin is crashed.
+ void PluginCrashed(const FilePath& plugin_path);
// Called from JavaScript window.external.AddSearchProvider() to add a
// keyword for a provider described in the given OpenSearch document.
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index a5423ac..c723097 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -386,7 +386,7 @@ void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) {
void WebPluginDelegateProxy::OnChannelError() {
if (plugin_)
plugin_->Invalidate();
- render_view_->PluginCrashed(GetProcessId(), plugin_path_);
+ render_view_->PluginCrashed(plugin_path_);
}
void WebPluginDelegateProxy::UpdateGeometry(
@@ -709,7 +709,7 @@ void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) {
void WebPluginDelegateProxy::OnCreatePluginContainer(
gfx::PluginWindowHandle* container) {
RenderThread::current()->Send(new ViewHostMsg_CreatePluginContainer(
- render_view_->routing_id(), GetProcessId(), container));
+ render_view_->routing_id(), container));
}
void WebPluginDelegateProxy::OnDestroyPluginContainer(