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 59a785d26076b83b3a40b3a0fa379acbf84017d2..d981525093f2c5f69628c219a0d8d2cf9957d138 100644 |
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp |
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp |
@@ -180,8 +180,7 @@ LocalFrame* FrameFetchContext::frame() const |
void FrameFetchContext::addAdditionalRequestHeaders(ResourceRequest& request, FetchResourceType type) |
{ |
- bool isMainResource = type == FetchMainResource; |
- if (!isMainResource) { |
+ if (type != FetchMainResource) { |
RefPtr<SecurityOrigin> outgoingOrigin; |
if (!request.didSetHTTPReferrer()) { |
ASSERT(m_document); |
@@ -208,7 +207,7 @@ void FrameFetchContext::addAdditionalRequestHeaders(ResourceRequest& request, Fe |
if (frame()->settings() && frame()->settings()->dataSaverEnabled()) |
request.setHTTPHeaderField("Save-Data", "on"); |
- frame()->loader().applyUserAgent(request); |
+ request.setDefaultHTTPUserAgent(AtomicString(frame()->loader().userAgent())); |
} |
CachePolicy FrameFetchContext::getCachePolicy() const |
@@ -322,7 +321,7 @@ void FrameFetchContext::dispatchDidChangeResourcePriority(unsigned long identifi |
void FrameFetchContext::prepareRequest(unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) |
{ |
- frame()->loader().applyUserAgent(request); |
+ request.setDefaultHTTPUserAgent(AtomicString(frame()->loader().userAgent())); |
frame()->loader().client()->dispatchWillSendRequest(m_documentLoader, identifier, request, redirectResponse); |
} |