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

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

Issue 1094653003: Refactor NaClProcessHost. Reduce chances to leak the resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/ppb_nacl_private_impl.cc
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index c879e48671bf9e1cb00fc42c3325ba6d162bf16f..8320f907c62dfd1affec475b04a9c41c7ba32f81 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -385,7 +385,6 @@ void LaunchSelLdr(PP_Instance instance,
scoped_ptr<ManifestServiceChannel::Delegate> manifest_service_proxy(
new ManifestServiceProxy(instance, process_type));
- FileDescriptor result_socket;
IPC::Sender* sender = content::RenderThread::Get();
DCHECK(sender);
int routing_id = GetRoutingID(instance);
@@ -482,7 +481,7 @@ void LaunchSelLdr(PP_Instance instance,
static_cast<int32_t>(PP_ERROR_FAILED)));
return;
}
- result_socket = launch_result.imc_channel_handle;
+
instance_info.channel_handle = launch_result.ppapi_ipc_channel_handle;
instance_info.plugin_pid = launch_result.plugin_pid;
instance_info.plugin_child_id = launch_result.plugin_child_id;
@@ -493,7 +492,9 @@ void LaunchSelLdr(PP_Instance instance,
nacl_plugin_instance->instance_info.reset(new InstanceInfo(instance_info));
}
- *(static_cast<NaClHandle*>(imc_handle)) = ToNativeHandle(result_socket);
+ *(static_cast<NaClHandle*>(imc_handle)) =
+ IPC::PlatformFileForTransitToPlatformFile(
+ launch_result.imc_channel_handle);
// Store the crash information shared memory handle.
load_manager->set_crash_info_shmem_handle(

Powered by Google App Engine
This is Rietveld 408576698