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

Side by Side Diff: components/leveldb/leveldb_mojo_proxy.cc

Issue 2028193002: Migrate WaitableEvent to enum-based constructor in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: rm comment explaining true/false 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/leveldb/leveldb_mojo_proxy.h" 5 #include "components/leveldb/leveldb_mojo_proxy.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 LevelDBMojoProxy::~LevelDBMojoProxy() { 139 LevelDBMojoProxy::~LevelDBMojoProxy() {
140 DCHECK_EQ(0, outstanding_opaque_dirs_); 140 DCHECK_EQ(0, outstanding_opaque_dirs_);
141 } 141 }
142 142
143 void LevelDBMojoProxy::RunInternal(const base::Closure& task) { 143 void LevelDBMojoProxy::RunInternal(const base::Closure& task) {
144 if (task_runner_->BelongsToCurrentThread()) { 144 if (task_runner_->BelongsToCurrentThread()) {
145 task.Run(); 145 task.Run();
146 } else { 146 } else {
147 base::WaitableEvent done_event(false, false); 147 base::WaitableEvent done_event(
148 base::WaitableEvent::ResetPolicy::AUTOMATIC,
149 base::WaitableEvent::InitialState::NOT_SIGNALED);
148 task_runner_->PostTask( 150 task_runner_->PostTask(
149 FROM_HERE, 151 FROM_HERE,
150 base::Bind(&LevelDBMojoProxy::DoOnOtherThread, 152 base::Bind(&LevelDBMojoProxy::DoOnOtherThread,
151 this, 153 this,
152 task, 154 task,
153 base::Unretained(&done_event))); 155 base::Unretained(&done_event)));
154 done_event.Wait(); 156 done_event.Wait();
155 } 157 }
156 } 158 }
157 159
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 *out_lock = l; 322 *out_lock = l;
321 } 323 }
322 } 324 }
323 325
324 void LevelDBMojoProxy::UnlockFileImpl(std::unique_ptr<OpaqueLock> lock, 326 void LevelDBMojoProxy::UnlockFileImpl(std::unique_ptr<OpaqueLock> lock,
325 filesystem::mojom::FileError* out_error) { 327 filesystem::mojom::FileError* out_error) {
326 lock->lock_file->Unlock(out_error); 328 lock->lock_file->Unlock(out_error);
327 } 329 }
328 330
329 } // namespace leveldb 331 } // namespace leveldb
OLDNEW
« no previous file with comments | « components/font_service/public/cpp/font_service_thread.cc ('k') | components/mus/gles2/command_buffer_local.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698