Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1343)

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 788923003: Adding Link header support for dns-prefetch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed useless dumpAsText from frames Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index efda9fdbfd8c93b84b631c500c4bc38699e290e3..d33bac71eb85605458a8be43043bf3d6a346b284 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -48,6 +48,7 @@
#include "core/inspector/InspectorInstrumentation.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
+#include "core/loader/LinkLoader.h"
#include "core/loader/UniqueIdentifier.h"
#include "core/loader/appcache/ApplicationCacheHost.h"
#include "core/page/FrameTree.h"
@@ -409,6 +410,7 @@ void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse
ASSERT_UNUSED(resource, m_mainResource == resource);
ASSERT_UNUSED(handle, !handle);
RefPtr<DocumentLoader> protect(this);
+ ASSERT(frame());
m_applicationCacheHost->didReceiveResponseForMainResource(response);
@@ -441,6 +443,9 @@ void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse
return;
}
+ if (resource && resource->type() == Resource::MainResource)
+ LinkLoader::loadLinkFromHeader(response.httpHeaderField("Link"), frame()->document());
+
ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading());
m_response = response;
« no previous file with comments | « LayoutTests/http/tests/linkHeader/resources/link-dnsprefetch-frame.php ('k') | Source/core/loader/LinkLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698