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

Side by Side Diff: ios/chrome/browser/browser_state/chrome_browser_state_impl.cc

Issue 2056443002: Manual refactor to enum-based WaitableEvent for remaining mac/ios files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d_1_explicit_bools
Patch Set: Created 4 years, 6 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
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 "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
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
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 }
OLDNEW
« no previous file with comments | « content/browser/mach_broker_mac_unittest.cc ('k') | media/audio/mac/audio_auhal_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698