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

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

Issue 2498433002: Revert of Expose GlobalRequestID in NavigationHandle and ResourceRequestInfo. (Closed)
Patch Set: 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 92add1894fe23fd97f11782e8b8f88cd6b2207b7..4b8c3171c32c75f725374ef4c3ea1278d223934f 100644
--- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
+++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
@@ -5,17 +5,8 @@
#ifndef CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_
#define CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_
-#include <list>
-#include <memory>
-#include <unordered_map>
-#include <utility>
-
-#include "base/containers/hash_tables.h"
-#include "base/hash.h"
#include "base/macros.h"
-#include "base/supports_user_data.h"
#include "components/data_use_measurement/core/data_use_ascriber.h"
-#include "content/public/browser/global_request_id.h"
#include "url/gurl.h"
namespace content {
@@ -50,14 +41,8 @@
~ChromeDataUseAscriber() override;
- // DataUseAscriber implementation:
+ // DataUseAscriber:
DataUseRecorder* GetDataUseRecorder(net::URLRequest* request) override;
-
- // Called before a request is sent.
- void OnBeforeUrlRequest(net::URLRequest* request) override;
-
- // Called when a URLRequest completes.
- void OnUrlRequestCompleted(net::URLRequest* request, bool started) override;
// Called when a render frame host is created.
void RenderFrameCreated(int render_process_id,
@@ -77,15 +62,12 @@
int render_frame_id,
void* navigation_handle);
- // Called when a main frame navigation is ready to be committed in a
- // renderer.
- void ReadyToCommitMainFrameNavigation(
- GURL gurl,
- content::GlobalRequestID global_request_id,
- int render_process_id,
- int render_frame_id,
- bool is_same_page_navigation,
- void* navigation_handle);
+ // Called when a main frame navigation is completed.
+ void DidFinishMainFrameNavigation(GURL gurl,
+ int render_process_id,
+ int render_frame_id,
+ bool is_same_page_navigation,
+ void* navigation_handle);
// Called when a main frame navigation is redirected.
void DidRedirectMainFrameNavigation(GURL gurl,
@@ -94,56 +76,6 @@
void* navigation_handle);
private:
- // Use as a key in the render frame map. Corresponds to a unique
- // RenderFrameHost.
- typedef std::pair<int, int> RenderFrameHostID;
-
- // Entry in the |data_use_recorders_| list which owns all instances of
- // DataUseRecorder.
- typedef std::list<std::unique_ptr<data_use_measurement::DataUseRecorder>>::
- iterator DataUseRecorderEntry;
-
- struct GlobalRequestIDHash {
- public:
- std::size_t operator()(const content::GlobalRequestID& x) const {
- return base::HashInts(x.child_id, x.request_id);
- }
- };
-
- class DataUseRecorderEntryAsUserData : public base::SupportsUserData::Data {
- public:
- explicit DataUseRecorderEntryAsUserData(DataUseRecorderEntry entry);
-
- ~DataUseRecorderEntryAsUserData() override;
-
- DataUseRecorderEntry recorder_entry() { return entry_; }
-
- static const void* kUserDataKey;
-
- private:
- DataUseRecorderEntry entry_;
- };
-
- void DeletePendingNavigationEntry(content::GlobalRequestID global_request_id);
-
- // 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
- // ascribing entities go away.
- std::list<std::unique_ptr<DataUseRecorder>> data_use_recorders_;
-
- // Map from RenderFrameHost to the DataUseRecorderEntry in
- // |data_use_recorders_| that the frame ascribe data use to.
- base::hash_map<RenderFrameHostID, DataUseRecorderEntry>
- render_frame_data_use_map_;
-
- // Map from pending navigations to the DataUseRecorderEntry in
- // |data_use_recorders_| that the navigation ascribes data use to.
- std::unordered_map<content::GlobalRequestID,
- DataUseRecorderEntry,
- GlobalRequestIDHash>
- pending_navigation_data_use_map_;
-
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