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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 1134043002: Handle imc_handle_for_renderer error properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 6d4dc2f99a9ec4a4cfcb75488ead54f573aee265..22f2f5f4554a000f4c508c60e9d18064e604e507 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -740,12 +740,18 @@ void NaClProcessHost::ReplyToRenderer(
}
#endif
- // Hereafter, we always send an IPC message with handles which, on Windows,
- // are not closable in this process.
+ // First, create an |imc_channel_handle| for the renderer.
IPC::PlatformFileForTransit imc_handle_for_renderer =
IPC::TakeFileHandleForProcess(socket_for_renderer_.Pass(),
nacl_host_message_filter_->PeerHandle());
+ if (imc_handle_for_renderer == IPC::InvalidPlatformFileForTransit()) {
+ // Failed to create the handle.
+ SendErrorToRenderer("imc_channel_handle creation failed.");
+ return;
+ }
+ // Hereafter, we always send an IPC message with handles including imc_handle
+ // created above which, on Windows, are not closable in this process.
std::string error_message;
base::SharedMemoryHandle crash_info_shmem_renderer_handle;
if (!crash_info_shmem_.ShareToProcess(nacl_host_message_filter_->PeerHandle(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698