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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/plugin.cc

Issue 140573003: Connect PPAPI IPC channels for non-SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifdef _MSC_VER 5 #ifdef _MSC_VER
6 // Do not warn about use of std::copy with raw pointers. 6 // Do not warn about use of std::copy with raw pointers.
7 #pragma warning(disable : 4996) 7 #pragma warning(disable : 4996)
8 #endif 8 #endif
9 9
10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" 10 #include "ppapi/native_client/src/trusted/plugin/plugin.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 true /* should_report_uma */, 378 true /* should_report_uma */,
379 params, init_done_cb, crash_cb)) { 379 params, init_done_cb, crash_cb)) {
380 return false; 380 return false;
381 } 381 }
382 PLUGIN_PRINTF(("Plugin::LoadNaClModule (%s)\n", 382 PLUGIN_PRINTF(("Plugin::LoadNaClModule (%s)\n",
383 main_subprocess_.detailed_description().c_str())); 383 main_subprocess_.detailed_description().c_str()));
384 return true; 384 return true;
385 } 385 }
386 386
387 bool Plugin::LoadNaClModuleContinuationIntern(ErrorInfo* error_info) { 387 bool Plugin::LoadNaClModuleContinuationIntern(ErrorInfo* error_info) {
388 #if 0
Mark Seaborn 2014/02/07 23:54:10 So the trusted plugin will need to know whether we
hidehiko 2014/02/10 08:18:34 Thank you for pointing this out. So, I think this
Mark Seaborn 2014/02/10 18:57:35 Yes.
388 if (!main_subprocess_.StartSrpcServices()) { 389 if (!main_subprocess_.StartSrpcServices()) {
389 // The NaCl process probably crashed. On Linux, a crash causes this error, 390 // The NaCl process probably crashed. On Linux, a crash causes this error,
390 // while on other platforms, the error is detected below, when we attempt to 391 // while on other platforms, the error is detected below, when we attempt to
391 // start the proxy. Report a module initialization error here, to make it 392 // start the proxy. Report a module initialization error here, to make it
392 // less confusing for developers. 393 // less confusing for developers.
393 NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: " 394 NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: "
394 "StartSrpcServices failed\n"); 395 "StartSrpcServices failed\n");
395 error_info->SetReport(ERROR_START_PROXY_MODULE, 396 error_info->SetReport(ERROR_START_PROXY_MODULE,
396 "could not initialize module."); 397 "could not initialize module.");
397 return false; 398 return false;
398 } 399 }
400 #endif
399 PP_ExternalPluginResult ipc_result = 401 PP_ExternalPluginResult ipc_result =
400 nacl_interface_->StartPpapiProxy(pp_instance()); 402 nacl_interface_->StartPpapiProxy(pp_instance());
401 if (ipc_result == PP_EXTERNAL_PLUGIN_OK) { 403 if (ipc_result == PP_EXTERNAL_PLUGIN_OK) {
402 // Log the amound of time that has passed between the trusted plugin being 404 // Log the amound of time that has passed between the trusted plugin being
403 // initialized and the untrusted plugin being initialized. This is 405 // initialized and the untrusted plugin being initialized. This is
404 // (roughly) the cost of using NaCl, in terms of startup time. 406 // (roughly) the cost of using NaCl, in terms of startup time.
405 HistogramStartupTimeMedium( 407 HistogramStartupTimeMedium(
406 "NaCl.Perf.StartupTime.NaClOverhead", 408 "NaCl.Perf.StartupTime.NaClOverhead",
407 static_cast<float>(NaClGetTimeOfDayMicroseconds() - init_time_) 409 static_cast<float>(NaClGetTimeOfDayMicroseconds() - init_time_)
408 / NACL_MICROS_PER_MILLI); 410 / NACL_MICROS_PER_MILLI);
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 DCHECK(pp::Module::Get()->core()->IsMainThread()); 1589 DCHECK(pp::Module::Get()->core()->IsMainThread());
1588 DCHECK(nacl_interface_); 1590 DCHECK(nacl_interface_);
1589 exit_status_ = exit_status; 1591 exit_status_ = exit_status;
1590 nacl_interface_->SetReadOnlyProperty(pp_instance(), 1592 nacl_interface_->SetReadOnlyProperty(pp_instance(),
1591 pp::Var("exitStatus").pp_var(), 1593 pp::Var("exitStatus").pp_var(),
1592 pp::Var(exit_status_).pp_var()); 1594 pp::Var(exit_status_).pp_var());
1593 } 1595 }
1594 1596
1595 1597
1596 } // namespace plugin 1598 } // namespace plugin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698