| 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 b7ffc14fe49f45a40f6278f6b44bea0e0dc5ddd4..77cc040f3400f0f5af8bc9f49e42ae0b41fe73e9 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/V8Binding.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"
|
| @@ -593,7 +592,7 @@ bool ScriptLoader::FetchScript(const String& source_url,
|
|
|
| PendingScript* ScriptLoader::CreatePendingScript() {
|
| CHECK(resource_);
|
| - return PendingScript::Create(element_, resource_);
|
| + return ClassicPendingScript::Create(element_, resource_);
|
| }
|
|
|
| bool ScriptLoader::ExecuteScript(const Script* script) {
|
| @@ -699,13 +698,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
|
| @@ -717,7 +717,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
|
| @@ -725,7 +724,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;
|
| }
|
|
|