| 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 #include "chrome/browser/nacl_host/nacl_browser.h" | 5 #include "chrome/browser/nacl_host/nacl_browser.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 const bool kValidationCacheEnabledByDefault = true; | 30 const bool kValidationCacheEnabledByDefault = true; |
| 31 | 31 |
| 32 enum ValidationCacheStatus { | 32 enum ValidationCacheStatus { |
| 33 CACHE_MISS = 0, | 33 CACHE_MISS = 0, |
| 34 CACHE_HIT, | 34 CACHE_HIT, |
| 35 CACHE_MAX | 35 CACHE_MAX |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 const FilePath::StringType NaClIrtName() { | 38 const FilePath::StringType NaClIrtName() { |
| 39 FilePath::StringType irt_name; | 39 FilePath::StringType irt_name(FILE_PATH_LITERAL("nacl_irt_")); |
| 40 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 41 switches::kEnableNaClSRPCProxy)) | |
| 42 irt_name.append(FILE_PATH_LITERAL("nacl_irt_srpc_")); | |
| 43 else | |
| 44 irt_name.append(FILE_PATH_LITERAL("nacl_irt_")); | |
| 45 | 40 |
| 46 #if defined(ARCH_CPU_X86_FAMILY) | 41 #if defined(ARCH_CPU_X86_FAMILY) |
| 47 #if defined(ARCH_CPU_X86_64) | 42 #if defined(ARCH_CPU_X86_64) |
| 48 bool is64 = true; | 43 bool is64 = true; |
| 49 #elif defined(OS_WIN) | 44 #elif defined(OS_WIN) |
| 50 bool is64 = (base::win::OSInfo::GetInstance()->wow64_status() == | 45 bool is64 = (base::win::OSInfo::GetInstance()->wow64_status() == |
| 51 base::win::OSInfo::WOW64_ENABLED); | 46 base::win::OSInfo::WOW64_ENABLED); |
| 52 #else | 47 #else |
| 53 bool is64 = false; | 48 bool is64 = false; |
| 54 #endif | 49 #endif |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // because it can degrade the responsiveness of the browser. | 463 // because it can degrade the responsiveness of the browser. |
| 469 // The task is sequenced so that multiple writes happen in order. | 464 // The task is sequenced so that multiple writes happen in order. |
| 470 content::BrowserThread::PostBlockingPoolSequencedTask( | 465 content::BrowserThread::PostBlockingPoolSequencedTask( |
| 471 kValidationCacheSequenceName, | 466 kValidationCacheSequenceName, |
| 472 FROM_HERE, | 467 FROM_HERE, |
| 473 base::Bind(WriteCache, validation_cache_file_path_, | 468 base::Bind(WriteCache, validation_cache_file_path_, |
| 474 base::Owned(pickle))); | 469 base::Owned(pickle))); |
| 475 } | 470 } |
| 476 validation_cache_is_modified_ = false; | 471 validation_cache_is_modified_ = false; |
| 477 } | 472 } |
| OLD | NEW |