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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp

Issue 2692863013: Assert that |resource| is always non-null in requestPendingScript() (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
index ec9bf4e0b0aeeb1b11ffec9f2810ff442bf01a7b..88afa39d916a2a36115136ef176f2b1000c90df6 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
@@ -580,13 +580,11 @@ void HTMLParserScriptRunner::requestDeferredScript(Element* element) {
PendingScript* HTMLParserScriptRunner::requestPendingScript(
Element* element) const {
- // This should correctly return 0 for empty or invalid srcValues.
ScriptResource* resource = toScriptLoaderIfPossible(element)->resource();
- if (!resource) {
- DVLOG(1) << "Not implemented."; // Dispatch error event.
- return nullptr;
- }
-
+ // Here |resource| should be non-null. If it were nullptr,
+ // ScriptLoader::fetchScript() should have returned false and
+ // thus the control shouldn't have reached here.
+ CHECK(resource);
return PendingScript::create(element, resource);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698