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

Side by Side Diff: content/child/fileapi/webfilesystem_impl.cc

Issue 2026253003: Migrate WaitableEvent to enum-based constructor in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
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
« no previous file with comments | « content/child/child_process.cc ('k') | content/child/fileapi/webfilewriter_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/child/fileapi/webfilesystem_impl.h" 5 #include "content/child/fileapi/webfilesystem_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 24 matching lines...) Expand all
35 using blink::WebString; 35 using blink::WebString;
36 using blink::WebURL; 36 using blink::WebURL;
37 using blink::WebVector; 37 using blink::WebVector;
38 38
39 namespace content { 39 namespace content {
40 40
41 class WebFileSystemImpl::WaitableCallbackResults 41 class WebFileSystemImpl::WaitableCallbackResults
42 : public base::RefCountedThreadSafe<WaitableCallbackResults> { 42 : public base::RefCountedThreadSafe<WaitableCallbackResults> {
43 public: 43 public:
44 WaitableCallbackResults() 44 WaitableCallbackResults()
45 : results_available_event_(true /* manual_reset */, 45 : results_available_event_(
46 false /* initially_signaled */) {} 46 base::WaitableEvent::ResetPolicy::MANUAL,
47 base::WaitableEvent::InitialState::NOT_SIGNALED) {}
47 48
48 void AddResultsAndSignal(const base::Closure& results_closure) { 49 void AddResultsAndSignal(const base::Closure& results_closure) {
49 base::AutoLock lock(lock_); 50 base::AutoLock lock(lock_);
50 results_closures_.push_back(results_closure); 51 results_closures_.push_back(results_closure);
51 results_available_event_.Signal(); 52 results_available_event_.Signal();
52 } 53 }
53 54
54 void WaitAndRun() { 55 void WaitAndRun() {
55 { 56 {
56 blink::WebHeap::SafePointScope safe_point; 57 blink::WebHeap::SafePointScope safe_point;
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 WaitableCallbackResults* WebFileSystemImpl::MaybeCreateWaitableResults( 703 WaitableCallbackResults* WebFileSystemImpl::MaybeCreateWaitableResults(
703 const WebFileSystemCallbacks& callbacks, int callbacks_id) { 704 const WebFileSystemCallbacks& callbacks, int callbacks_id) {
704 if (!callbacks.shouldBlockUntilCompletion()) 705 if (!callbacks.shouldBlockUntilCompletion())
705 return NULL; 706 return NULL;
706 WaitableCallbackResults* results = new WaitableCallbackResults(); 707 WaitableCallbackResults* results = new WaitableCallbackResults();
707 waitable_results_[callbacks_id] = results; 708 waitable_results_[callbacks_id] = results;
708 return results; 709 return results;
709 } 710 }
710 711
711 } // namespace content 712 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_process.cc ('k') | content/child/fileapi/webfilewriter_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698