| OLD | NEW |
| 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 Loading... |
| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 228 |
| 226 void DocumentResourceWaiter::OnHTMLFrameTreeManagerChangeIdAdvanced() { | 229 void DocumentResourceWaiter::OnHTMLFrameTreeManagerChangeIdAdvanced() { |
| 227 UpdateIsReady(); | 230 UpdateIsReady(); |
| 228 } | 231 } |
| 229 | 232 |
| 230 void DocumentResourceWaiter::OnHTMLFrameTreeManagerDestroyed() { | 233 void DocumentResourceWaiter::OnHTMLFrameTreeManagerDestroyed() { |
| 231 document_->Destroy(); // This destroys us. | 234 document_->Destroy(); // This destroys us. |
| 232 } | 235 } |
| 233 | 236 |
| 234 } // namespace html_viewer | 237 } // namespace html_viewer |
| OLD | NEW |