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

Side by Side Diff: third_party/WebKit/Source/platform/WebTaskRunner.cpp

Issue 2550373005: Make WebTaskRunner ThreadSafeRefCounted (Closed)
Patch Set: +DISALLOW_COPY_AND_ASSIGN for win build fix Created 3 years, 11 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 "platform/WebTaskRunner.h" 5 #include "platform/WebTaskRunner.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 long long delayMs) { 148 long long delayMs) {
149 DCHECK(runsTasksOnCurrentThread()); 149 DCHECK(runsTasksOnCurrentThread());
150 RefPtr<TaskHandle::Runner> runner = 150 RefPtr<TaskHandle::Runner> runner =
151 adoptRef(new TaskHandle::Runner(std::move(task))); 151 adoptRef(new TaskHandle::Runner(std::move(task)));
152 postDelayedTask(location, WTF::bind(&TaskHandle::Runner::run, 152 postDelayedTask(location, WTF::bind(&TaskHandle::Runner::run,
153 runner->asWeakPtr(), TaskHandle(runner)), 153 runner->asWeakPtr(), TaskHandle(runner)),
154 delayMs); 154 delayMs);
155 return TaskHandle(runner); 155 return TaskHandle(runner);
156 } 156 }
157 157
158 WebTaskRunner::~WebTaskRunner() = default;
159
158 } // namespace blink 160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/WebTaskRunner.h ('k') | third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698