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

Side by Side Diff: third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp

Issue 2583013002: Specify TaskType of posted Task explicitly in Quota API (13) (Closed)
Patch Set: rebase 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/dom/TaskRunnerHelper.h" 5 #include "core/dom/TaskRunnerHelper.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "platform/WebFrameScheduler.h" 9 #include "platform/WebFrameScheduler.h"
10 #include "platform/WebTaskRunner.h" 10 #include "platform/WebTaskRunner.h"
(...skipping 16 matching lines...) Expand all
27 case TaskType::Microtask: 27 case TaskType::Microtask:
28 case TaskType::PostedMessage: 28 case TaskType::PostedMessage:
29 case TaskType::UnshippedPortMessage: 29 case TaskType::UnshippedPortMessage:
30 case TaskType::FileReading: 30 case TaskType::FileReading:
31 case TaskType::DatabaseAccess: 31 case TaskType::DatabaseAccess:
32 case TaskType::Presentation: 32 case TaskType::Presentation:
33 case TaskType::Sensor: 33 case TaskType::Sensor:
34 case TaskType::Timer: 34 case TaskType::Timer:
35 case TaskType::UnspecedTimer: 35 case TaskType::UnspecedTimer:
36 case TaskType::Unspecified: 36 case TaskType::Unspecified:
37 case TaskType::MiscPlatformAPI:
37 return frame ? frame->frameScheduler()->timerTaskRunner() 38 return frame ? frame->frameScheduler()->timerTaskRunner()
38 : Platform::current()->currentThread()->getWebTaskRunner(); 39 : Platform::current()->currentThread()->getWebTaskRunner();
39 case TaskType::UnspecedLoading: 40 case TaskType::UnspecedLoading:
40 case TaskType::Networking: 41 case TaskType::Networking:
41 return frame ? frame->frameScheduler()->loadingTaskRunner() 42 return frame ? frame->frameScheduler()->loadingTaskRunner()
42 : Platform::current()->currentThread()->getWebTaskRunner(); 43 : Platform::current()->currentThread()->getWebTaskRunner();
43 case TaskType::Unthrottled: 44 case TaskType::Unthrottled:
44 return frame ? frame->frameScheduler()->unthrottledTaskRunner() 45 return frame ? frame->frameScheduler()->unthrottledTaskRunner()
45 : Platform::current()->currentThread()->getWebTaskRunner(); 46 : Platform::current()->currentThread()->getWebTaskRunner();
46 } 47 }
(...skipping 10 matching lines...) Expand all
57 return get(type, executionContext && executionContext->isDocument() 58 return get(type, executionContext && executionContext->isDocument()
58 ? static_cast<Document*>(executionContext) 59 ? static_cast<Document*>(executionContext)
59 : nullptr); 60 : nullptr);
60 } 61 }
61 62
62 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) { 63 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) {
63 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); 64 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr);
64 } 65 }
65 66
66 } // namespace blink 67 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698