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

Unified Diff: components/precache/core/precache_fetcher.h

Issue 2623553003: precache: Add geometric resource weight function. (Closed)
Patch Set: Add comments and tests. Created 3 years, 11 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
Index: components/precache/core/precache_fetcher.h
diff --git a/components/precache/core/precache_fetcher.h b/components/precache/core/precache_fetcher.h
index 83dd4feebfd72b1d88d6308024cfe6b7f0e8d50d..c00ddd1bd93ebf24ee938f9e857d92c1bf2254b7 100644
--- a/components/precache/core/precache_fetcher.h
+++ b/components/precache/core/precache_fetcher.h
@@ -20,6 +20,7 @@
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "components/precache/core/fetcher_pool.h"
+#include "components/precache/core/proto/precache.pb.h"
#include "components/precache/core/proto/quota.pb.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
@@ -270,6 +271,12 @@ class PrecacheFetcher : public base::SupportsWeakPtr<PrecacheFetcher> {
DISALLOW_COPY_AND_ASSIGN(PrecacheFetcher);
};
+// Visible for testing.
+double ResourceWeight(
+ PrecacheConfigurationSettings::ResourceWeightFunction function,
+ double resource_weight_ratio,
+ int64_t host_visits);
+
// Class that fetches a URL, and runs the specified callback when the fetch is
// complete. This class exists so that a different method can be run in
// response to different kinds of fetches, e.g. OnConfigFetchComplete when
« no previous file with comments | « no previous file | components/precache/core/precache_fetcher.cc » ('j') | components/precache/core/precache_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698