Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(972)

Side by Side Diff: components/nacl/browser/nacl_browser.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/nacl/browser/nacl_browser.h ('k') | components/nacl/browser/pnacl_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/nacl/browser/nacl_browser.h ('k') | components/nacl/browser/pnacl_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698