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

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

Issue 2865003002: Make ModulatorImpl execution-context-agnostic (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ModulatorImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dom/Modulator.h" 5 #include "core/dom/Modulator.h"
6 6
7 #include "bindings/core/v8/V8BindingForCore.h" 7 #include "bindings/core/v8/V8BindingForCore.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ModulatorImpl.h" 9 #include "core/dom/ModulatorImpl.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 11 matching lines...) Expand all
22 return nullptr; 22 return nullptr;
23 23
24 V8PerContextData* per_context_data = script_state->PerContextData(); 24 V8PerContextData* per_context_data = script_state->PerContextData();
25 if (!per_context_data) 25 if (!per_context_data)
26 return nullptr; 26 return nullptr;
27 27
28 Modulator* modulator = 28 Modulator* modulator =
29 static_cast<Modulator*>(per_context_data->GetData(kPerContextDataKey)); 29 static_cast<Modulator*>(per_context_data->GetData(kPerContextDataKey));
30 if (!modulator) { 30 if (!modulator) {
31 if (Document* document = ToDocument(ExecutionContext::From(script_state))) { 31 if (Document* document = ToDocument(ExecutionContext::From(script_state))) {
32 modulator = ModulatorImpl::Create(script_state, *document); 32 modulator = ModulatorImpl::Create(script_state, document->Fetcher());
33 Modulator::SetModulator(script_state, modulator); 33 Modulator::SetModulator(script_state, modulator);
34 } 34 }
35 } 35 }
36 return modulator; 36 return modulator;
37 } 37 }
38 38
39 Modulator::~Modulator() {} 39 Modulator::~Modulator() {}
40 40
41 void Modulator::SetModulator(ScriptState* script_state, Modulator* modulator) { 41 void Modulator::SetModulator(ScriptState* script_state, Modulator* modulator) {
42 DCHECK(script_state); 42 DCHECK(script_state);
(...skipping 29 matching lines...) Expand all
72 // script's base URL as the base URL. 72 // script's base URL as the base URL.
73 DCHECK(base_url.IsValid()); 73 DCHECK(base_url.IsValid());
74 KURL absolute_url(base_url, module_request); 74 KURL absolute_url(base_url, module_request);
75 if (absolute_url.IsValid()) 75 if (absolute_url.IsValid())
76 return absolute_url; 76 return absolute_url;
77 77
78 return KURL(); 78 return KURL();
79 } 79 }
80 80
81 } // namespace blink 81 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ModulatorImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698