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

Unified Diff: chrome/browser/data_use_measurement/chrome_data_use_ascriber.h

Issue 2507813003: Periodically remove old pending navigation entries.
Patch Set: Sync Created 4 years, 1 month 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 | « no previous file | chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
index dc83994b98f6987136226ec822b87620f0dda521..03121181f8ee74805ddda9b91a081eb58f9b99c4 100644
--- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
+++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
@@ -99,6 +99,8 @@ class ChromeDataUseAscriber : public DataUseAscriber {
void* navigation_handle);
private:
+ friend class ChromeDataUseAscriberTest;
+
// Use as a key in the render frame map. Corresponds to a unique
// RenderFrameHost.
typedef std::pair<int, int> RenderFrameHostID;
@@ -131,6 +133,13 @@ class ChromeDataUseAscriber : public DataUseAscriber {
void DeletePendingNavigationEntry(content::GlobalRequestID global_request_id);
+ // The ReadyToCommitNavigation() callback is used to remove entries from
+ // |pending_navigation_data_use_map_|. However, there are a number of race
+ // conditions which make this callback unreliable until PlzNavigate is used.
+ // Until then, this method periodically deletes old navigation entries
+ // that have finished data use.
+ void DeleteOldPendingNavigationEntries(base::Time now);
+
// Owner for all instances of DataUseRecorder. An instance is kept in this
// list if any entity (render frame hosts, URLRequests, pending navigations)
// that ascribe data use to the instance exists, and deleted when all
@@ -149,6 +158,8 @@ class ChromeDataUseAscriber : public DataUseAscriber {
GlobalRequestIDHash>
pending_navigation_data_use_map_;
+ base::Time last_pending_navigations_discard_time_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriber);
};
« no previous file with comments | « no previous file | chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698