OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/nacl_host/nacl_process_host.h" | 5 #include "chrome/browser/nacl_host/nacl_process_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (CommandLine::ForCurrentProcess()->HasSwitch( | 170 if (CommandLine::ForCurrentProcess()->HasSwitch( |
171 switches::kEnableNaClExceptionHandling) || | 171 switches::kEnableNaClExceptionHandling) || |
172 getenv("NACL_UNTRUSTED_EXCEPTION_HANDLING") != NULL) { | 172 getenv("NACL_UNTRUSTED_EXCEPTION_HANDLING") != NULL) { |
173 enable_exception_handling_ = true; | 173 enable_exception_handling_ = true; |
174 } | 174 } |
175 enable_debug_stub_ = CommandLine::ForCurrentProcess()->HasSwitch( | 175 enable_debug_stub_ = CommandLine::ForCurrentProcess()->HasSwitch( |
176 switches::kEnableNaClDebug); | 176 switches::kEnableNaClDebug); |
177 | 177 |
178 enable_ipc_proxy_ = !CommandLine::ForCurrentProcess()->HasSwitch( | 178 enable_ipc_proxy_ = !CommandLine::ForCurrentProcess()->HasSwitch( |
179 switches::kEnableNaClSRPCProxy); | 179 switches::kEnableNaClSRPCProxy); |
| 180 // If render_view_id == 0 we do not need PPAPI, so we can skip |
| 181 // PPAPI IPC proxy channel creation, etc. |
| 182 if (!render_view_id_) |
| 183 enable_ipc_proxy_ = false; |
180 } | 184 } |
181 | 185 |
182 NaClProcessHost::~NaClProcessHost() { | 186 NaClProcessHost::~NaClProcessHost() { |
183 int exit_code; | 187 int exit_code; |
184 process_->GetTerminationStatus(&exit_code); | 188 process_->GetTerminationStatus(&exit_code); |
185 std::string message = | 189 std::string message = |
186 base::StringPrintf("NaCl process exited with status %i (0x%x)", | 190 base::StringPrintf("NaCl process exited with status %i (0x%x)", |
187 exit_code, exit_code); | 191 exit_code, exit_code); |
188 if (exit_code == 0) { | 192 if (exit_code == 0) { |
189 LOG(INFO) << message; | 193 LOG(INFO) << message; |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 } else { | 903 } else { |
900 NaClStartDebugExceptionHandlerThread( | 904 NaClStartDebugExceptionHandlerThread( |
901 process_handle.Take(), info, | 905 process_handle.Take(), info, |
902 base::MessageLoopProxy::current(), | 906 base::MessageLoopProxy::current(), |
903 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 907 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
904 weak_factory_.GetWeakPtr())); | 908 weak_factory_.GetWeakPtr())); |
905 return true; | 909 return true; |
906 } | 910 } |
907 } | 911 } |
908 #endif | 912 #endif |
OLD | NEW |