| 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 #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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 // The NaCl process probably crashed. On Linux, a crash causes this error, | 475 // The NaCl process probably crashed. On Linux, a crash causes this error, |
| 476 // while on other platforms, the error is detected below, when we attempt to | 476 // while on other platforms, the error is detected below, when we attempt to |
| 477 // start the proxy. Report a module initialization error here, to make it | 477 // start the proxy. Report a module initialization error here, to make it |
| 478 // less confusing for developers. | 478 // less confusing for developers. |
| 479 NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: " | 479 NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: " |
| 480 "StartSrpcServices failed\n"); | 480 "StartSrpcServices failed\n"); |
| 481 error_info->SetReport(ERROR_START_PROXY_MODULE, | 481 error_info->SetReport(ERROR_START_PROXY_MODULE, |
| 482 "could not initialize module."); | 482 "could not initialize module."); |
| 483 return false; | 483 return false; |
| 484 } | 484 } |
| 485 PP_NaClResult ipc_result = nacl_interface_->StartPpapiProxy(pp_instance()); | 485 PP_ExternalPluginResult ipc_result = |
| 486 if (ipc_result == PP_NACL_OK) { | 486 nacl_interface_->StartPpapiProxy(pp_instance()); |
| 487 if (ipc_result == PP_EXTERNAL_PLUGIN_OK) { |
| 487 // Log the amound of time that has passed between the trusted plugin being | 488 // Log the amound of time that has passed between the trusted plugin being |
| 488 // initialized and the untrusted plugin being initialized. This is | 489 // initialized and the untrusted plugin being initialized. This is |
| 489 // (roughly) the cost of using NaCl, in terms of startup time. | 490 // (roughly) the cost of using NaCl, in terms of startup time. |
| 490 HistogramStartupTimeMedium( | 491 HistogramStartupTimeMedium( |
| 491 "NaCl.Perf.StartupTime.NaClOverhead", | 492 "NaCl.Perf.StartupTime.NaClOverhead", |
| 492 static_cast<float>(NaClGetTimeOfDayMicroseconds() - init_time_) | 493 static_cast<float>(NaClGetTimeOfDayMicroseconds() - init_time_) |
| 493 / NACL_MICROS_PER_MILLI); | 494 / NACL_MICROS_PER_MILLI); |
| 494 } else if (ipc_result == PP_NACL_ERROR_MODULE) { | 495 } else if (ipc_result == PP_EXTERNAL_PLUGIN_ERROR_MODULE) { |
| 495 NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: " | 496 NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: " |
| 496 "Got PP_NACL_ERROR_MODULE\n"); | 497 "Got PP_EXTERNAL_PLUGIN_ERROR_MODULE\n"); |
| 497 error_info->SetReport(ERROR_START_PROXY_MODULE, | 498 error_info->SetReport(ERROR_START_PROXY_MODULE, |
| 498 "could not initialize module."); | 499 "could not initialize module."); |
| 499 return false; | 500 return false; |
| 500 } else if (ipc_result == PP_NACL_ERROR_INSTANCE) { | 501 } else if (ipc_result == PP_EXTERNAL_PLUGIN_ERROR_INSTANCE) { |
| 501 error_info->SetReport(ERROR_START_PROXY_INSTANCE, | 502 error_info->SetReport(ERROR_START_PROXY_INSTANCE, |
| 502 "could not create instance."); | 503 "could not create instance."); |
| 503 return false; | 504 return false; |
| 504 } | 505 } |
| 505 PLUGIN_PRINTF(("Plugin::LoadNaClModule (%s)\n", | 506 PLUGIN_PRINTF(("Plugin::LoadNaClModule (%s)\n", |
| 506 main_subprocess_.detailed_description().c_str())); | 507 main_subprocess_.detailed_description().c_str())); |
| 507 return true; | 508 return true; |
| 508 } | 509 } |
| 509 | 510 |
| 510 NaClSubprocess* Plugin::LoadHelperNaClModule(nacl::DescWrapper* wrapper, | 511 NaClSubprocess* Plugin::LoadHelperNaClModule(nacl::DescWrapper* wrapper, |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1681 static_cast<uint32_t>(text.size())); | 1682 static_cast<uint32_t>(text.size())); |
| 1682 const PPB_Console* console_interface = | 1683 const PPB_Console* console_interface = |
| 1683 static_cast<const PPB_Console*>( | 1684 static_cast<const PPB_Console*>( |
| 1684 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE)); | 1685 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE)); |
| 1685 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str); | 1686 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str); |
| 1686 var_interface->Release(prefix); | 1687 var_interface->Release(prefix); |
| 1687 var_interface->Release(str); | 1688 var_interface->Release(str); |
| 1688 } | 1689 } |
| 1689 | 1690 |
| 1690 } // namespace plugin | 1691 } // namespace plugin |
| OLD | NEW |