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

Unified Diff: components/nacl/renderer/manifest_service_channel.cc

Issue 1830853002: Make PlatformFileForTransit a class on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from mseaborn. Created 4 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: components/nacl/renderer/manifest_service_channel.cc
diff --git a/components/nacl/renderer/manifest_service_channel.cc b/components/nacl/renderer/manifest_service_channel.cc
index be9ccbe9a53ffdaca89af400a5dade345ab7846c..b32ee100bb41f0721734aa9d52a53eb52a04b671 100644
--- a/components/nacl/renderer/manifest_service_channel.cc
+++ b/components/nacl/renderer/manifest_service_channel.cc
@@ -89,14 +89,15 @@ void ManifestServiceChannel::DidOpenResource(IPC::Message* reply,
if (file.IsValid()) {
IPC::PlatformFileForTransit file_for_transit;
#if defined(OS_WIN)
+ HANDLE raw_handle = INVALID_HANDLE_VALUE;
bool ok = content::BrokerDuplicateHandle(
- file.TakePlatformFile(),
- peer_pid_,
- &file_for_transit,
+ file.TakePlatformFile(), peer_pid_, &raw_handle,
0, // desired_access is 0 since we're using DUPLICATE_SAME_ACCESS.
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
- if (ok)
+ if (ok) {
+ file_for_transit = IPC::PlatformFileForTransit(raw_handle, peer_pid_);
handle.set_file_handle(file_for_transit, PP_FILEOPENFLAG_READ, 0);
+ }
#else
file_for_transit = base::FileDescriptor(std::move(file));
handle.set_file_handle(file_for_transit, PP_FILEOPENFLAG_READ, 0);
« no previous file with comments | « components/nacl/loader/nacl_ipc_adapter.cc ('k') | components/nacl/renderer/plugin/pnacl_translate_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698