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

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

Issue 2587733002: Specify TaskType of posted Task explicitly in Sensor API (11) (Closed)
Patch Set: 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 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 12 matching lines...) Expand all
23 case TaskType::MediaElementEvent: 23 case TaskType::MediaElementEvent:
24 case TaskType::CanvasBlobSerialization: 24 case TaskType::CanvasBlobSerialization:
25 case TaskType::RemoteEvent: 25 case TaskType::RemoteEvent:
26 case TaskType::WebSocket: 26 case TaskType::WebSocket:
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::Timer: 34 case TaskType::Timer:
34 case TaskType::Internal: 35 case TaskType::Internal:
35 case TaskType::Unspecified: 36 case TaskType::Unspecified:
36 return frame ? frame->frameScheduler()->timerTaskRunner() 37 return frame ? frame->frameScheduler()->timerTaskRunner()
37 : Platform::current()->currentThread()->getWebTaskRunner(); 38 : Platform::current()->currentThread()->getWebTaskRunner();
38 case TaskType::Networking: 39 case TaskType::Networking:
39 return frame ? frame->frameScheduler()->loadingTaskRunner() 40 return frame ? frame->frameScheduler()->loadingTaskRunner()
40 : Platform::current()->currentThread()->getWebTaskRunner(); 41 : Platform::current()->currentThread()->getWebTaskRunner();
41 case TaskType::Unthrottled: 42 case TaskType::Unthrottled:
42 return frame ? frame->frameScheduler()->unthrottledTaskRunner() 43 return frame ? frame->frameScheduler()->unthrottledTaskRunner()
(...skipping 12 matching lines...) Expand all
55 return get(type, executionContext && executionContext->isDocument() 56 return get(type, executionContext && executionContext->isDocument()
56 ? static_cast<Document*>(executionContext) 57 ? static_cast<Document*>(executionContext)
57 : nullptr); 58 : nullptr);
58 } 59 }
59 60
60 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) { 61 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) {
61 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); 62 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr);
62 } 63 }
63 64
64 } // namespace blink 65 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/TaskRunnerHelper.h ('k') | third_party/WebKit/Source/modules/sensor/Sensor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698