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

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

Issue 11761025: When launching PNaCl helper nexes, explicitly disable IRT loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 "native_client/src/trusted/plugin/plugin.h" 10 #include "native_client/src/trusted/plugin/plugin.h"
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 538
539 PLUGIN_PRINTF(("Plugin::ShutDownSubprocess (this=%p, return)\n", 539 PLUGIN_PRINTF(("Plugin::ShutDownSubprocess (this=%p, return)\n",
540 static_cast<void*>(this))); 540 static_cast<void*>(this)));
541 } 541 }
542 542
543 bool Plugin::LoadNaClModuleCommon(nacl::DescWrapper* wrapper, 543 bool Plugin::LoadNaClModuleCommon(nacl::DescWrapper* wrapper,
544 NaClSubprocess* subprocess, 544 NaClSubprocess* subprocess,
545 const Manifest* manifest, 545 const Manifest* manifest,
546 bool should_report_uma, 546 bool should_report_uma,
547 bool uses_ppapi, 547 bool uses_ppapi,
548 bool uses_irt,
548 ErrorInfo* error_info, 549 ErrorInfo* error_info,
549 pp::CompletionCallback init_done_cb, 550 pp::CompletionCallback init_done_cb,
550 pp::CompletionCallback crash_cb) { 551 pp::CompletionCallback crash_cb) {
551 ServiceRuntime* new_service_runtime = 552 ServiceRuntime* new_service_runtime =
552 new ServiceRuntime(this, manifest, should_report_uma, init_done_cb, 553 new ServiceRuntime(this, manifest, should_report_uma, init_done_cb,
553 crash_cb); 554 crash_cb);
554 subprocess->set_service_runtime(new_service_runtime); 555 subprocess->set_service_runtime(new_service_runtime);
555 PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon (service_runtime=%p)\n", 556 PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon (service_runtime=%p)\n",
556 static_cast<void*>(new_service_runtime))); 557 static_cast<void*>(new_service_runtime)));
557 if (NULL == new_service_runtime) { 558 if (NULL == new_service_runtime) {
558 error_info->SetReport(ERROR_SEL_LDR_INIT, 559 error_info->SetReport(ERROR_SEL_LDR_INIT,
559 "sel_ldr init failure " + subprocess->description()); 560 "sel_ldr init failure " + subprocess->description());
560 return false; 561 return false;
561 } 562 }
562 563
563 bool service_runtime_started = 564 bool service_runtime_started =
564 new_service_runtime->Start(wrapper, 565 new_service_runtime->Start(wrapper,
565 error_info, 566 error_info,
566 manifest_base_url(), 567 manifest_base_url(),
567 uses_ppapi, 568 uses_ppapi,
568 enable_dev_interfaces_, 569 enable_dev_interfaces_,
570 uses_irt,
569 crash_cb); 571 crash_cb);
570 PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon (service_runtime_started=%d)\n", 572 PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon (service_runtime_started=%d)\n",
571 service_runtime_started)); 573 service_runtime_started));
572 if (!service_runtime_started) { 574 if (!service_runtime_started) {
573 return false; 575 return false;
574 } 576 }
575 return true; 577 return true;
576 } 578 }
577 579
578 bool Plugin::LoadNaClModule(nacl::DescWrapper* wrapper, 580 bool Plugin::LoadNaClModule(nacl::DescWrapper* wrapper,
579 ErrorInfo* error_info, 581 ErrorInfo* error_info,
580 pp::CompletionCallback init_done_cb, 582 pp::CompletionCallback init_done_cb,
581 pp::CompletionCallback crash_cb) { 583 pp::CompletionCallback crash_cb) {
582 // Before forking a new sel_ldr process, ensure that we do not leak 584 // Before forking a new sel_ldr process, ensure that we do not leak
583 // the ServiceRuntime object for an existing subprocess, and that any 585 // the ServiceRuntime object for an existing subprocess, and that any
584 // associated listener threads do not go unjoined because if they 586 // associated listener threads do not go unjoined because if they
585 // outlive the Plugin object, they will not be memory safe. 587 // outlive the Plugin object, they will not be memory safe.
586 ShutDownSubprocesses(); 588 ShutDownSubprocesses();
587 if (!LoadNaClModuleCommon(wrapper, &main_subprocess_, manifest_.get(), 589 if (!LoadNaClModuleCommon(wrapper, &main_subprocess_, manifest_.get(),
588 true /* should_report_uma */, 590 true /* should_report_uma */,
589 true /* uses_ppapi */, 591 true /* uses_ppapi */,
592 true /* uses_irt */,
590 error_info, init_done_cb, crash_cb)) { 593 error_info, init_done_cb, crash_cb)) {
591 return false; 594 return false;
592 } 595 }
593 PLUGIN_PRINTF(("Plugin::LoadNaClModule (%s)\n", 596 PLUGIN_PRINTF(("Plugin::LoadNaClModule (%s)\n",
594 main_subprocess_.detailed_description().c_str())); 597 main_subprocess_.detailed_description().c_str()));
595 return true; 598 return true;
596 } 599 }
597 600
598 bool Plugin::LoadNaClModuleContinuationIntern(ErrorInfo* error_info) { 601 bool Plugin::LoadNaClModuleContinuationIntern(ErrorInfo* error_info) {
599 if (!main_subprocess_.StartSrpcServices()) { 602 if (!main_subprocess_.StartSrpcServices()) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 error_info->SetReport(ERROR_SEL_LDR_INIT, 646 error_info->SetReport(ERROR_SEL_LDR_INIT,
644 "unable to allocate helper subprocess."); 647 "unable to allocate helper subprocess.");
645 return NULL; 648 return NULL;
646 } 649 }
647 650
648 // Do not report UMA stats for translator-related nexes. 651 // Do not report UMA stats for translator-related nexes.
649 // TODO(sehr): define new UMA stats for translator related nexe events. 652 // TODO(sehr): define new UMA stats for translator related nexe events.
650 if (!LoadNaClModuleCommon(wrapper, nacl_subprocess.get(), manifest, 653 if (!LoadNaClModuleCommon(wrapper, nacl_subprocess.get(), manifest,
651 false /* should_report_uma */, 654 false /* should_report_uma */,
652 false /* uses_ppapi */, 655 false /* uses_ppapi */,
656 false /* uses_irt */,
Mark Seaborn 2013/01/04 00:05:41 Maybe comment that the PNaCl translator isn't buil
jvoung (off chromium) 2013/01/04 17:09:23 Done.
653 error_info, 657 error_info,
654 pp::BlockUntilComplete(), 658 pp::BlockUntilComplete(),
655 pp::BlockUntilComplete())) { 659 pp::BlockUntilComplete())) {
656 return NULL; 660 return NULL;
657 } 661 }
658 // We need not wait for the init_done callback. We can block 662 // We need not wait for the init_done callback. We can block
659 // here in StartSrpcServices, since helper NaCl modules 663 // here in StartSrpcServices, since helper NaCl modules
660 // are spawned from a private thread. 664 // are spawned from a private thread.
661 // 665 //
662 // TODO(bsy): if helper module crashes, we should abort. 666 // TODO(bsy): if helper module crashes, we should abort.
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 static_cast<uint32_t>(text.size())); 1932 static_cast<uint32_t>(text.size()));
1929 const PPB_Console* console_interface = 1933 const PPB_Console* console_interface =
1930 static_cast<const PPB_Console*>( 1934 static_cast<const PPB_Console*>(
1931 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE)); 1935 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE));
1932 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str); 1936 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str);
1933 var_interface->Release(prefix); 1937 var_interface->Release(prefix);
1934 var_interface->Release(str); 1938 var_interface->Release(str);
1935 } 1939 }
1936 1940
1937 } // namespace plugin 1941 } // namespace plugin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698