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

Side by Side Diff: Source/core/fetch/ResourceFetcher.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/fetch/ResourceFetcher.h ('k') | Source/core/frame/Settings.in » ('j') | 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 namespace blink { 57 namespace blink {
58 58
59 ResourceLoadPriority ResourceFetcher::loadPriority(Resource::Type type, const Fe tchRequest& request) 59 ResourceLoadPriority ResourceFetcher::loadPriority(Resource::Type type, const Fe tchRequest& request)
60 { 60 {
61 // TODO(yoav): Change it here so that priority can be changed even after it was resolved. 61 // TODO(yoav): Change it here so that priority can be changed even after it was resolved.
62 if (request.priority() != ResourceLoadPriorityUnresolved) 62 if (request.priority() != ResourceLoadPriorityUnresolved)
63 return request.priority(); 63 return request.priority();
64 64
65 switch (type) { 65 switch (type) {
66 case Resource::MainResource: 66 case Resource::MainResource:
67 return ResourceLoadPriorityVeryHigh; 67 return context().isLowPriorityIframe() ? ResourceLoadPriorityVeryLow : R esourceLoadPriorityVeryHigh;
68 case Resource::CSSStyleSheet: 68 case Resource::CSSStyleSheet:
69 return ResourceLoadPriorityHigh; 69 return ResourceLoadPriorityHigh;
70 case Resource::Raw: 70 case Resource::Raw:
71 return request.options().synchronousPolicy == RequestSynchronously ? Res ourceLoadPriorityVeryHigh : ResourceLoadPriorityMedium; 71 return request.options().synchronousPolicy == RequestSynchronously ? Res ourceLoadPriorityVeryHigh : ResourceLoadPriorityMedium;
72 case Resource::Script: 72 case Resource::Script:
73 // Async scripts do not block the parser so they get the lowest priority and can be 73 // Async scripts do not block the parser so they get the lowest priority and can be
74 // loaded in parser order with images. 74 // loaded in parser order with images.
75 if (FetchRequest::LazyLoad == request.defer()) 75 if (FetchRequest::LazyLoad == request.defer())
76 return ResourceLoadPriorityLow; 76 return ResourceLoadPriorityLow;
77 return ResourceLoadPriorityMedium; 77 return ResourceLoadPriorityMedium;
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 1052
1053 DEFINE_TRACE(ResourceFetcher) 1053 DEFINE_TRACE(ResourceFetcher)
1054 { 1054 {
1055 visitor->trace(m_context); 1055 visitor->trace(m_context);
1056 visitor->trace(m_archiveResourceCollection); 1056 visitor->trace(m_archiveResourceCollection);
1057 visitor->trace(m_loaders); 1057 visitor->trace(m_loaders);
1058 visitor->trace(m_nonBlockingLoaders); 1058 visitor->trace(m_nonBlockingLoaders);
1059 } 1059 }
1060 1060
1061 } 1061 }
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.h ('k') | Source/core/frame/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698