| Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| index f040553594f41cd97ae0e4d1ae27be96348e4b53..1c959a95eba230fd6a69988527f5b1223f6fde9a 100644
|
| --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| @@ -56,6 +56,7 @@
|
| #include "core/loader/PingLoader.h"
|
| #include "core/loader/ProgressTracker.h"
|
| #include "core/loader/appcache/ApplicationCacheHost.h"
|
| +#include "core/page/NetworkStateNotifier.h"
|
| #include "core/page/Page.h"
|
| #include "core/svg/graphics/SVGImageChromeClient.h"
|
| #include "core/timing/DOMWindowPerformance.h"
|
| @@ -173,7 +174,7 @@ static ResourceRequestCachePolicy memoryCachePolicyToResourceRequestCachePolicy(
|
| return UseProtocolCachePolicy;
|
| }
|
|
|
| -ResourceRequestCachePolicy FrameFetchContext::resourceRequestCachePolicy(const ResourceRequest& request, Resource::Type type) const
|
| +ResourceRequestCachePolicy FrameFetchContext::resourceRequestCachePolicy(const ResourceRequest& request, Resource::Type type, FetchRequest::DeferOption defer) const
|
| {
|
| ASSERT(frame());
|
| if (type == Resource::MainResource) {
|
| @@ -208,10 +209,14 @@ ResourceRequestCachePolicy FrameFetchContext::resourceRequestCachePolicy(const R
|
| // future, we'll extend this logic to only block if estimated network RTT
|
| // is above some threshold.
|
| if (type == Resource::Script && isMainFrame()) {
|
| - const bool isInDocumentWrite = m_document && m_document->isInDocumentWrite();
|
| const bool disallowFetchForDocWriteScripts = frame()->settings() && frame()->settings()->disallowFetchForDocWrittenScriptsInMainFrame();
|
| - if (isInDocumentWrite && disallowFetchForDocWriteScripts)
|
| - return ReturnCacheDataDontLoad;
|
| + const bool isInDocumentWrite = m_document && m_document->isInDocumentWrite();
|
| + if (isInDocumentWrite && disallowFetchForDocWriteScripts) {
|
| + const bool isSync = (defer == FetchRequest::NoDefer);
|
| + const bool isThirdParty = (request.url().host() != m_document->getSecurityOrigin()->domain());
|
| + if (isSync && isThirdParty)
|
| + return ReturnCacheDataDontLoad;
|
| + }
|
| }
|
|
|
| if (request.isConditional())
|
|
|