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

Unified Diff: chrome/browser/predictors/resource_prefetch_common.cc

Issue 2545943003: Accessing navigation information via webcontents (Closed)
Patch Set: Post-Review Modifications #3 Created 4 years 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_common.cc
diff --git a/chrome/browser/predictors/resource_prefetch_common.cc b/chrome/browser/predictors/resource_prefetch_common.cc
index 8cd02209b3ec65cff4677f920ec98cd3742d119c..25e0f43a87d8fe2dea6ecaff002fb685362a67f1 100644
--- a/chrome/browser/predictors/resource_prefetch_common.cc
+++ b/chrome/browser/predictors/resource_prefetch_common.cc
@@ -81,13 +81,6 @@ NavigationID::NavigationID()
render_frame_id(-1) {
}
-NavigationID::NavigationID(int render_process_id,
- int render_frame_id,
- const GURL& main_frame_url)
- : render_process_id(render_process_id),
- render_frame_id(render_frame_id),
- main_frame_url(main_frame_url) {}
-
NavigationID::NavigationID(const NavigationID& other)
: render_process_id(other.render_process_id),
render_frame_id(other.render_frame_id),
@@ -101,6 +94,14 @@ NavigationID::NavigationID(content::WebContents* web_contents)
main_frame_url(web_contents->GetURL()) {
}
+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()),
+ 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();
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.h ('k') | chrome/browser/predictors/resource_prefetch_predictor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698