| 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/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 break; | 251 break; |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 if (inverse_debug_patterns_) { | 254 if (inverse_debug_patterns_) { |
| 255 return !matches; | 255 return !matches; |
| 256 } else { | 256 } else { |
| 257 return matches; | 257 return matches; |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 | 260 |
| 261 void NaClBrowser::DebugStubNewPortAllocated(int port) { |
| 262 content::BrowserThread::PostTask( |
| 263 content::BrowserThread::IO, |
| 264 FROM_HERE, |
| 265 base::Bind(debug_stub_port_listener_, port)); |
| 266 } |
| 267 |
| 268 bool NaClBrowser::HasDebugStubPortListener() { |
| 269 return !debug_stub_port_listener_.is_null(); |
| 270 } |
| 271 |
| 272 void NaClBrowser::SetDebugStubPortListener(base::Callback<void(int)> listener) { |
| 273 debug_stub_port_listener_ = listener; |
| 274 } |
| 275 |
| 276 void NaClBrowser::ClearDebugStubPortListener() { |
| 277 debug_stub_port_listener_.Reset(); |
| 278 } |
| 279 |
| 261 void NaClBrowser::InitValidationCacheFilePath() { | 280 void NaClBrowser::InitValidationCacheFilePath() { |
| 262 // Determine where the validation cache resides in the file system. It | 281 // Determine where the validation cache resides in the file system. It |
| 263 // exists in Chrome's cache directory and is not tied to any specific | 282 // exists in Chrome's cache directory and is not tied to any specific |
| 264 // profile. | 283 // profile. |
| 265 // Start by finding the user data directory. | 284 // Start by finding the user data directory. |
| 266 FilePath user_data_dir; | 285 FilePath user_data_dir; |
| 267 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 286 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 268 RunWithoutValidationCache(); | 287 RunWithoutValidationCache(); |
| 269 return; | 288 return; |
| 270 } | 289 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // because it can degrade the responsiveness of the browser. | 467 // because it can degrade the responsiveness of the browser. |
| 449 // The task is sequenced so that multiple writes happen in order. | 468 // The task is sequenced so that multiple writes happen in order. |
| 450 content::BrowserThread::PostBlockingPoolSequencedTask( | 469 content::BrowserThread::PostBlockingPoolSequencedTask( |
| 451 kValidationCacheSequenceName, | 470 kValidationCacheSequenceName, |
| 452 FROM_HERE, | 471 FROM_HERE, |
| 453 base::Bind(WriteCache, validation_cache_file_path_, | 472 base::Bind(WriteCache, validation_cache_file_path_, |
| 454 base::Owned(pickle))); | 473 base::Owned(pickle))); |
| 455 } | 474 } |
| 456 validation_cache_is_modified_ = false; | 475 validation_cache_is_modified_ = false; |
| 457 } | 476 } |
| OLD | NEW |