Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2516)

Unified Diff: content/plugin/webplugin_proxy.cc

Issue 9924010: Revert 129627 - Add a sandbox API for broker handle duplication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/webplugin_proxy.cc
===================================================================
--- content/plugin/webplugin_proxy.cc (revision 129628)
+++ content/plugin/webplugin_proxy.cc (working copy)
@@ -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 @@
#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,
- 0, DUPLICATE_SAME_ACCESS);
+ 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 @@
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(
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698