| 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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 void Plugin::ProcessNaClManifest(const nacl::string& manifest_json) { | 789 void Plugin::ProcessNaClManifest(const nacl::string& manifest_json) { |
| 790 HistogramSizeKB("NaCl.Perf.Size.Manifest", | 790 HistogramSizeKB("NaCl.Perf.Size.Manifest", |
| 791 static_cast<int32_t>(manifest_json.length() / 1024)); | 791 static_cast<int32_t>(manifest_json.length() / 1024)); |
| 792 ErrorInfo error_info; | 792 ErrorInfo error_info; |
| 793 if (!SetManifestObject(manifest_json, &error_info)) { | 793 if (!SetManifestObject(manifest_json, &error_info)) { |
| 794 ReportLoadError(error_info); | 794 ReportLoadError(error_info); |
| 795 return; | 795 return; |
| 796 } | 796 } |
| 797 | 797 |
| 798 nacl::string program_url; | 798 nacl::string program_url; |
| 799 PnaclOptions pnacl_options; | 799 PP_PNaClOptions pnacl_options; |
| 800 bool uses_nonsfi_mode; | 800 bool uses_nonsfi_mode; |
| 801 if (manifest_->GetProgramURL( | 801 if (manifest_->GetProgramURL( |
| 802 &program_url, &pnacl_options, &uses_nonsfi_mode, &error_info)) { | 802 &program_url, &pnacl_options, &uses_nonsfi_mode, &error_info)) { |
| 803 pp::Var program_url_var(program_url); | 803 pp::Var program_url_var(program_url); |
| 804 nacl_interface_->SetIsInstalled( | 804 nacl_interface_->SetIsInstalled( |
| 805 pp_instance(), | 805 pp_instance(), |
| 806 PP_FromBool( | 806 PP_FromBool( |
| 807 nacl_interface_->GetUrlScheme(program_url_var.pp_var()) == | 807 nacl_interface_->GetUrlScheme(program_url_var.pp_var()) == |
| 808 PP_SCHEME_CHROME_EXTENSION)); | 808 PP_SCHEME_CHROME_EXTENSION)); |
| 809 uses_nonsfi_mode_ = uses_nonsfi_mode; | 809 uses_nonsfi_mode_ = uses_nonsfi_mode; |
| 810 nacl_interface_->SetNaClReadyState(pp_instance(), | 810 nacl_interface_->SetNaClReadyState(pp_instance(), |
| 811 PP_NACL_READY_STATE_LOADING); | 811 PP_NACL_READY_STATE_LOADING); |
| 812 // Inform JavaScript that we found a nexe URL to load. | 812 // Inform JavaScript that we found a nexe URL to load. |
| 813 EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS); | 813 EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS); |
| 814 if (pnacl_options.translate()) { | 814 if (pnacl_options.translate) { |
| 815 pp::CompletionCallback translate_callback = | 815 pp::CompletionCallback translate_callback = |
| 816 callback_factory_.NewCallback(&Plugin::BitcodeDidTranslate); | 816 callback_factory_.NewCallback(&Plugin::BitcodeDidTranslate); |
| 817 // Will always call the callback on success or failure. | 817 // Will always call the callback on success or failure. |
| 818 pnacl_coordinator_.reset( | 818 pnacl_coordinator_.reset( |
| 819 PnaclCoordinator::BitcodeToNative(this, | 819 PnaclCoordinator::BitcodeToNative(this, |
| 820 program_url, | 820 program_url, |
| 821 pnacl_options, | 821 pnacl_options, |
| 822 translate_callback)); | 822 translate_callback)); |
| 823 return; | 823 return; |
| 824 } else { | 824 } else { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 | 1160 |
| 1161 void Plugin::SetExitStatusOnMainThread(int32_t pp_error, | 1161 void Plugin::SetExitStatusOnMainThread(int32_t pp_error, |
| 1162 int exit_status) { | 1162 int exit_status) { |
| 1163 DCHECK(pp::Module::Get()->core()->IsMainThread()); | 1163 DCHECK(pp::Module::Get()->core()->IsMainThread()); |
| 1164 DCHECK(nacl_interface_); | 1164 DCHECK(nacl_interface_); |
| 1165 nacl_interface_->SetExitStatus(pp_instance(), exit_status); | 1165 nacl_interface_->SetExitStatus(pp_instance(), exit_status); |
| 1166 } | 1166 } |
| 1167 | 1167 |
| 1168 | 1168 |
| 1169 } // namespace plugin | 1169 } // namespace plugin |
| OLD | NEW |