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

Unified Diff: components/web_view/url_request_cloneable.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
Index: components/web_view/url_request_cloneable.cc
diff --git a/components/web_view/url_request_cloneable.cc b/components/web_view/url_request_cloneable.cc
index 4ee870aa5f7b7cee5cd6964386401fcfc93390b2..028329eb0ddd4ea7b92f0b24751ee390454e0207 100644
--- a/components/web_view/url_request_cloneable.cc
+++ b/components/web_view/url_request_cloneable.cc
@@ -24,7 +24,9 @@ URLRequestCloneable::URLRequestCloneable(mojo::URLRequestPtr original_request)
auto_follow_redirects_(original_request->auto_follow_redirects),
bypass_cache_(original_request->bypass_cache),
original_body_null_(original_request->body.is_null()),
- body_(original_request->body.size()) {
+ body_(original_request->body.size()),
+ originating_time_(base::TimeTicks::FromInternalValue(
+ original_request->originating_time_ticks)) {
// TODO(erg): Maybe we can do some sort of async copy here?
for (size_t i = 0; i < original_request->body.size(); ++i) {
mojo::common::BlockingCopyToString(original_request->body[i].Pass(),
@@ -44,7 +46,7 @@ URLRequestCloneable::URLRequestCloneable(const GURL& raw_url)
URLRequestCloneable::~URLRequestCloneable() {}
-mojo::URLRequestPtr URLRequestCloneable::Clone() const {
+mojo::URLRequestPtr URLRequestCloneable::Clone() {
mojo::URLRequestPtr request = mojo::URLRequest::New();
request->url = url_;
request->method = method_;
@@ -71,6 +73,13 @@ mojo::URLRequestPtr URLRequestCloneable::Clone() const {
}
}
+ if (originating_time_.is_null()) {
+ request->originating_time_ticks = base::TimeTicks::Now().ToInternalValue();
sky 2015/10/14 22:46:24 Why do you want to set the time here? If no one su
yzshen1 2015/10/14 22:59:16 When we do back/forward navigation, we clone the o
sky 2015/10/14 23:08:36 Can't the code that clones it reset the time?
yzshen1 2015/10/15 00:05:10 Done.
+ } else {
+ request->originating_time_ticks = originating_time_.ToInternalValue();
+ originating_time_ = base::TimeTicks();
+ }
+
return request.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698