| 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/location.h" | 10 #include "base/location.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 if (!PathService::Get(base::FILE_MODULE, &module_path)) { | 206 if (!PathService::Get(base::FILE_MODULE, &module_path)) { |
| 207 LOG(ERROR) << "NaCl process launch failed: could not resolve module"; | 207 LOG(ERROR) << "NaCl process launch failed: could not resolve module"; |
| 208 return false; | 208 return false; |
| 209 } | 209 } |
| 210 *exe_path = module_path.DirName().Append(L"nacl64"); | 210 *exe_path = module_path.DirName().Append(L"nacl64"); |
| 211 return true; | 211 return true; |
| 212 } | 212 } |
| 213 #endif | 213 #endif |
| 214 | 214 |
| 215 NaClBrowser* NaClBrowser::GetInstance() { | 215 NaClBrowser* NaClBrowser::GetInstance() { |
| 216 return Singleton<NaClBrowser>::get(); | 216 return base::Singleton<NaClBrowser>::get(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool NaClBrowser::IsReady() const { | 219 bool NaClBrowser::IsReady() const { |
| 220 return (IsOk() && | 220 return (IsOk() && |
| 221 irt_state_ == NaClResourceReady && | 221 irt_state_ == NaClResourceReady && |
| 222 validation_cache_state_ == NaClResourceReady); | 222 validation_cache_state_ == NaClResourceReady); |
| 223 } | 223 } |
| 224 | 224 |
| 225 bool NaClBrowser::IsOk() const { | 225 bool NaClBrowser::IsOk() const { |
| 226 return ok_; | 226 return ok_; |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 bool NaClBrowser::IsThrottled() { | 561 bool NaClBrowser::IsThrottled() { |
| 562 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 562 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 563 if (crash_times_.size() != kMaxCrashesPerInterval) { | 563 if (crash_times_.size() != kMaxCrashesPerInterval) { |
| 564 return false; | 564 return false; |
| 565 } | 565 } |
| 566 base::TimeDelta delta = base::Time::Now() - crash_times_.front(); | 566 base::TimeDelta delta = base::Time::Now() - crash_times_.front(); |
| 567 return delta.InSeconds() <= kCrashesIntervalInSeconds; | 567 return delta.InSeconds() <= kCrashesIntervalInSeconds; |
| 568 } | 568 } |
| 569 | 569 |
| 570 } // namespace nacl | 570 } // namespace nacl |
| OLD | NEW |