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

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

Issue 2796653003: Move ScriptState::forWorld/ScriptState::forMainWorld (Part 2) (Closed)
Patch Set: Rebase 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/dom/Modulator.h" 5 #include "core/dom/Modulator.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "bindings/core/v8/V8Binding.h"
8 9
9 namespace blink { 10 namespace blink {
10 11
11 Modulator* Modulator::from(LocalFrame* frame) { 12 Modulator* Modulator::from(LocalFrame* frame) {
12 ScriptState* scriptState = ScriptState::forMainWorld(frame); 13 ScriptState* scriptState = toScriptStateForMainWorld(frame);
13 if (!scriptState) 14 if (!scriptState)
14 return nullptr; 15 return nullptr;
15 // TODO(kouhei): setModulator in V8PerContextData when we land ModulatorImpl. 16 // TODO(kouhei): setModulator in V8PerContextData when we land ModulatorImpl.
16 return scriptState->perContextData()->modulator(); 17 return scriptState->perContextData()->modulator();
17 } 18 }
18 19
19 Modulator::~Modulator() {} 20 Modulator::~Modulator() {}
20 21
21 KURL Modulator::resolveModuleSpecifier(const String& moduleRequest, 22 KURL Modulator::resolveModuleSpecifier(const String& moduleRequest,
22 const KURL& baseURL) { 23 const KURL& baseURL) {
(...skipping 15 matching lines...) Expand all
38 // script's base URL as the base URL. 39 // script's base URL as the base URL.
39 DCHECK(baseURL.isValid()); 40 DCHECK(baseURL.isValid());
40 KURL absoluteURL(baseURL, moduleRequest); 41 KURL absoluteURL(baseURL, moduleRequest);
41 if (absoluteURL.isValid()) 42 if (absoluteURL.isValid())
42 return absoluteURL; 43 return absoluteURL;
43 44
44 return KURL(); 45 return KURL();
45 } 46 }
46 47
47 } // namespace blink 48 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698