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(); |