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

Unified Diff: third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp

Issue 2550373005: Make WebTaskRunner ThreadSafeRefCounted (Closed)
Patch Set: mac fix Created 4 years 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/core/dom/TaskRunnerHelper.cpp
diff --git a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
index f733694c25d01f428614979f336100bb42d9106b..4916bf0f382943f6cf5122e3d93ef28c2976ae2f 100644
--- a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
+++ b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
@@ -13,7 +13,7 @@
namespace blink {
-WebTaskRunner* TaskRunnerHelper::get(TaskType type, LocalFrame* frame) {
+RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, LocalFrame* frame) {
// TODO(haraken): Optimize the mapping from TaskTypes to task runners.
switch (type) {
case TaskType::DOMManipulation:
@@ -43,18 +43,20 @@ WebTaskRunner* TaskRunnerHelper::get(TaskType type, LocalFrame* frame) {
return nullptr;
}
-WebTaskRunner* TaskRunnerHelper::get(TaskType type, Document* document) {
+RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, Document* document) {
return get(type, document ? document->frame() : nullptr);
}
-WebTaskRunner* TaskRunnerHelper::get(TaskType type,
- ExecutionContext* executionContext) {
+RefPtr<WebTaskRunner> TaskRunnerHelper::get(
+ TaskType type,
+ ExecutionContext* executionContext) {
return get(type, executionContext && executionContext->isDocument()
? static_cast<Document*>(executionContext)
: nullptr);
}
-WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) {
+RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type,
+ ScriptState* scriptState) {
return get(type, scriptState ? scriptState->getExecutionContext() : nullptr);
}

Powered by Google App Engine
This is Rietveld 408576698