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

Unified Diff: third_party/WebKit/Source/platform/WebTaskRunner.h

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/WebTaskRunner.h
diff --git a/third_party/WebKit/Source/platform/WebTaskRunner.h b/third_party/WebKit/Source/platform/WebTaskRunner.h
index 073e1ee9573459779b046c14256f5282de662a6c..2bc0f52176bfc3d66c88ed0fea83a9df0c2c72ab 100644
--- a/third_party/WebKit/Source/platform/WebTaskRunner.h
+++ b/third_party/WebKit/Source/platform/WebTaskRunner.h
@@ -56,19 +56,15 @@ class BLINK_PLATFORM_EXPORT TaskHandle {
};
// The blink representation of a chromium SingleThreadTaskRunner.
-class BLINK_PLATFORM_EXPORT WebTaskRunner {
+class BLINK_PLATFORM_EXPORT WebTaskRunner
+ : public ThreadSafeRefCounted<WebTaskRunner> {
public:
- virtual ~WebTaskRunner() {}
-
// Schedule a task to be run after |delayMs| on the the associated WebThread.
// Can be called from any thread.
virtual void postDelayedTask(const WebTraceLocation&,
const base::Closure&,
double delayMs) = 0;
- // Returns a clone of the WebTaskRunner.
- virtual std::unique_ptr<WebTaskRunner> clone() = 0;
-
// Returns true if the current thread is a thread on which a task may be run.
// Can be called from any thread.
virtual bool runsTasksOnCurrentThread() = 0;
@@ -117,6 +113,14 @@ class BLINK_PLATFORM_EXPORT WebTaskRunner {
postDelayedCancellableTask(const WebTraceLocation&,
std::unique_ptr<WTF::Closure>,
long long delayMs);
+
+ protected:
+ friend ThreadSafeRefCounted<WebTaskRunner>;
+ WebTaskRunner() = default;
+ virtual ~WebTaskRunner();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebTaskRunner);
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/WebFrameScheduler.h ('k') | third_party/WebKit/Source/platform/WebTaskRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698