summaryrefslogtreecommitdiffstats
path: root/content/plugin/webplugin_proxy.cc
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 20:17:49 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 20:17:49 +0000
commit2a9ee22f1e672099f70d59594258f093f5520a16 (patch)
treebcf1c08958b7850141e376fce82fbe9807648a82 /content/plugin/webplugin_proxy.cc
parent92922a8e913115ad091c367e5ec3acde7f26fa81 (diff)
downloadchromium_src-2a9ee22f1e672099f70d59594258f093f5520a16.zip
chromium_src-2a9ee22f1e672099f70d59594258f093f5520a16.tar.gz
chromium_src-2a9ee22f1e672099f70d59594258f093f5520a16.tar.bz2
Revert 132218 - Convert plugin and GPU process to brokered handle duplication.
(Seems to be responsible for VMTest failure on ChromiumOS). BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 TBR=jschuh@chromium.org Review URL: https://chromiumcodereview.appspot.com/10081018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin/webplugin_proxy.cc')
-rw-r--r--content/plugin/webplugin_proxy.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc
index 704058d..919f847 100644
--- a/content/plugin/webplugin_proxy.cc
+++ b/content/plugin/webplugin_proxy.cc
@@ -35,10 +35,6 @@
#include "ui/base/x/x11_util_internal.h"
#endif
-#if defined(OS_WIN)
-#include "content/common/sandbox_policy.h"
-#endif
-
using WebKit::WebBindings;
using webkit::npapi::WebPluginResourceClient;
@@ -133,9 +129,10 @@ void WebPluginProxy::WillDestroyWindow(gfx::PluginWindowHandle window) {
#if defined(OS_WIN)
void WebPluginProxy::SetWindowlessPumpEvent(HANDLE pump_messages_event) {
HANDLE pump_messages_event_for_renderer = NULL;
- sandbox::BrokerDuplicateHandle(pump_messages_event, channel_->peer_pid(),
- &pump_messages_event_for_renderer,
- SYNCHRONIZE | EVENT_MODIFY_STATE, 0);
+ DuplicateHandle(GetCurrentProcess(), pump_messages_event,
+ channel_->renderer_handle(),
+ &pump_messages_event_for_renderer,
+ 0, FALSE, DUPLICATE_SAME_ACCESS);
DCHECK(pump_messages_event_for_renderer != NULL);
Send(new PluginHostMsg_SetWindowlessPumpEvent(
route_id_, pump_messages_event_for_renderer));
@@ -473,17 +470,25 @@ void WebPluginProxy::CreateCanvasFromHandle(
const TransportDIB::Handle& dib_handle,
const gfx::Rect& window_rect,
scoped_ptr<skia::PlatformCanvas>* canvas_out) {
+ // Create a canvas that will reference the shared bits. We have to handle
+ // errors here since we're mapping a large amount of memory that may not fit
+ // in our address space, or go wrong in some other way.
+ HANDLE section;
+ DuplicateHandle(channel_->renderer_handle(), dib_handle, GetCurrentProcess(),
+ &section,
+ STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ | FILE_MAP_WRITE,
+ FALSE, 0);
scoped_ptr<skia::PlatformCanvas> canvas(new skia::PlatformCanvas);
if (!canvas->initialize(
window_rect.width(),
window_rect.height(),
true,
- dib_handle)) {
+ section)) {
canvas_out->reset();
}
canvas_out->reset(canvas.release());
// The canvas does not own the section so we need to close it now.
- CloseHandle(dib_handle);
+ CloseHandle(section);
}
void WebPluginProxy::SetWindowlessBuffers(