Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
index 0be80ebb13029805a8cd9740b8d353deecc12f48..d5488e2f2a3d5d4bd73f4c26e74164cae86ef6d9 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
@@ -26,9 +26,9 @@ |
#include "bindings/core/v8/ScriptController.h" |
#include "bindings/core/v8/ScriptSourceCode.h" |
-#include "bindings/core/v8/V8BindingForCore.h" |
#include "core/HTMLNames.h" |
#include "core/SVGNames.h" |
+#include "core/dom/ClassicPendingScript.h" |
#include "core/dom/ClassicScript.h" |
#include "core/dom/Document.h" |
#include "core/dom/DocumentParserTiming.h" |
@@ -48,7 +48,6 @@ |
#include "platform/WebFrameScheduler.h" |
#include "platform/loader/fetch/AccessControlStatus.h" |
#include "platform/loader/fetch/FetchParameters.h" |
-#include "platform/loader/fetch/MemoryCache.h" |
#include "platform/loader/fetch/ResourceFetcher.h" |
#include "platform/network/mime/MIMETypeRegistry.h" |
#include "platform/weborigin/SecurityOrigin.h" |
@@ -670,7 +669,7 @@ bool ScriptLoader::FetchClassicScript( |
PendingScript* ScriptLoader::CreatePendingScript() { |
CHECK(resource_); |
- return PendingScript::Create(element_, resource_); |
+ return ClassicPendingScript::Create(element_, resource_); |
} |
bool ScriptLoader::ExecuteScript(const Script* script) { |
@@ -776,13 +775,14 @@ bool ScriptLoader::DoExecuteScript(const Script* script) { |
void ScriptLoader::Execute() { |
DCHECK(!will_be_parser_executed_); |
DCHECK(async_exec_type_ != ScriptRunner::kNone); |
- DCHECK(pending_script_->GetResource()); |
+ DCHECK(pending_script_->IsExternal()); |
bool error_occurred = false; |
Script* script = pending_script_->GetSource(KURL(), error_occurred); |
+ const bool wasCanceled = pending_script_->WasCanceled(); |
DetachPendingScript(); |
if (error_occurred) { |
DispatchErrorEvent(); |
- } else if (!resource_->WasCanceled()) { |
+ } else if (!wasCanceled) { |
if (ExecuteScript(script)) |
DispatchLoadEvent(); |
else |
@@ -794,7 +794,6 @@ void ScriptLoader::Execute() { |
void ScriptLoader::PendingScriptFinished(PendingScript* pending_script) { |
DCHECK(!will_be_parser_executed_); |
DCHECK_EQ(pending_script_, pending_script); |
- DCHECK_EQ(pending_script->GetResource(), resource_); |
// We do not need this script in the memory cache. The primary goals of |
// sending this fetch request are to let the third party server know |
@@ -802,7 +801,8 @@ void ScriptLoader::PendingScriptFinished(PendingScript* pending_script) { |
// cache for subsequent uses. |
if (document_write_intervention_ == |
DocumentWriteIntervention::kFetchDocWrittenScriptDeferIdle) { |
- GetMemoryCache()->Remove(pending_script_->GetResource()); |
+ DCHECK_EQ(pending_script_->GetScriptType(), ScriptType::kClassic); |
+ pending_script_->RemoveFromMemoryCache(); |
pending_script_->StopWatchingForLoad(); |
return; |
} |