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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/web_view/navigation_entry.h" 5 #include "components/web_view/navigation_entry.h"
6 6
7 namespace web_view { 7 namespace web_view {
8 8
9 NavigationEntry::NavigationEntry(mojo::URLRequestPtr original_request) 9 NavigationEntry::NavigationEntry(mojo::URLRequestPtr original_request)
10 : url_request_(original_request.Pass()) {} 10 : url_request_(original_request.Pass()) {}
11 11
12 NavigationEntry::NavigationEntry(const GURL& raw_url) 12 NavigationEntry::NavigationEntry(const GURL& raw_url)
13 : url_request_(raw_url) {} 13 : url_request_(raw_url) {}
14 14
15 NavigationEntry::~NavigationEntry() {} 15 NavigationEntry::~NavigationEntry() {}
16 16
17 mojo::URLRequestPtr NavigationEntry::BuildURLRequest() const { 17 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.
18 return url_request_.Clone(); 18 mojo::URLRequestPtr clone = url_request_.Clone();
19 if (clone->originating_time_ticks != 0) {
20 // Forget the originating time, so that we will use Now() when this entry is
21 // used for navigation again (e.g., back/forward navigation).
22 url_request_.set_originating_time(base::TimeTicks());
23 } else {
24 // Use Now() as the request originating time.
25 clone->originating_time_ticks = base::TimeTicks::Now().ToInternalValue();
26 }
27 return clone.Pass();
19 } 28 }
20 29
21 } // namespace web_view 30 } // namespace web_view
OLDNEW
« 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