| 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 "ios/chrome/browser/browser_state/chrome_browser_state_impl.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // blocking I/O pool. | 65 // blocking I/O pool. |
| 66 void BlockFileThreadOnDirectoryCreate(base::WaitableEvent* done_creating) { | 66 void BlockFileThreadOnDirectoryCreate(base::WaitableEvent* done_creating) { |
| 67 done_creating->Wait(); | 67 done_creating->Wait(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // Initiates creation of browser state directory on |sequenced_task_runner| and | 70 // Initiates creation of browser state directory on |sequenced_task_runner| and |
| 71 // ensures that FILE thread is blocked until that operation finishes. | 71 // ensures that FILE thread is blocked until that operation finishes. |
| 72 void CreateBrowserStateDirectory( | 72 void CreateBrowserStateDirectory( |
| 73 base::SequencedTaskRunner* sequenced_task_runner, | 73 base::SequencedTaskRunner* sequenced_task_runner, |
| 74 const base::FilePath& path) { | 74 const base::FilePath& path) { |
| 75 base::WaitableEvent* done_creating = new base::WaitableEvent(false, false); | 75 base::WaitableEvent* done_creating = |
| 76 new base::WaitableEvent(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 77 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 76 sequenced_task_runner->PostTask( | 78 sequenced_task_runner->PostTask( |
| 77 FROM_HERE, base::Bind(&CreateDirectoryAndSignal, path, done_creating)); | 79 FROM_HERE, base::Bind(&CreateDirectoryAndSignal, path, done_creating)); |
| 78 // Block the FILE thread until directory is created on I/O pool to make sure | 80 // Block the FILE thread until directory is created on I/O pool to make sure |
| 79 // that we don't attempt any operation until that part completes. | 81 // that we don't attempt any operation until that part completes. |
| 80 web::WebThread::PostTask(web::WebThread::FILE, FROM_HERE, | 82 web::WebThread::PostTask(web::WebThread::FILE, FROM_HERE, |
| 81 base::Bind(&BlockFileThreadOnDirectoryCreate, | 83 base::Bind(&BlockFileThreadOnDirectoryCreate, |
| 82 base::Owned(done_creating))); | 84 base::Owned(done_creating))); |
| 83 } | 85 } |
| 84 | 86 |
| 85 base::FilePath GetCachePath(const base::FilePath& base) { | 87 base::FilePath GetCachePath(const base::FilePath& base) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 net::SSLConfigService* ChromeBrowserStateImpl::GetSSLConfigService() { | 253 net::SSLConfigService* ChromeBrowserStateImpl::GetSSLConfigService() { |
| 252 // If ssl_config_service_manager_ is null, this typically means that some | 254 // If ssl_config_service_manager_ is null, this typically means that some |
| 253 // KeyedService is trying to create a RequestContext at startup, | 255 // KeyedService is trying to create a RequestContext at startup, |
| 254 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is | 256 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is |
| 255 // invoked after all KeyedServices have been initialized (see | 257 // invoked after all KeyedServices have been initialized (see |
| 256 // http://crbug.com/171406). | 258 // http://crbug.com/171406). |
| 257 DCHECK(ssl_config_service_manager_) | 259 DCHECK(ssl_config_service_manager_) |
| 258 << "SSLConfigServiceManager is not initialized yet"; | 260 << "SSLConfigServiceManager is not initialized yet"; |
| 259 return ssl_config_service_manager_->Get(); | 261 return ssl_config_service_manager_->Get(); |
| 260 } | 262 } |
| OLD | NEW |