Chromium Code Reviews| 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_impl.h" | 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
| 6 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 if (load_manager->DevInterfacesEnabled()) | 413 if (load_manager->DevInterfacesEnabled()) |
| 414 perm_bits |= ppapi::PERMISSION_DEV; | 414 perm_bits |= ppapi::PERMISSION_DEV; |
| 415 instance_info.permissions = | 415 instance_info.permissions = |
| 416 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); | 416 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); |
| 417 std::string error_message_string; | 417 std::string error_message_string; |
| 418 NaClLaunchResult launch_result; | 418 NaClLaunchResult launch_result; |
| 419 | 419 |
| 420 IPC::PlatformFileForTransit nexe_for_transit = | 420 IPC::PlatformFileForTransit nexe_for_transit = |
| 421 IPC::InvalidPlatformFileForTransit(); | 421 IPC::InvalidPlatformFileForTransit(); |
| 422 | 422 |
| 423 #if defined(OS_POSIX) | |
| 424 static const bool kPrefetchFiles = true; | |
| 425 #else | |
| 426 // TODO(yusukes): Support OS_WIN. | |
|
Mark Seaborn
2015/03/20 00:40:52
What would be required to support Windows?
Since
Yusuke Sato
2015/04/16 02:38:45
Probably nothing, but I haven't confirmed it yet s
Mark Seaborn
2015/05/04 17:08:39
What happens if you remove the "#if !defined(OS_WI
Yusuke Sato
2015/05/05 18:27:16
Thanks to Hidehiko's recent refactoring, it turned
| |
| 427 static const bool kPrefetchFiles = false; | |
| 428 #endif | |
| 429 | |
| 423 std::vector<std::pair< | 430 std::vector<std::pair< |
| 424 std::string /*key*/, std::string /*url*/> > resource_files_to_prefetch; | 431 std::string /*key*/, std::string /*url*/> > resource_files_to_prefetch; |
| 425 if (process_type == kNativeNaClProcessType && uses_nonsfi_mode) { | 432 if (process_type == kNativeNaClProcessType && kPrefetchFiles) { |
| 426 JsonManifest* manifest = GetJsonManifest(instance); | 433 JsonManifest* manifest = GetJsonManifest(instance); |
| 427 if (manifest) | 434 if (manifest) |
| 428 manifest->GetPrefetchableFiles(&resource_files_to_prefetch); | 435 manifest->GetPrefetchableFiles(&resource_files_to_prefetch); |
| 429 for (size_t i = 0; i < resource_files_to_prefetch.size(); ++i) { | 436 for (size_t i = 0; i < resource_files_to_prefetch.size(); ++i) { |
| 430 const GURL gurl(resource_files_to_prefetch[i].second); | 437 const GURL gurl(resource_files_to_prefetch[i].second); |
| 431 // Important security check. Do not remove. | 438 // Important security check. Do not remove. |
| 432 if (!CanOpenViaFastPath(plugin_instance, gurl)) { | 439 if (!CanOpenViaFastPath(plugin_instance, gurl)) { |
| 433 resource_files_to_prefetch.clear(); | 440 resource_files_to_prefetch.clear(); |
| 434 break; | 441 break; |
| 435 } | 442 } |
| (...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1679 &StreamPexe | 1686 &StreamPexe |
| 1680 }; | 1687 }; |
| 1681 | 1688 |
| 1682 } // namespace | 1689 } // namespace |
| 1683 | 1690 |
| 1684 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1691 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
| 1685 return &nacl_interface; | 1692 return &nacl_interface; |
| 1686 } | 1693 } |
| 1687 | 1694 |
| 1688 } // namespace nacl | 1695 } // namespace nacl |
| OLD | NEW |