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

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

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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 | Annotate | Revision Log
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/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 irt_filepath_, 259 irt_filepath_,
260 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, 260 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
261 base::Bind(&NaClBrowser::OnIrtOpened, 261 base::Bind(&NaClBrowser::OnIrtOpened,
262 weak_factory_.GetWeakPtr()))) { 262 weak_factory_.GetWeakPtr()))) {
263 LOG(ERROR) << "Internal error, NaCl disabled."; 263 LOG(ERROR) << "Internal error, NaCl disabled.";
264 MarkAsFailed(); 264 MarkAsFailed();
265 } 265 }
266 } 266 }
267 } 267 }
268 268
269 void NaClBrowser::OnIrtOpened(base::PlatformFileError error_code, 269 void NaClBrowser::OnIrtOpened(base::File::Error error_code,
270 base::PassPlatformFile file, 270 base::PassPlatformFile file,
271 bool created) { 271 bool created) {
272 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 272 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
273 DCHECK_EQ(irt_state_, NaClResourceRequested); 273 DCHECK_EQ(irt_state_, NaClResourceRequested);
274 DCHECK(!created); 274 DCHECK(!created);
275 if (error_code == base::PLATFORM_FILE_OK) { 275 if (error_code == base::File::FILE_OK) {
276 irt_platform_file_ = file.ReleaseValue(); 276 irt_platform_file_ = file.ReleaseValue();
277 } else { 277 } else {
278 LOG(ERROR) << "Failed to open NaCl IRT file \"" 278 LOG(ERROR) << "Failed to open NaCl IRT file \""
279 << irt_filepath_.LossyDisplayName() 279 << irt_filepath_.LossyDisplayName()
280 << "\": " << error_code; 280 << "\": " << error_code;
281 MarkAsFailed(); 281 MarkAsFailed();
282 } 282 }
283 irt_state_ = NaClResourceReady; 283 irt_state_ = NaClResourceReady;
284 CheckWaiting(); 284 CheckWaiting();
285 } 285 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 bool NaClBrowser::IsThrottled() { 558 bool NaClBrowser::IsThrottled() {
559 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 559 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
560 if (crash_times_.size() != kMaxCrashesPerInterval) { 560 if (crash_times_.size() != kMaxCrashesPerInterval) {
561 return false; 561 return false;
562 } 562 }
563 base::TimeDelta delta = base::Time::Now() - crash_times_.front(); 563 base::TimeDelta delta = base::Time::Now() - crash_times_.front();
564 return delta.InSeconds() <= kCrashesIntervalInSeconds; 564 return delta.InSeconds() <= kCrashesIntervalInSeconds;
565 } 565 }
566 566
567 } // namespace nacl 567 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/browser/nacl_browser.h ('k') | content/browser/fileapi/blob_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698