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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp

Issue 2803843002: Change Modulator functions to use ScriptState instead of LocalFrame (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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp » ('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 "bindings/core/v8/ScriptModule.h" 5 #include "bindings/core/v8/ScriptModule.h"
6 6
7 #include "bindings/core/v8/V8Binding.h" 7 #include "bindings/core/v8/V8Binding.h"
8 #include "core/dom/Modulator.h" 8 #include "core/dom/Modulator.h"
9 #include "core/dom/ScriptModuleResolver.h" 9 #include "core/dom/ScriptModuleResolver.h"
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ret.push_back(toCoreString(v8Name)); 82 ret.push_back(toCoreString(v8Name));
83 } 83 }
84 return ret; 84 return ret;
85 } 85 }
86 86
87 v8::MaybeLocal<v8::Module> ScriptModule::resolveModuleCallback( 87 v8::MaybeLocal<v8::Module> ScriptModule::resolveModuleCallback(
88 v8::Local<v8::Context> context, 88 v8::Local<v8::Context> context,
89 v8::Local<v8::String> specifier, 89 v8::Local<v8::String> specifier,
90 v8::Local<v8::Module> referrer) { 90 v8::Local<v8::Module> referrer) {
91 v8::Isolate* isolate = context->GetIsolate(); 91 v8::Isolate* isolate = context->GetIsolate();
92 Modulator* modulator = Modulator::from(V8PerContextData::from(context)); 92 Modulator* modulator = Modulator::from(ScriptState::from(context));
93 DCHECK(modulator); 93 DCHECK(modulator);
94 94
95 ScriptModule referrerRecord(isolate, referrer); 95 ScriptModule referrerRecord(isolate, referrer);
96 ExceptionState exceptionState(isolate, ExceptionState::ExecutionContext, 96 ExceptionState exceptionState(isolate, ExceptionState::ExecutionContext,
97 "ScriptModule", "resolveModuleCallback"); 97 "ScriptModule", "resolveModuleCallback");
98 ScriptModule resolved = modulator->scriptModuleResolver()->resolve( 98 ScriptModule resolved = modulator->scriptModuleResolver()->resolve(
99 toCoreStringWithNullCheck(specifier), referrerRecord, exceptionState); 99 toCoreStringWithNullCheck(specifier), referrerRecord, exceptionState);
100 if (resolved.isNull()) { 100 if (resolved.isNull()) {
101 DCHECK(exceptionState.hadException()); 101 DCHECK(exceptionState.hadException());
102 return v8::MaybeLocal<v8::Module>(); 102 return v8::MaybeLocal<v8::Module>();
103 } 103 }
104 104
105 DCHECK(!exceptionState.hadException()); 105 DCHECK(!exceptionState.hadException());
106 return v8::MaybeLocal<v8::Module>(resolved.m_module->newLocal(isolate)); 106 return v8::MaybeLocal<v8::Module>(resolved.m_module->newLocal(isolate));
107 } 107 }
108 108
109 } // namespace blink 109 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698