summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 21:29:30 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 21:29:30 +0000
commit298ee7d563620ce6253e393ec92b60c33a9042d3 (patch)
treee37dafab37a47a7af1410006cc030c330bdb3ce3 /content
parent7e58cb27d8563d4c04016ce1e6fb46744acb9330 (diff)
downloadchromium_src-298ee7d563620ce6253e393ec92b60c33a9042d3.zip
chromium_src-298ee7d563620ce6253e393ec92b60c33a9042d3.tar.gz
chromium_src-298ee7d563620ce6253e393ec92b60c33a9042d3.tar.bz2
IPC: change sync channel dispatch restriction to allow dispatch to other channels within the same "group"
This prevents 4-way deadlocks with 2 renderers talking to 2 different pepper plugins. BUG=120530 TEST=RestrictedDispatch4WayDeadlock, load chromeos chrome with 2 gmail tabs (on 2 domains), quit and restore session multiple times. Review URL: https://chromiumcodereview.appspot.com/9917002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/pepper/pepper_broker_impl.cc4
-rw-r--r--content/renderer/pepper/pepper_plugin_delegate_impl.cc4
-rw-r--r--content/renderer/renderer_restrict_dispatch_group.h25
3 files changed, 31 insertions, 2 deletions
diff --git a/content/renderer/pepper/pepper_broker_impl.cc b/content/renderer/pepper/pepper_broker_impl.cc
index 6d86d0b..e3781d8 100644
--- a/content/renderer/pepper/pepper_broker_impl.cc
+++ b/content/renderer/pepper/pepper_broker_impl.cc
@@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h"
+#include "content/renderer/renderer_restrict_dispatch_group.h"
#include "ipc/ipc_channel_handle.h"
#include "ppapi/proxy/broker_dispatcher.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -74,7 +75,8 @@ bool PepperBrokerDispatcherWrapper::Init(
dispatcher_delegate_.reset();
return false;
}
- dispatcher_->channel()->SetRestrictDispatchToSameChannel(true);
+ dispatcher_->channel()->SetRestrictDispatchChannelGroup(
+ content::kRendererRestrictDispatchGroup_Pepper);
return true;
}
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index feab360..57c8d07 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -52,6 +52,7 @@
#include "content/renderer/render_view_impl.h"
#include "content/renderer/render_widget_fullscreen_pepper.h"
#include "content/renderer/renderer_clipboard_client.h"
+#include "content/renderer/renderer_restrict_dispatch_group.h"
#include "content/renderer/webplugin_delegate_proxy.h"
#include "ipc/ipc_channel_handle.h"
#include "media/video/capture/video_capture_proxy.h"
@@ -125,7 +126,8 @@ class HostDispatcherWrapper
dispatcher_delegate_.reset();
return false;
}
- dispatcher_->channel()->SetRestrictDispatchToSameChannel(true);
+ dispatcher_->channel()->SetRestrictDispatchChannelGroup(
+ content::kRendererRestrictDispatchGroup_Pepper);
return true;
}
diff --git a/content/renderer/renderer_restrict_dispatch_group.h b/content/renderer/renderer_restrict_dispatch_group.h
new file mode 100644
index 0000000..708a921
--- /dev/null
+++ b/content/renderer/renderer_restrict_dispatch_group.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_RESTRICT_DISPATCH_GROUP_H_
+#define CONTENT_RENDERER_RESTRICT_DISPATCH_GROUP_H_
+#pragma once
+
+#include "ipc/ipc_sync_channel.h"
+
+namespace content {
+
+// This represents all dispatch groups used in the renderer. Dispatch groups
+// allow channels to restrict in which case incoming messages can re-enter while
+// a synchronous message is sent on another channel. See
+// IPC::SyncChannel::SetRestrictDispatchChannelGroup.
+enum RendererRestrictDispatchGroup {
+ kRendererRestrictDispatchGroup_None =
+ IPC::SyncChannel::kRestrictDispatchGroup_None,
+ kRendererRestrictDispatchGroup_Pepper,
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_RESTRICT_DISPATCH_GROUP_H_