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

Side by Side Diff: third_party/WebKit/Source/platform/WebThreadSupportingGC.h

Issue 1713143002: Remove most of the blink::Task wrapping of WTF::Function outside WebTaskRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef WebThreadSupportingGC_h 5 #ifndef WebThreadSupportingGC_h
6 #define WebThreadSupportingGC_h 6 #define WebThreadSupportingGC_h
7 7
8 #include "platform/heap/GCTaskRunner.h" 8 #include "platform/heap/GCTaskRunner.h"
9 #include "public/platform/Platform.h" 9 #include "public/platform/Platform.h"
10 #include "public/platform/WebTaskRunner.h" 10 #include "public/platform/WebTaskRunner.h"
(...skipping 15 matching lines...) Expand all
26 // WebThreadSupportingGC usually internally creates and owns WebThread unless 26 // WebThreadSupportingGC usually internally creates and owns WebThread unless
27 // an existing WebThread is given via createForThread. 27 // an existing WebThread is given via createForThread.
28 class PLATFORM_EXPORT WebThreadSupportingGC final { 28 class PLATFORM_EXPORT WebThreadSupportingGC final {
29 USING_FAST_MALLOC(WebThreadSupportingGC); 29 USING_FAST_MALLOC(WebThreadSupportingGC);
30 WTF_MAKE_NONCOPYABLE(WebThreadSupportingGC); 30 WTF_MAKE_NONCOPYABLE(WebThreadSupportingGC);
31 public: 31 public:
32 static PassOwnPtr<WebThreadSupportingGC> create(const char* name); 32 static PassOwnPtr<WebThreadSupportingGC> create(const char* name);
33 static PassOwnPtr<WebThreadSupportingGC> createForThread(WebThread*); 33 static PassOwnPtr<WebThreadSupportingGC> createForThread(WebThread*);
34 ~WebThreadSupportingGC(); 34 ~WebThreadSupportingGC();
35 35
36 void postTask(const WebTraceLocation& location, WebTaskRunner::Task* task) 36 void postTask(const WebTraceLocation& location, PassOwnPtr<Closure> task)
37 { 37 {
38 m_thread->taskRunner()->postTask(location, task); 38 m_thread->taskRunner()->postTask(location, task);
39 } 39 }
40 40
41 void postDelayedTask(const WebTraceLocation& location, WebTaskRunner::Task* task, long long delayMs) 41 void postDelayedTask(const WebTraceLocation& location, PassOwnPtr<Closure> t ask, long long delayMs)
42 { 42 {
43 m_thread->taskRunner()->postDelayedTask(location, task, delayMs); 43 m_thread->taskRunner()->postDelayedTask(location, task, delayMs);
44 } 44 }
45 45
46 bool isCurrentThread() const 46 bool isCurrentThread() const
47 { 47 {
48 return m_thread->isCurrentThread(); 48 return m_thread->isCurrentThread();
49 } 49 }
50 50
51 void addTaskObserver(WebThread::TaskObserver* observer) 51 void addTaskObserver(WebThread::TaskObserver* observer)
(...skipping 23 matching lines...) Expand all
75 // m_thread is guaranteed to be non-null after this instance is constructed. 75 // m_thread is guaranteed to be non-null after this instance is constructed.
76 // m_owningThread is non-null unless this instance is constructed for an 76 // m_owningThread is non-null unless this instance is constructed for an
77 // existing thread via createForThread(). 77 // existing thread via createForThread().
78 WebThread* m_thread = nullptr; 78 WebThread* m_thread = nullptr;
79 OwnPtr<WebThread> m_owningThread; 79 OwnPtr<WebThread> m_owningThread;
80 }; 80 };
81 81
82 } // namespace blink 82 } // namespace blink
83 83
84 #endif 84 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/WebScheduler.cpp ('k') | third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698