Index: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
index 928aa32bd8fc3466efe8b913ac438d55699d3814..bfa3ab79e3db1607826354390a0561b4cab164b8 100644 |
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
@@ -49,6 +49,8 @@ |
#include "core/page/ChromeClient.h" |
#include "core/page/Page.h" |
#include "platform/SharedBuffer.h" |
+#include "platform/WebFrameScheduler.h" |
+#include "platform/network/NetworkLog.h" |
#include "platform/network/ResourceRequest.h" |
#include "platform/weborigin/SchemeRegistry.h" |
#include "platform/weborigin/SecurityOrigin.h" |
@@ -696,6 +698,8 @@ void DocumentThreadableLoader::responseReceived( |
void DocumentThreadableLoader::handlePreflightResponse( |
const ResourceResponse& response) { |
+ NETWORK_DVLOG(1) << this << " handlePreflightResponse()"; |
+ |
String accessControlErrorDescription; |
if (!passesAccessControlCheck( |
@@ -705,12 +709,14 @@ void DocumentThreadableLoader::handlePreflightResponse( |
response.url().getString(), |
"Response to preflight request doesn't pass access control check: " + |
accessControlErrorDescription); |
+ NETWORK_DVLOG(1) << this << " 2()"; |
return; |
} |
if (!passesPreflightStatusCheck(response, accessControlErrorDescription)) { |
handlePreflightFailure(response.url().getString(), |
accessControlErrorDescription); |
+ NETWORK_DVLOG(1) << this << " 1()"; |
return; |
} |
@@ -718,6 +724,7 @@ void DocumentThreadableLoader::handlePreflightResponse( |
!passesExternalPreflightCheck(response, accessControlErrorDescription)) { |
handlePreflightFailure(response.url().getString(), |
accessControlErrorDescription); |
+ NETWORK_DVLOG(1) << this << " 3()"; |
return; |
} |
@@ -731,6 +738,8 @@ void DocumentThreadableLoader::handlePreflightResponse( |
m_actualRequest.httpHeaderFields(), accessControlErrorDescription)) { |
handlePreflightFailure(response.url().getString(), |
accessControlErrorDescription); |
+ NETWORK_DVLOG(1) << this << " 4() " |
+ << accessControlErrorDescription.utf8().data(); |
return; |
} |
@@ -993,14 +1002,21 @@ void DocumentThreadableLoader::loadRequestAsync( |
return; |
} |
- if (resource()->isLoading()) { |
- unsigned long identifier = resource()->identifier(); |
- InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient( |
- m_document, identifier, m_client); |
- } else { |
+ if (!resource()->isLoading()) { |
InspectorInstrumentation:: |
documentThreadableLoaderFailedToStartLoadingForClient(m_document, |
m_client); |
+ return; |
+ } |
+ |
+ unsigned long identifier = resource()->identifier(); |
+ InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient( |
+ m_document, identifier, m_client); |
+ |
+ if (m_options.schedulerWaitingPolicy == PreventSchedulerFromWaiting) { |
+ LocalFrame* frame = document().frame(); |
+ if (frame && frame->frameScheduler()) |
+ frame->frameScheduler()->didStopLoading(identifier); |
} |
} |