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

Unified Diff: components/web_view/frame.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/frame.cc
diff --git a/components/web_view/frame.cc b/components/web_view/frame.cc
index 0670977c375c838b7756bbb99919b45bdb0b9f2e..3b8e89a9f40bcacecba5e04ae789ca0a38d40fad 100644
--- a/components/web_view/frame.cc
+++ b/components/web_view/frame.cc
@@ -96,7 +96,8 @@ Frame::~Frame() {
void Frame::Init(Frame* parent,
mojo::ViewTreeClientPtr view_tree_client,
- mojo::InterfaceRequest<mojom::Frame> frame_request) {
+ mojo::InterfaceRequest<mojom::Frame> frame_request,
+ base::TimeTicks navigation_start_time) {
{
// Set the FrameClient to null so that we don't notify the client of the
// add before OnConnect().
@@ -106,6 +107,7 @@ void Frame::Init(Frame* parent,
parent->Add(this);
}
+ navigation_start_time_ = navigation_start_time;
const ClientType client_type = frame_request.is_pending()
? ClientType::NEW_CHILD_FRAME
: ClientType::EXISTING_FRAME_NEW_APP;
@@ -205,7 +207,9 @@ void Frame::InitClient(ClientType client_type,
frame_client_->OnConnect(
nullptr, tree_->change_id(), id_, mojom::VIEW_CONNECT_TYPE_USE_NEW,
mojo::Array<mojom::FrameDataPtr>(),
+ navigation_start_time_.ToInternalValue(),
base::Bind(&OnConnectAck, base::Passed(&data_and_binding)));
+ navigation_start_time_ = base::TimeTicks();
} else {
std::vector<const Frame*> frames;
tree_->root()->BuildFrameTree(&frames);
@@ -224,8 +228,9 @@ void Frame::InitClient(ClientType client_type,
client_type == ClientType::EXISTING_FRAME_SAME_APP
? mojom::VIEW_CONNECT_TYPE_USE_EXISTING
: mojom::VIEW_CONNECT_TYPE_USE_NEW,
- array.Pass(),
+ array.Pass(), navigation_start_time_.ToInternalValue(),
base::Bind(&OnConnectAck, base::Passed(&data_and_binding)));
+ navigation_start_time_ = base::TimeTicks();
tree_->delegate_->DidStartNavigation(this);
// We need |embedded_connection_id_| is order to validate requests to
@@ -342,6 +347,8 @@ void Frame::StartNavigate(mojo::URLRequestPtr request) {
return;
}
+ navigation_start_time_ =
sky 2015/10/14 22:46:24 Does navigation_start_time_ need to be a member? C
yzshen1 2015/10/14 22:59:15 In that case we also need to pass it to ChangeClie
sky 2015/10/14 23:08:36 The problem with the member is that it's easy to a
yzshen1 2015/10/15 00:05:10 Done.
+ base::TimeTicks::FromInternalValue(request->originating_time_ticks);
// Drop any pending navigation requests.
navigate_weak_ptr_factory_.InvalidateWeakPtrs();

Powered by Google App Engine
This is Rietveld 408576698