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

Unified Diff: components/web_view/navigation_entry.cc

Issue 1391963004: Correctly record and pass around navigation start time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « components/web_view/navigation_entry.h ('k') | components/web_view/pending_web_view_load.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_view/navigation_entry.cc
diff --git a/components/web_view/navigation_entry.cc b/components/web_view/navigation_entry.cc
index 0b3aaa86fa0b2fa45f42b31e7861073a23ee88b6..a101ac2cdfddb4d43a248626605f59911b8a9bf7 100644
--- a/components/web_view/navigation_entry.cc
+++ b/components/web_view/navigation_entry.cc
@@ -14,8 +14,17 @@ NavigationEntry::NavigationEntry(const GURL& raw_url)
NavigationEntry::~NavigationEntry() {}
-mojo::URLRequestPtr NavigationEntry::BuildURLRequest() const {
- return url_request_.Clone();
+mojo::URLRequestPtr NavigationEntry::BuildURLRequest() {
sky 2015/10/15 13:14:46 Instead of implying whether the time is reset base
yzshen1 2015/10/15 18:23:08 Done.
+ mojo::URLRequestPtr clone = url_request_.Clone();
+ if (clone->originating_time_ticks != 0) {
+ // Forget the originating time, so that we will use Now() when this entry is
+ // used for navigation again (e.g., back/forward navigation).
+ url_request_.set_originating_time(base::TimeTicks());
+ } else {
+ // Use Now() as the request originating time.
+ clone->originating_time_ticks = base::TimeTicks::Now().ToInternalValue();
+ }
+ return clone.Pass();
}
} // namespace web_view
« no previous file with comments | « components/web_view/navigation_entry.h ('k') | components/web_view/pending_web_view_load.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698