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

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

Issue 2110363002: Rename SameThreadClosure to Closure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@TRV_ExplicitWTFBind
Patch Set: Add WTF:: to Closure Created 4 years, 5 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 "public/platform/WebTaskRunner.h" 5 #include "public/platform/WebTaskRunner.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 class SameThreadTask : public WebTaskRunner::Task { 9 class SameThreadTask : public WebTaskRunner::Task {
10 USING_FAST_MALLOC(SameThreadTask); 10 USING_FAST_MALLOC(SameThreadTask);
11 WTF_MAKE_NONCOPYABLE(SameThreadTask); 11 WTF_MAKE_NONCOPYABLE(SameThreadTask);
12 public: 12 public:
13 explicit SameThreadTask(std::unique_ptr<SameThreadClosure> closure) 13 explicit SameThreadTask(std::unique_ptr<WTF::Closure> closure)
14 : m_closure(std::move(closure)) 14 : m_closure(std::move(closure))
15 { 15 {
16 } 16 }
17 17
18 void run() override 18 void run() override
19 { 19 {
20 (*m_closure)(); 20 (*m_closure)();
21 } 21 }
22 22
23 private: 23 private:
24 std::unique_ptr<SameThreadClosure> m_closure; 24 std::unique_ptr<WTF::Closure> m_closure;
25 }; 25 };
26 26
27 class CrossThreadTask : public WebTaskRunner::Task { 27 class CrossThreadTask : public WebTaskRunner::Task {
28 USING_FAST_MALLOC(CrossThreadTask); 28 USING_FAST_MALLOC(CrossThreadTask);
29 WTF_MAKE_NONCOPYABLE(CrossThreadTask); 29 WTF_MAKE_NONCOPYABLE(CrossThreadTask);
30 public: 30 public:
31 explicit CrossThreadTask(std::unique_ptr<CrossThreadClosure> closure) 31 explicit CrossThreadTask(std::unique_ptr<CrossThreadClosure> closure)
32 : m_closure(std::move(closure)) 32 : m_closure(std::move(closure))
33 { 33 {
34 } 34 }
(...skipping 10 matching lines...) Expand all
45 void WebTaskRunner::postTask(const WebTraceLocation& location, std::unique_ptr<C rossThreadClosure> task) 45 void WebTaskRunner::postTask(const WebTraceLocation& location, std::unique_ptr<C rossThreadClosure> task)
46 { 46 {
47 postTask(location, new CrossThreadTask(std::move(task))); 47 postTask(location, new CrossThreadTask(std::move(task)));
48 } 48 }
49 49
50 void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, std::uniqu e_ptr<CrossThreadClosure> task, long long delayMs) 50 void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, std::uniqu e_ptr<CrossThreadClosure> task, long long delayMs)
51 { 51 {
52 postDelayedTask(location, new CrossThreadTask(std::move(task)), delayMs); 52 postDelayedTask(location, new CrossThreadTask(std::move(task)), delayMs);
53 } 53 }
54 54
55 void WebTaskRunner::postTask(const WebTraceLocation& location, std::unique_ptr<S ameThreadClosure> task) 55 void WebTaskRunner::postTask(const WebTraceLocation& location, std::unique_ptr<W TF::Closure> task)
56 { 56 {
57 postTask(location, new SameThreadTask(std::move(task))); 57 postTask(location, new SameThreadTask(std::move(task)));
58 } 58 }
59 59
60 void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, std::uniqu e_ptr<SameThreadClosure> task, long long delayMs) 60 void WebTaskRunner::postDelayedTask(const WebTraceLocation& location, std::uniqu e_ptr<WTF::Closure> task, long long delayMs)
61 { 61 {
62 postDelayedTask(location, new SameThreadTask(std::move(task)), delayMs); 62 postDelayedTask(location, new SameThreadTask(std::move(task)), delayMs);
63 } 63 }
64 64
65 } // namespace blink 65 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698