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

Side by Side Diff: base/mac/libdispatch_task_runner.cc

Issue 2050283002: Fix compile again (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d_5_event_var
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 | « no previous file | media/gpu/v4l2_video_decode_accelerator.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 (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 "base/mac/libdispatch_task_runner.h" 5 #include "base/mac/libdispatch_task_runner.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 10
11 namespace base { 11 namespace base {
12 namespace mac { 12 namespace mac {
13 13
14 LibDispatchTaskRunner::LibDispatchTaskRunner(const char* name) 14 LibDispatchTaskRunner::LibDispatchTaskRunner(const char* name)
15 : queue_(dispatch_queue_create(name, NULL)), 15 : queue_(dispatch_queue_create(name, NULL)),
16 queue_finalized_(false, false) { 16 queue_finalized_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
17 base::WaitableEvent::InitialState::NOT_SIGNALED) {
17 dispatch_set_context(queue_, this); 18 dispatch_set_context(queue_, this);
18 dispatch_set_finalizer_f(queue_, &LibDispatchTaskRunner::Finalizer); 19 dispatch_set_finalizer_f(queue_, &LibDispatchTaskRunner::Finalizer);
19 } 20 }
20 21
21 bool LibDispatchTaskRunner::PostDelayedTask( 22 bool LibDispatchTaskRunner::PostDelayedTask(
22 const tracked_objects::Location& from_here, 23 const tracked_objects::Location& from_here,
23 const Closure& task, 24 const Closure& task,
24 base::TimeDelta delay) { 25 base::TimeDelta delay) {
25 if (!queue_) 26 if (!queue_)
26 return false; 27 return false;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 74 }
74 } 75 }
75 76
76 void LibDispatchTaskRunner::Finalizer(void* context) { 77 void LibDispatchTaskRunner::Finalizer(void* context) {
77 LibDispatchTaskRunner* self = static_cast<LibDispatchTaskRunner*>(context); 78 LibDispatchTaskRunner* self = static_cast<LibDispatchTaskRunner*>(context);
78 self->queue_finalized_.Signal(); 79 self->queue_finalized_.Signal();
79 } 80 }
80 81
81 } // namespace mac 82 } // namespace mac
82 } // namespace base 83 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | media/gpu/v4l2_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698