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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2165653004: Don't wait for AppCache for link rel preloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dont parse / do more initialization than necessary for media link preload headers Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 break; 201 break;
202 default: 202 default:
203 ASSERT_NOT_REACHED(); 203 ASSERT_NOT_REACHED();
204 } 204 }
205 205
206 if (resource) 206 if (resource)
207 fetcher()->preloadStarted(resource); 207 fetcher()->preloadStarted(resource);
208 return resource; 208 return resource;
209 } 209 }
210 210
211 void DocumentLoader::dispatchLinkHeaderPreloads(ViewportDescriptionWrapper* view port, LinkLoader::MediaPreloadPolicy mediaPolicy)
212 {
213 String linkHeader = response().httpHeaderField(HTTPNames::Link);
214 if (!linkHeader.isEmpty()) {
Yoav Weiss 2016/07/22 16:03:46 Why is this wrapper needed? There's already an emp
Charlie Harrison 2016/07/22 16:54:24 Ah good catch. Removed. I still kept this helper f
215 LinkLoader::loadLinksFromHeader(linkHeader, response().url(),
216 m_frame->document(), NetworkHintsInterfaceImpl(), LinkLoader::OnlyLo adResources, mediaPolicy, viewport);
217 }
218 }
219
211 void DocumentLoader::didChangePerformanceTiming() 220 void DocumentLoader::didChangePerformanceTiming()
212 { 221 {
213 if (frame() && frame()->isMainFrame() && m_state >= Committed) { 222 if (frame() && frame()->isMainFrame() && m_state >= Committed) {
214 frameLoader()->client()->didChangePerformanceTiming(); 223 frameLoader()->client()->didChangePerformanceTiming();
215 } 224 }
216 } 225 }
217 226
218 void DocumentLoader::didObserveLoadingBehavior(WebLoadingBehaviorFlag behavior) 227 void DocumentLoader::didObserveLoadingBehavior(WebLoadingBehaviorFlag behavior)
219 { 228 {
220 if (frame() && frame()->isMainFrame()) { 229 if (frame() && frame()->isMainFrame()) {
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 { 714 {
706 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 715 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
707 if (!source.isNull()) 716 if (!source.isNull())
708 m_writer->appendReplacingData(source); 717 m_writer->appendReplacingData(source);
709 endWriting(m_writer.get()); 718 endWriting(m_writer.get());
710 } 719 }
711 720
712 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 721 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
713 722
714 } // namespace blink 723 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | third_party/WebKit/Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698