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

Side by Side Diff: components/html_viewer/document_resource_waiter.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
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/html_viewer/document_resource_waiter.h" 5 #include "components/html_viewer/document_resource_waiter.h"
6 6
7 #include "components/html_viewer/global_state.h" 7 #include "components/html_viewer/global_state.h"
8 #include "components/html_viewer/html_document.h" 8 #include "components/html_viewer/html_document.h"
9 #include "components/html_viewer/html_frame_tree_manager.h" 9 #include "components/html_viewer/html_frame_tree_manager.h"
10 #include "components/mus/public/cpp/view.h" 10 #include "components/mus/public/cpp/view.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 } 120 }
121 } 121 }
122 122
123 void DocumentResourceWaiter::OnConnect( 123 void DocumentResourceWaiter::OnConnect(
124 web_view::mojom::FramePtr frame, 124 web_view::mojom::FramePtr frame,
125 uint32_t change_id, 125 uint32_t change_id,
126 uint32_t view_id, 126 uint32_t view_id,
127 ViewConnectType view_connect_type, 127 ViewConnectType view_connect_type,
128 mojo::Array<web_view::mojom::FrameDataPtr> frame_data, 128 mojo::Array<web_view::mojom::FrameDataPtr> frame_data,
129 int64_t navigation_start_time_ticks,
129 const OnConnectCallback& callback) { 130 const OnConnectCallback& callback) {
130 DCHECK(frame_data_.is_null()); 131 DCHECK(frame_data_.is_null());
131 change_id_ = change_id; 132 change_id_ = change_id;
132 view_id_ = view_id; 133 view_id_ = view_id;
133 view_connect_type_ = view_connect_type; 134 view_connect_type_ = view_connect_type;
134 frame_ = frame.Pass(); 135 frame_ = frame.Pass();
135 frame_data_ = frame_data.Pass(); 136 frame_data_ = frame_data.Pass();
137 navigation_start_time_ =
138 base::TimeTicks::FromInternalValue(navigation_start_time_ticks);
136 on_connect_callback_ = callback; 139 on_connect_callback_ = callback;
137 CHECK(frame_data_.size() > 0u); 140 CHECK(frame_data_.size() > 0u);
138 frame_client_request_ = frame_client_binding_.Unbind(); 141 frame_client_request_ = frame_client_binding_.Unbind();
139 UpdateIsReady(); 142 UpdateIsReady();
140 } 143 }
141 144
142 void DocumentResourceWaiter::OnFrameAdded( 145 void DocumentResourceWaiter::OnFrameAdded(
143 uint32_t change_id, 146 uint32_t change_id,
144 web_view::mojom::FrameDataPtr frame_data) { 147 web_view::mojom::FrameDataPtr frame_data) {
145 // It is assumed we receive OnConnect() (which unbinds) before anything else. 148 // It is assumed we receive OnConnect() (which unbinds) before anything else.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 231
229 void DocumentResourceWaiter::OnHTMLFrameTreeManagerChangeIdAdvanced() { 232 void DocumentResourceWaiter::OnHTMLFrameTreeManagerChangeIdAdvanced() {
230 UpdateIsReady(); 233 UpdateIsReady();
231 } 234 }
232 235
233 void DocumentResourceWaiter::OnHTMLFrameTreeManagerDestroyed() { 236 void DocumentResourceWaiter::OnHTMLFrameTreeManagerDestroyed() {
234 document_->Destroy(); // This destroys us. 237 document_->Destroy(); // This destroys us.
235 } 238 }
236 239
237 } // namespace html_viewer 240 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/document_resource_waiter.h ('k') | components/html_viewer/html_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698