Index: chrome/browser/predictors/resource_prefetch_common.cc |
diff --git a/chrome/browser/predictors/resource_prefetch_common.cc b/chrome/browser/predictors/resource_prefetch_common.cc |
index 25e0f43a87d8fe2dea6ecaff002fb685362a67f1..c850aa880c4fffedd709e4a99522cadff8a2d499 100644 |
--- a/chrome/browser/predictors/resource_prefetch_common.cc |
+++ b/chrome/browser/predictors/resource_prefetch_common.cc |
@@ -76,52 +76,38 @@ bool IsSpeculativeResourcePrefetchingEnabled( |
return false; |
} |
-NavigationID::NavigationID() |
- : render_process_id(-1), |
- render_frame_id(-1) { |
-} |
+NavigationID::NavigationID() : session_id(-1) {} |
NavigationID::NavigationID(const NavigationID& other) |
- : render_process_id(other.render_process_id), |
- render_frame_id(other.render_frame_id), |
+ : session_id(other.session_id), |
main_frame_url(other.main_frame_url), |
- creation_time(other.creation_time) { |
-} |
+ creation_time(other.creation_time) {} |
NavigationID::NavigationID(content::WebContents* web_contents) |
- : render_process_id(web_contents->GetRenderProcessHost()->GetID()), |
- render_frame_id(web_contents->GetMainFrame()->GetRoutingID()), |
- main_frame_url(web_contents->GetURL()) { |
-} |
+ : session_id(SessionTabHelper::IdForTab(web_contents)), |
+ main_frame_url(web_contents->GetURL()), |
+ creation_time(base::TimeTicks::Now()) {} |
NavigationID::NavigationID(content::WebContents* web_contents, |
const GURL& main_frame_url, |
const base::TimeTicks& creation_time) |
- : render_process_id(web_contents->GetRenderProcessHost()->GetID()), |
- render_frame_id(web_contents->GetMainFrame()->GetRoutingID()), |
+ : session_id(SessionTabHelper::IdForTab(web_contents)), |
main_frame_url(main_frame_url), |
creation_time(creation_time) {} |
bool NavigationID::is_valid() const { |
- return render_process_id != -1 && render_frame_id != -1 && |
- !main_frame_url.is_empty(); |
+ return session_id != -1 && !main_frame_url.is_empty(); |
} |
bool NavigationID::operator<(const NavigationID& rhs) const { |
DCHECK(is_valid() && rhs.is_valid()); |
- return std::tie(render_process_id, render_frame_id, main_frame_url) < |
- std::tie(rhs.render_process_id, rhs.render_frame_id, rhs.main_frame_url); |
+ return std::tie(session_id, main_frame_url) < |
+ std::tie(rhs.session_id, rhs.main_frame_url); |
} |
bool NavigationID::operator==(const NavigationID& rhs) const { |
DCHECK(is_valid() && rhs.is_valid()); |
- return IsSameRenderer(rhs) && main_frame_url == rhs.main_frame_url; |
-} |
- |
-bool NavigationID::IsSameRenderer(const NavigationID& other) const { |
- DCHECK(is_valid() && other.is_valid()); |
- return render_process_id == other.render_process_id && |
- render_frame_id == other.render_frame_id; |
+ return session_id == rhs.session_id && main_frame_url == rhs.main_frame_url; |
} |
ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig() |