| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/nacl/renderer/ppb_nacl_private.h" | 5 #include "components/nacl/renderer/ppb_nacl_private.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 if (load_manager->IsPNaCl()) | 1090 if (load_manager->IsPNaCl()) |
| 1091 isa_type = kPortableArch; | 1091 isa_type = kPortableArch; |
| 1092 else | 1092 else |
| 1093 isa_type = GetSandboxArch(); | 1093 isa_type = GetSandboxArch(); |
| 1094 | 1094 |
| 1095 std::unique_ptr<nacl::JsonManifest> j(new nacl::JsonManifest( | 1095 std::unique_ptr<nacl::JsonManifest> j(new nacl::JsonManifest( |
| 1096 manifest_url.c_str(), isa_type, IsNonSFIModeEnabled(), | 1096 manifest_url.c_str(), isa_type, IsNonSFIModeEnabled(), |
| 1097 PP_ToBool(NaClDebugEnabledForURL(manifest_url.c_str())))); | 1097 PP_ToBool(NaClDebugEnabledForURL(manifest_url.c_str())))); |
| 1098 JsonManifest::ErrorInfo error_info; | 1098 JsonManifest::ErrorInfo error_info; |
| 1099 if (j->Init(manifest_data.c_str(), &error_info)) { | 1099 if (j->Init(manifest_data.c_str(), &error_info)) { |
| 1100 GetNaClPluginInstance(instance)->json_manifest.reset(j.release()); | 1100 GetNaClPluginInstance(instance)->json_manifest = std::move(j); |
| 1101 return true; | 1101 return true; |
| 1102 } | 1102 } |
| 1103 load_manager->ReportLoadError(error_info.error, error_info.string); | 1103 load_manager->ReportLoadError(error_info.error, error_info.string); |
| 1104 return false; | 1104 return false; |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 bool ShouldUseSubzero(const PP_PNaClOptions* pnacl_options) { | 1107 bool ShouldUseSubzero(const PP_PNaClOptions* pnacl_options) { |
| 1108 // Always use Subzero if explicitly overridden on the command line. | 1108 // Always use Subzero if explicitly overridden on the command line. |
| 1109 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1109 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1110 switches::kForcePNaClSubzero)) | 1110 switches::kForcePNaClSubzero)) |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1725 // Mark the request as requesting a PNaCl bitcode file, | 1725 // Mark the request as requesting a PNaCl bitcode file, |
| 1726 // so that component updater can detect this user action. | 1726 // so that component updater can detect this user action. |
| 1727 url_request.addHTTPHeaderField( | 1727 url_request.addHTTPHeaderField( |
| 1728 blink::WebString::fromUTF8("Accept"), | 1728 blink::WebString::fromUTF8("Accept"), |
| 1729 blink::WebString::fromUTF8("application/x-pnacl, */*")); | 1729 blink::WebString::fromUTF8("application/x-pnacl, */*")); |
| 1730 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); | 1730 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); |
| 1731 downloader->Load(url_request); | 1731 downloader->Load(url_request); |
| 1732 } | 1732 } |
| 1733 | 1733 |
| 1734 } // namespace nacl | 1734 } // namespace nacl |
| OLD | NEW |