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

Side by Side Diff: third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp

Issue 2826983002: Rename Worklet.import() to Worklet.addModule(). (Closed)
Patch Set: Fixing Layout Tests Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/workers/ThreadedWorklet.h" 5 #include "core/workers/ThreadedWorklet.h"
6 6
7 #include "bindings/core/v8/ScriptSourceCode.h" 7 #include "bindings/core/v8/ScriptSourceCode.h"
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
11 #include "core/dom/ExceptionCode.h" 11 #include "core/dom/ExceptionCode.h"
12 #include "core/frame/LocalFrame.h" 12 #include "core/frame/LocalFrame.h"
13 #include "core/workers/WorkletGlobalScopeProxy.h" 13 #include "core/workers/WorkletGlobalScopeProxy.h"
14 #include "platform/wtf/WTF.h" 14 #include "platform/wtf/WTF.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 ThreadedWorklet::ThreadedWorklet(LocalFrame* frame) : Worklet(frame) {} 18 ThreadedWorklet::ThreadedWorklet(LocalFrame* frame) : Worklet(frame) {}
19 19
20 ScriptPromise ThreadedWorklet::import(ScriptState* script_state, 20 ScriptPromise ThreadedWorklet::addModule(ScriptState* script_state,
21 const String& url) { 21 const String& url) {
22 DCHECK(IsMainThread()); 22 DCHECK(IsMainThread());
23 if (!GetExecutionContext()) { 23 if (!GetExecutionContext()) {
24 return ScriptPromise::RejectWithDOMException( 24 return ScriptPromise::RejectWithDOMException(
25 script_state, DOMException::Create(kInvalidStateError, 25 script_state, DOMException::Create(kInvalidStateError,
26 "This frame is already detached")); 26 "This frame is already detached"));
27 } 27 }
28 28
29 KURL script_url = GetExecutionContext()->CompleteURL(url); 29 KURL script_url = GetExecutionContext()->CompleteURL(url);
30 if (!script_url.IsValid()) { 30 if (!script_url.IsValid()) {
31 return ScriptPromise::RejectWithDOMException( 31 return ScriptPromise::RejectWithDOMException(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 loader_to_resolver_map_.Clear(); 69 loader_to_resolver_map_.Clear();
70 Worklet::ContextDestroyed(execution_context); 70 Worklet::ContextDestroyed(execution_context);
71 } 71 }
72 72
73 DEFINE_TRACE(ThreadedWorklet) { 73 DEFINE_TRACE(ThreadedWorklet) {
74 visitor->Trace(loader_to_resolver_map_); 74 visitor->Trace(loader_to_resolver_map_);
75 Worklet::Trace(visitor); 75 Worklet::Trace(visitor);
76 } 76 }
77 77
78 } // namespace blink 78 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/workers/ThreadedWorklet.h ('k') | third_party/WebKit/Source/core/workers/Worklet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698