summaryrefslogtreecommitdiffstats
path: root/content/browser/loader/resource_scheduler.h
diff options
context:
space:
mode:
authorsimonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 21:59:47 +0000
committersimonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-31 21:59:47 +0000
commit0685520661350c7355d1f9c0790463650d631309 (patch)
tree7834ee37eb5d2f787b68df00f3c0c4ffacb9762e /content/browser/loader/resource_scheduler.h
parent26a801fb5d2739bb45ba03e5c9a57a56d6961382 (diff)
downloadchromium_src-0685520661350c7355d1f9c0790463650d631309.zip
chromium_src-0685520661350c7355d1f9c0790463650d631309.tar.gz
chromium_src-0685520661350c7355d1f9c0790463650d631309.tar.bz2
This CL adds an intra-priority level sorting value for finer grained control of resource loading. The blink side of this patch sorts visible images by estimated on screen real-estate, preferring to download images with more visual impact first. Ie. On a page with a large banner, and dozens of small icons, the large banner will most likely be scheduled ahead of the others.
In the future, we can also use this to experiment with other signals, ie. prioritize by distance to viewport. This needs https://codereview.chromium.org/153983004/ to land first. In our tests, this was a nice win on speed-index for desktop, with a gain of about ~2-3%. BUG= Review URL: https://codereview.chromium.org/146333004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/loader/resource_scheduler.h')
-rw-r--r--content/browser/loader/resource_scheduler.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/content/browser/loader/resource_scheduler.h b/content/browser/loader/resource_scheduler.h
index b374b6c..cd8f054 100644
--- a/content/browser/loader/resource_scheduler.h
+++ b/content/browser/loader/resource_scheduler.h
@@ -87,6 +87,11 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe {
private:
class RequestQueue;
class ScheduledResourceRequest;
+ struct RequestPriorityParams;
+ struct ScheduledResourceSorter {
+ bool operator()(const ScheduledResourceRequest* a,
+ const ScheduledResourceRequest* b) const;
+ };
struct Client;
typedef int64 ClientId;
@@ -106,7 +111,8 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe {
// reprioritized, it will move to the end of the queue for that priority
// level.
void ReprioritizeRequest(ScheduledResourceRequest* request,
- net::RequestPriority new_priority);
+ net::RequestPriority new_priority,
+ int intra_priority_value);
// Attempts to load any pending requests in |client|, based on the
// results of ShouldStartRequest().