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

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp

Issue 2939773005: [POC] Implement "module responses map" concept (Closed)
Patch Set: rebase Created 3 years, 5 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 "modules/csspaint/PaintWorkletGlobalScopeProxy.h" 5 #include "modules/csspaint/PaintWorkletGlobalScopeProxy.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/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 13 matching lines...) Expand all
24 DCHECK(IsMainThread()); 24 DCHECK(IsMainThread());
25 Document* document = frame->GetDocument(); 25 Document* document = frame->GetDocument();
26 global_scope_ = PaintWorkletGlobalScope::Create( 26 global_scope_ = PaintWorkletGlobalScope::Create(
27 frame, document->Url(), document->UserAgent(), 27 frame, document->Url(), document->UserAgent(),
28 document->GetSecurityOrigin(), ToIsolate(document), 28 document->GetSecurityOrigin(), ToIsolate(document),
29 pending_generator_registry); 29 pending_generator_registry);
30 } 30 }
31 31
32 void PaintWorkletGlobalScopeProxy::FetchAndInvokeScript( 32 void PaintWorkletGlobalScopeProxy::FetchAndInvokeScript(
33 const KURL& module_url_record, 33 const KURL& module_url_record,
34 WorkletModuleResponsesMap* module_responses_map,
34 WebURLRequest::FetchCredentialsMode credentials_mode, 35 WebURLRequest::FetchCredentialsMode credentials_mode,
35 RefPtr<WebTaskRunner> outside_settings_task_runner, 36 RefPtr<WebTaskRunner> outside_settings_task_runner,
36 WorkletPendingTasks* pending_tasks) { 37 WorkletPendingTasks* pending_tasks) {
37 DCHECK(IsMainThread()); 38 DCHECK(IsMainThread());
38 global_scope_->FetchAndInvokeScript(module_url_record, credentials_mode, 39 global_scope_->FetchAndInvokeScript(
39 std::move(outside_settings_task_runner), 40 module_url_record, module_responses_map, credentials_mode,
40 pending_tasks); 41 std::move(outside_settings_task_runner), pending_tasks);
41 } 42 }
42 43
43 void PaintWorkletGlobalScopeProxy::WorkletObjectDestroyed() { 44 void PaintWorkletGlobalScopeProxy::WorkletObjectDestroyed() {
44 DCHECK(IsMainThread()); 45 DCHECK(IsMainThread());
45 // Do nothing. 46 // Do nothing.
46 } 47 }
47 48
48 void PaintWorkletGlobalScopeProxy::TerminateWorkletGlobalScope() { 49 void PaintWorkletGlobalScopeProxy::TerminateWorkletGlobalScope() {
49 DCHECK(IsMainThread()); 50 DCHECK(IsMainThread());
50 global_scope_->Terminate(); 51 global_scope_->Terminate();
51 // Nullify the global scope to cut a potential reference cycle. 52 // Nullify the global scope to cut a potential reference cycle.
52 global_scope_ = nullptr; 53 global_scope_ = nullptr;
53 } 54 }
54 55
55 CSSPaintDefinition* PaintWorkletGlobalScopeProxy::FindDefinition( 56 CSSPaintDefinition* PaintWorkletGlobalScopeProxy::FindDefinition(
56 const String& name) { 57 const String& name) {
57 DCHECK(IsMainThread()); 58 DCHECK(IsMainThread());
58 return global_scope_->FindDefinition(name); 59 return global_scope_->FindDefinition(name);
59 } 60 }
60 61
61 DEFINE_TRACE(PaintWorkletGlobalScopeProxy) { 62 DEFINE_TRACE(PaintWorkletGlobalScopeProxy) {
62 visitor->Trace(global_scope_); 63 visitor->Trace(global_scope_);
63 } 64 }
64 65
65 } // namespace blink 66 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698