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

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

Issue 2868413005: Worklet: Introduce WorkletOptions for addModule() (Closed)
Patch Set: add TODO comments Created 3 years, 7 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/V8BindingForCore.h" 8 #include "bindings/core/v8/V8BindingForCore.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) 18 ThreadedWorklet::ThreadedWorklet(LocalFrame* frame)
19 : Worklet(frame), frame_(frame) {} 19 : Worklet(frame), frame_(frame) {}
20 20
21 void ThreadedWorklet::FetchAndInvokeScript(const KURL& module_url_record, 21 void ThreadedWorklet::FetchAndInvokeScript(const KURL& module_url_record,
22 const WorkletOptions&,
22 ScriptPromiseResolver* resolver) { 23 ScriptPromiseResolver* resolver) {
23 DCHECK(IsMainThread()); 24 DCHECK(IsMainThread());
24 if (!GetExecutionContext()) 25 if (!GetExecutionContext())
25 return; 26 return;
26 27
27 if (!IsInitialized()) 28 if (!IsInitialized())
28 Initialize(); 29 Initialize();
29 30
30 WorkletScriptLoader* script_loader = 31 WorkletScriptLoader* script_loader =
31 WorkletScriptLoader::Create(frame_->GetDocument()->Fetcher(), this); 32 WorkletScriptLoader::Create(frame_->GetDocument()->Fetcher(), this);
(...skipping 27 matching lines...) Expand all
59 frame_ = nullptr; 60 frame_ = nullptr;
60 } 61 }
61 62
62 DEFINE_TRACE(ThreadedWorklet) { 63 DEFINE_TRACE(ThreadedWorklet) {
63 visitor->Trace(frame_); 64 visitor->Trace(frame_);
64 visitor->Trace(loader_to_resolver_map_); 65 visitor->Trace(loader_to_resolver_map_);
65 Worklet::Trace(visitor); 66 Worklet::Trace(visitor);
66 } 67 }
67 68
68 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698