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

Unified Diff: content/renderer/pepper/renderer_ppapi_host_impl.cc

Issue 13032002: Add RequestOSFileHandle as a private PPAPI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix test Created 7 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
Index: content/renderer/pepper/renderer_ppapi_host_impl.cc
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 50b4fc7b14952b7a0d95e3b79e5d08e10146751b..4971d5188e525aa2dd7c23802783ac114eaf26b9 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -6,6 +6,8 @@
#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/process_util.h"
+#include "content/common/sandbox_util.h"
#include "content/renderer/pepper/pepper_graphics_2d_host.h"
#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "content/renderer/pepper/pepper_in_process_router.h"
@@ -245,9 +247,13 @@ IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote(
base::PlatformFile handle,
bool should_close_source) {
if (!dispatcher_) {
- if (should_close_source)
- base::ClosePlatformFile(handle);
- return IPC::InvalidPlatformFileForTransit();
+ DCHECK(is_running_in_process_);
+ // Duplicate the file handle for in process mode so this function
+ // has the same semantics for both in process mode and out of
+ // process mode (i.e., the remote side must cloes the handle).
+ return BrokerGetFileHandleForProcess(handle,
+ base::GetCurrentProcId(),
+ should_close_source);
}
return dispatcher_->ShareHandleWithRemote(handle, should_close_source);
}

Powered by Google App Engine
This is Rietveld 408576698