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

Unified Diff: Source/core/fetch/Resource.cpp

Issue 1304063016: Refactor the API for setting dynamic resource load priorities (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fetch/Resource.h ('k') | Source/core/fetch/ResourceClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/Resource.cpp
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index 7d8efd2fd1dfa91faf023202a6058f445deac03c..5224595219fc6f5262e05d2beaee958390e0d10d 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -954,6 +954,20 @@ void Resource::didChangePriority(ResourceLoadPriority loadPriority, int intraPri
m_loader->didChangePriority(loadPriority, intraPriorityValue);
}
+ResourcePriority Resource::priorityFromClients()
+{
+ ResourcePriority priority;
+ ResourceClientWalker<ResourceClient> w(m_clients);
+ while (ResourceClient* c = w.next()) {
+ ResourcePriority nextPriority = c->updatePriority(this);
+ if (nextPriority.visibility == ResourcePriority::NotVisible)
+ continue;
+ priority.visibility = ResourcePriority::Visible;
+ priority.intraPriorityValue += nextPriority.intraPriorityValue;
+ }
+ return priority;
+}
+
Resource::ResourceCallback* Resource::ResourceCallback::callbackHandler()
{
DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ResourceCallback>, callbackHandler, (adoptPtrWillBeNoop(new ResourceCallback)));
« no previous file with comments | « Source/core/fetch/Resource.h ('k') | Source/core/fetch/ResourceClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698