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

Side by Side Diff: ui/accelerated_widget_mac/window_resize_helper_mac.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: fixed build error and commments Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/accelerated_widget_mac/window_resize_helper_mac.h" 5 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <list> 9 #include <list>
10 #include <utility> 10 #include <utility>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 // base::SingleThreadTaskRunner implementation: 75 // base::SingleThreadTaskRunner implementation:
76 bool PostDelayedTask(const tracked_objects::Location& from_here, 76 bool PostDelayedTask(const tracked_objects::Location& from_here,
77 base::OnceClosure task, 77 base::OnceClosure task,
78 base::TimeDelta delay) override; 78 base::TimeDelta delay) override;
79 79
80 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 80 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
81 base::OnceClosure task, 81 base::OnceClosure task,
82 base::TimeDelta delay) override; 82 base::TimeDelta delay) override;
83 83
84 bool RunsTasksOnCurrentThread() const override; 84 bool RunsTasksInCurrentSequence() const override;
85 85
86 private: 86 private:
87 friend class WrappedTask; 87 friend class WrappedTask;
88 88
89 ~PumpableTaskRunner() override; 89 ~PumpableTaskRunner() override;
90 90
91 // A queue of live messages. Must hold |task_queue_lock_| to access. Tasks 91 // A queue of live messages. Must hold |task_queue_lock_| to access. Tasks
92 // are added only on the IO thread and removed only on the UI thread. The 92 // are added only on the IO thread and removed only on the UI thread. The
93 // WrappedTask objects are removed from the queue when they are run (by 93 // WrappedTask objects are removed from the queue when they are run (by
94 // |target_task_runner_| or by a call to WaitForSingleWrappedTaskToRun 94 // |target_task_runner_| or by a call to WaitForSingleWrappedTaskToRun
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 bool PumpableTaskRunner::PostNonNestableDelayedTask( 269 bool PumpableTaskRunner::PostNonNestableDelayedTask(
270 const tracked_objects::Location& from_here, 270 const tracked_objects::Location& from_here,
271 base::OnceClosure task, 271 base::OnceClosure task,
272 base::TimeDelta delay) { 272 base::TimeDelta delay) {
273 // The correctness of non-nestable events hasn't been proven for this 273 // The correctness of non-nestable events hasn't been proven for this
274 // structure. 274 // structure.
275 NOTREACHED(); 275 NOTREACHED();
276 return false; 276 return false;
277 } 277 }
278 278
279 bool PumpableTaskRunner::RunsTasksOnCurrentThread() const { 279 bool PumpableTaskRunner::RunsTasksInCurrentSequence() const {
280 return target_task_runner_->RunsTasksOnCurrentThread(); 280 return target_task_runner_->RunsTasksInCurrentSequence();
281 } 281 }
282 282
283 } // namespace 283 } // namespace
284 284
285 //////////////////////////////////////////////////////////////////////////////// 285 ////////////////////////////////////////////////////////////////////////////////
286 // WindowResizeHelperMac 286 // WindowResizeHelperMac
287 287
288 scoped_refptr<base::SingleThreadTaskRunner> WindowResizeHelperMac::task_runner() 288 scoped_refptr<base::SingleThreadTaskRunner> WindowResizeHelperMac::task_runner()
289 const { 289 const {
290 return task_runner_; 290 return task_runner_;
(...skipping 27 matching lines...) Expand all
318 WindowResizeHelperMac::WindowResizeHelperMac() {} 318 WindowResizeHelperMac::WindowResizeHelperMac() {}
319 WindowResizeHelperMac::~WindowResizeHelperMac() {} 319 WindowResizeHelperMac::~WindowResizeHelperMac() {}
320 320
321 void WindowResizeHelperMac::EventTimedWait(base::WaitableEvent* event, 321 void WindowResizeHelperMac::EventTimedWait(base::WaitableEvent* event,
322 base::TimeDelta delay) { 322 base::TimeDelta delay) {
323 base::ThreadRestrictions::ScopedAllowWait allow_wait; 323 base::ThreadRestrictions::ScopedAllowWait allow_wait;
324 event->TimedWait(delay); 324 event->TimedWait(delay);
325 } 325 }
326 326
327 } // namespace ui 327 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698