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

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

Issue 2823483002: Make ModuleScript to have a reference to Modulator explicitly (Closed)
Patch Set: unit tests fix 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/ModuleScript.h" 5 #include "core/dom/ModuleScript.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 void ModuleScript::SetInstantiationError(v8::Isolate* isolate, 9 void ModuleScript::SetInstantiationError(v8::Isolate* isolate,
10 v8::Local<v8::Value> error) { 10 v8::Local<v8::Value> error) {
11 DCHECK_EQ(instantiation_state_, ModuleInstantiationState::kUninstantiated); 11 DCHECK_EQ(instantiation_state_, ModuleInstantiationState::kUninstantiated);
12 instantiation_state_ = ModuleInstantiationState::kErrored; 12 instantiation_state_ = ModuleInstantiationState::kErrored;
13 13
14 DCHECK(!error.IsEmpty()); 14 DCHECK(!error.IsEmpty());
15 instantiation_error_.Set(isolate, error); 15 instantiation_error_.Set(isolate, error);
16 } 16 }
17 17
18 void ModuleScript::SetInstantiationSuccess() { 18 void ModuleScript::SetInstantiationSuccess() {
19 DCHECK_EQ(instantiation_state_, ModuleInstantiationState::kUninstantiated); 19 DCHECK_EQ(instantiation_state_, ModuleInstantiationState::kUninstantiated);
20 instantiation_state_ = ModuleInstantiationState::kInstantiated; 20 instantiation_state_ = ModuleInstantiationState::kInstantiated;
21 } 21 }
22 22
23 DEFINE_TRACE(ModuleScript) { 23 DEFINE_TRACE(ModuleScript) {
24 visitor->Trace(settings_object_);
24 Script::Trace(visitor); 25 Script::Trace(visitor);
25 } 26 }
26 DEFINE_TRACE_WRAPPERS(ModuleScript) { 27 DEFINE_TRACE_WRAPPERS(ModuleScript) {
27 visitor->TraceWrappers(instantiation_error_); 28 visitor->TraceWrappers(instantiation_error_);
28 } 29 }
29 30
30 bool ModuleScript::IsEmpty() const { 31 bool ModuleScript::IsEmpty() const {
31 return false; 32 return false;
32 } 33 }
33 34
(...skipping 10 matching lines...) Expand all
44 } 45 }
45 46
46 String ModuleScript::InlineSourceTextForCSP() const { 47 String ModuleScript::InlineSourceTextForCSP() const {
47 // Currently we don't support inline module scripts. 48 // Currently we don't support inline module scripts.
48 // TODO(hiroshige): Implement this. 49 // TODO(hiroshige): Implement this.
49 NOTREACHED(); 50 NOTREACHED();
50 return String(); 51 return String();
51 } 52 }
52 53
53 } // namespace blink 54 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModuleScript.h ('k') | third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698