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/browser/nacl_browser.h" | 5 #include "components/nacl/browser/nacl_browser.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_proxy.h" | 8 #include "base/files/file_proxy.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 irt_state_(NaClResourceUninitialized), | 141 irt_state_(NaClResourceUninitialized), |
| 142 validation_cache_file_path_(), | 142 validation_cache_file_path_(), |
| 143 validation_cache_is_enabled_( | 143 validation_cache_is_enabled_( |
| 144 CheckEnvVar("NACL_VALIDATION_CACHE", | 144 CheckEnvVar("NACL_VALIDATION_CACHE", |
| 145 kValidationCacheEnabledByDefault)), | 145 kValidationCacheEnabledByDefault)), |
| 146 validation_cache_is_modified_(false), | 146 validation_cache_is_modified_(false), |
| 147 validation_cache_state_(NaClResourceUninitialized), | 147 validation_cache_state_(NaClResourceUninitialized), |
| 148 path_cache_(kFilePathCacheSize), | 148 path_cache_(kFilePathCacheSize), |
| 149 ok_(true), | 149 ok_(true), |
| 150 weak_factory_(this) { | 150 weak_factory_(this) { |
| 151 #if defined(OS_ANDROID) | |
| 152 validation_cache_is_enabled_ = false; | |
| 153 #endif | |
|
bbudge
2015/01/23 00:28:28
It might be a little nicer if we set this to false
sehr
2015/01/30 01:24:00
Done.
| |
| 151 } | 154 } |
| 152 | 155 |
| 153 void NaClBrowser::SetDelegate(NaClBrowserDelegate* delegate) { | 156 void NaClBrowser::SetDelegate(NaClBrowserDelegate* delegate) { |
| 154 NaClBrowser* nacl_browser = NaClBrowser::GetInstance(); | 157 NaClBrowser* nacl_browser = NaClBrowser::GetInstance(); |
| 155 nacl_browser->browser_delegate_.reset(delegate); | 158 nacl_browser->browser_delegate_.reset(delegate); |
| 156 } | 159 } |
| 157 | 160 |
| 158 NaClBrowserDelegate* NaClBrowser::GetDelegate() { | 161 NaClBrowserDelegate* NaClBrowser::GetDelegate() { |
| 159 // The delegate is not owned by the IO thread. This accessor method can be | 162 // The delegate is not owned by the IO thread. This accessor method can be |
| 160 // called from other threads. | 163 // called from other threads. |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 555 bool NaClBrowser::IsThrottled() { | 558 bool NaClBrowser::IsThrottled() { |
| 556 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 559 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 557 if (crash_times_.size() != kMaxCrashesPerInterval) { | 560 if (crash_times_.size() != kMaxCrashesPerInterval) { |
| 558 return false; | 561 return false; |
| 559 } | 562 } |
| 560 base::TimeDelta delta = base::Time::Now() - crash_times_.front(); | 563 base::TimeDelta delta = base::Time::Now() - crash_times_.front(); |
| 561 return delta.InSeconds() <= kCrashesIntervalInSeconds; | 564 return delta.InSeconds() <= kCrashesIntervalInSeconds; |
| 562 } | 565 } |
| 563 | 566 |
| 564 } // namespace nacl | 567 } // namespace nacl |
| OLD | NEW |