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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor_tables.h

Issue 2804283002: predictors: Refactor UpdateData() function. (Closed)
Patch Set: Oops fix. Created 3 years, 8 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: chrome/browser/predictors/resource_prefetch_predictor_tables.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables.h b/chrome/browser/predictors/resource_prefetch_predictor_tables.h
index 522def9429d83e1dd418ab22865b89c3f9827902..0808fbad23ee3eb9668965ff898e1356e9215b9c 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_tables.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor_tables.h
@@ -51,13 +51,17 @@ class ResourcePrefetchPredictorTables : public PredictorTableBase {
ManifestDataMap* manifest_map,
OriginDataMap* origin_data_map);
- // Updates data for a Url and a host. If any of the arguments has an empty
- // primary key, it will be ignored.
- // Note that all the keys should be less |kMaxStringLength| in length.
- virtual void UpdateData(const PrefetchData& url_data,
- const PrefetchData& host_data,
- const RedirectData& url_redirect_data,
- const RedirectData& host_redirect_data);
+ // Updates resource data for the input |data|.
+ // Note that the primary key in |data| should be less than |kMaxStringLength|
+ // in length.
+ virtual void UpdateResourceData(const PrefetchData& data,
+ PrefetchKeyType key_type);
+
+ // Updates redirect data for the input |data|.
+ // Note that the primary key in |data| should be less than |kMaxStringLength|
+ // in length.
+ virtual void UpdateRedirectData(const RedirectData& data,
+ PrefetchKeyType key_type);
// Updates manifest data for the input |host|.
virtual void UpdateManifestData(
@@ -150,7 +154,7 @@ class ResourcePrefetchPredictorTables : public PredictorTableBase {
void GetAllManifestDataHelper(ManifestDataMap* manifest_map);
void GetAllOriginDataHelper(OriginDataMap* manifest_map);
- bool UpdateDataHelper(PrefetchKeyType key_type,
+ void UpdateDataHelper(PrefetchKeyType key_type,
PrefetchDataType data_type,
const std::string& key,
const google::protobuf::MessageLite& data);

Powered by Google App Engine
This is Rietveld 408576698