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

Side by Side Diff: Source/core/loader/LinkLoader.cpp

Issue 1195023002: Add a Setting to make iframes load at VeryLow priority, disabled by default. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Assume ApplyFromString(), call isLowPriorityIframe() from loadPriority() Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource , WarningMessageLevel, String("<link rel=preload> has an invalid `href` value")) ); 171 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource , WarningMessageLevel, String("<link rel=preload> has an invalid `href` value")) );
172 return; 172 return;
173 } 173 }
174 // TODO(yoav): Figure out a way that 'as' would be used to set request h eaders. 174 // TODO(yoav): Figure out a way that 'as' would be used to set request h eaders.
175 Resource::Type priorityType; 175 Resource::Type priorityType;
176 if (!getPriorityTypeFromAsAttribute(as, priorityType)) { 176 if (!getPriorityTypeFromAsAttribute(as, priorityType)) {
177 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource , WarningMessageLevel, String("<link rel=preload> must have a valid `as` value") )); 177 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource , WarningMessageLevel, String("<link rel=preload> must have a valid `as` value") ));
178 return; 178 return;
179 } 179 }
180 FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), Fe tchInitiatorTypeNames::link); 180 FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), Fe tchInitiatorTypeNames::link);
181 linkRequest.setPriority(ResourceFetcher::loadPriority(priorityType, link Request)); 181 linkRequest.setPriority(document.fetcher()->loadPriority(priorityType, l inkRequest));
182 Settings* settings = document.settings(); 182 Settings* settings = document.settings();
183 if (settings && settings->logPreload()) 183 if (settings && settings->logPreload())
184 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource , DebugMessageLevel, String("Preload triggered for " + href.host() + href.path() ))); 184 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource , DebugMessageLevel, String("Preload triggered for " + href.host() + href.path() )));
185 setResource(LinkFetchResource::fetch(Resource::LinkPreload, linkRequest, document.fetcher())); 185 setResource(LinkFetchResource::fetch(Resource::LinkPreload, linkRequest, document.fetcher()));
186 } 186 }
187 } 187 }
188 188
189 bool LinkLoader::loadLinkFromHeader(const String& headerValue, Document* documen t) 189 bool LinkLoader::loadLinkFromHeader(const String& headerValue, Document* documen t)
190 { 190 {
191 if (!document) 191 if (!document)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 m_prerender.clear(); 255 m_prerender.clear();
256 } 256 }
257 } 257 }
258 258
259 DEFINE_TRACE(LinkLoader) 259 DEFINE_TRACE(LinkLoader)
260 { 260 {
261 visitor->trace(m_prerender); 261 visitor->trace(m_prerender);
262 } 262 }
263 263
264 } 264 }
OLDNEW
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698