| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 EnsureValidationCacheAvailable(); | 222 EnsureValidationCacheAvailable(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 // Load the IRT async. | 225 // Load the IRT async. |
| 226 void NaClBrowser::EnsureIrtAvailable() { | 226 void NaClBrowser::EnsureIrtAvailable() { |
| 227 if (IsOk() && irt_state_ == NaClResourceUninitialized) { | 227 if (IsOk() && irt_state_ == NaClResourceUninitialized) { |
| 228 irt_state_ = NaClResourceRequested; | 228 irt_state_ = NaClResourceRequested; |
| 229 // TODO(ncbray) use blocking pool. | 229 // TODO(ncbray) use blocking pool. |
| 230 if (!base::FileUtilProxy::CreateOrOpen( | 230 if (!base::FileUtilProxy::CreateOrOpen( |
| 231 content::BrowserThread::GetMessageLoopProxyForThread( | 231 content::BrowserThread::GetMessageLoopProxyForThread( |
| 232 content::BrowserThread::FILE), | 232 content::BrowserThread::FILE) |
| 233 .get(), |
| 233 irt_filepath_, | 234 irt_filepath_, |
| 234 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, | 235 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, |
| 235 base::Bind(&NaClBrowser::OnIrtOpened, | 236 base::Bind(&NaClBrowser::OnIrtOpened, |
| 236 weak_factory_.GetWeakPtr()))) { | 237 weak_factory_.GetWeakPtr()))) { |
| 237 LOG(ERROR) << "Internal error, NaCl disabled."; | 238 LOG(ERROR) << "Internal error, NaCl disabled."; |
| 238 MarkAsFailed(); | 239 MarkAsFailed(); |
| 239 } | 240 } |
| 240 } | 241 } |
| 241 } | 242 } |
| 242 | 243 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // because it can degrade the responsiveness of the browser. | 547 // because it can degrade the responsiveness of the browser. |
| 547 // The task is sequenced so that multiple writes happen in order. | 548 // The task is sequenced so that multiple writes happen in order. |
| 548 content::BrowserThread::PostBlockingPoolSequencedTask( | 549 content::BrowserThread::PostBlockingPoolSequencedTask( |
| 549 kValidationCacheSequenceName, | 550 kValidationCacheSequenceName, |
| 550 FROM_HERE, | 551 FROM_HERE, |
| 551 base::Bind(WriteCache, validation_cache_file_path_, | 552 base::Bind(WriteCache, validation_cache_file_path_, |
| 552 base::Owned(pickle))); | 553 base::Owned(pickle))); |
| 553 } | 554 } |
| 554 validation_cache_is_modified_ = false; | 555 validation_cache_is_modified_ = false; |
| 555 } | 556 } |
| OLD | NEW |