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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp

Issue 2676163002: Refactor the forPreload flag to mean speculative preload. (Closed)
Patch Set: Renamed ReportingPolicy and moved comments Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/parser/PreloadRequest.h" 5 #include "core/html/parser/PreloadRequest.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/loader/DocumentLoader.h" 8 #include "core/loader/DocumentLoader.h"
9 #include "platform/CrossOriginAttributeValue.h" 9 #include "platform/CrossOriginAttributeValue.h"
10 #include "platform/loader/fetch/FetchInitiatorInfo.h" 10 #include "platform/loader/fetch/FetchInitiatorInfo.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 if (m_requestType == RequestTypeLinkRelPreload) 68 if (m_requestType == RequestTypeLinkRelPreload)
69 request.setLinkPreload(true); 69 request.setLinkPreload(true);
70 70
71 if (m_resourceType == Resource::Script || 71 if (m_resourceType == Resource::Script ||
72 m_resourceType == Resource::CSSStyleSheet || 72 m_resourceType == Resource::CSSStyleSheet ||
73 m_resourceType == Resource::ImportResource) { 73 m_resourceType == Resource::ImportResource) {
74 request.setCharset( 74 request.setCharset(
75 m_charset.isEmpty() ? document->characterSet().getString() : m_charset); 75 m_charset.isEmpty() ? document->characterSet().getString() : m_charset);
76 } 76 }
77 request.setForPreload(true, m_discoveryTime); 77 request.setSpeculativePreload(true, m_discoveryTime);
78 78
79 return document->loader()->startPreload(m_resourceType, request); 79 return document->loader()->startPreload(m_resourceType, request);
80 } 80 }
81 81
82 } // namespace blink 82 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698