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/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void WriteCache(const base::FilePath& filename, const Pickle* pickle) { | 97 void WriteCache(const base::FilePath& filename, const Pickle* pickle) { |
98 file_util::WriteFile(filename, static_cast<const char*>(pickle->data()), | 98 file_util::WriteFile(filename, static_cast<const char*>(pickle->data()), |
99 pickle->size()); | 99 pickle->size()); |
100 } | 100 } |
101 | 101 |
102 void RemoveCache(const base::FilePath& filename, | 102 void RemoveCache(const base::FilePath& filename, |
103 const base::Closure& callback) { | 103 const base::Closure& callback) { |
104 file_util::Delete(filename, false); | 104 base::Delete(filename, false); |
105 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, | 105 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, |
106 callback); | 106 callback); |
107 } | 107 } |
108 | 108 |
109 void LogCacheQuery(ValidationCacheStatus status) { | 109 void LogCacheQuery(ValidationCacheStatus status) { |
110 UMA_HISTOGRAM_ENUMERATION("NaCl.ValidationCache.Query", status, CACHE_MAX); | 110 UMA_HISTOGRAM_ENUMERATION("NaCl.ValidationCache.Query", status, CACHE_MAX); |
111 } | 111 } |
112 | 112 |
113 void LogCacheSet(ValidationCacheStatus status) { | 113 void LogCacheSet(ValidationCacheStatus status) { |
114 // Bucket zero is reserved for future use. | 114 // Bucket zero is reserved for future use. |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 // because it can degrade the responsiveness of the browser. | 559 // because it can degrade the responsiveness of the browser. |
560 // The task is sequenced so that multiple writes happen in order. | 560 // The task is sequenced so that multiple writes happen in order. |
561 content::BrowserThread::PostBlockingPoolSequencedTask( | 561 content::BrowserThread::PostBlockingPoolSequencedTask( |
562 kValidationCacheSequenceName, | 562 kValidationCacheSequenceName, |
563 FROM_HERE, | 563 FROM_HERE, |
564 base::Bind(WriteCache, validation_cache_file_path_, | 564 base::Bind(WriteCache, validation_cache_file_path_, |
565 base::Owned(pickle))); | 565 base::Owned(pickle))); |
566 } | 566 } |
567 validation_cache_is_modified_ = false; | 567 validation_cache_is_modified_ = false; |
568 } | 568 } |
OLD | NEW |