OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1179 // same-process navigation is interrupted by a synchronous renderer-initiated | 1179 // same-process navigation is interrupted by a synchronous renderer-initiated |
1180 // navigation. | 1180 // navigation. |
1181 // TODO(csharrison): Data navigations loaded with LoadDataWithBaseURL get | 1181 // TODO(csharrison): Data navigations loaded with LoadDataWithBaseURL get |
1182 // reset here, because the NavigationHandle tracks the URL but the | 1182 // reset here, because the NavigationHandle tracks the URL but the |
1183 // validated_params.url tracks the data. The trick of saving the old entry ids | 1183 // validated_params.url tracks the data. The trick of saving the old entry ids |
1184 // for these navigations should go away when this is properly handled. See | 1184 // for these navigations should go away when this is properly handled. See |
1185 // crbug.com/588317. | 1185 // crbug.com/588317. |
1186 int entry_id_for_data_nav = 0; | 1186 int entry_id_for_data_nav = 0; |
1187 bool is_renderer_initiated = true; | 1187 bool is_renderer_initiated = true; |
1188 if (navigation_handle_ && | 1188 if (navigation_handle_ && |
1189 (navigation_handle_->GetURL() != validated_params.url)) { | 1189 (navigation_handle_->GetURL() != validated_params.url)) { |
Charlie Reis
2016/09/20 22:06:25
Note: Add a check for whether navigation_handle_->
| |
1190 // Make sure that the pending entry was really loaded via | 1190 // Make sure that the pending entry was really loaded via |
1191 // LoadDataWithBaseURL and that it matches this handle. | 1191 // LoadDataWithBaseURL and that it matches this handle. |
1192 NavigationEntryImpl* pending_entry = | 1192 NavigationEntryImpl* pending_entry = |
1193 NavigationEntryImpl::FromNavigationEntry( | 1193 NavigationEntryImpl::FromNavigationEntry( |
1194 frame_tree_node()->navigator()->GetController()->GetPendingEntry()); | 1194 frame_tree_node()->navigator()->GetController()->GetPendingEntry()); |
1195 bool pending_entry_matches_handle = | 1195 bool pending_entry_matches_handle = |
1196 pending_entry && | 1196 pending_entry && |
1197 pending_entry->GetUniqueID() == | 1197 pending_entry->GetUniqueID() == |
1198 navigation_handle_->pending_nav_entry_id(); | 1198 navigation_handle_->pending_nav_entry_id(); |
1199 // TODO(csharrison): The pending entry's base url should equal | 1199 // TODO(csharrison): The pending entry's base url should equal |
(...skipping 11 matching lines...) Expand all Loading... | |
1211 // Synchronous renderer-initiated navigations will send a | 1211 // Synchronous renderer-initiated navigations will send a |
1212 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad | 1212 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad |
1213 // message. | 1213 // message. |
1214 if (!navigation_handle_) { | 1214 if (!navigation_handle_) { |
1215 // There is no pending NavigationEntry in these cases, so pass 0 as the | 1215 // There is no pending NavigationEntry in these cases, so pass 0 as the |
1216 // nav_id. If the previous handle was a prematurely aborted navigation | 1216 // nav_id. If the previous handle was a prematurely aborted navigation |
1217 // loaded via LoadDataWithBaseURL, propogate the entry id. | 1217 // loaded via LoadDataWithBaseURL, propogate the entry id. |
1218 navigation_handle_ = NavigationHandleImpl::Create( | 1218 navigation_handle_ = NavigationHandleImpl::Create( |
1219 validated_params.url, frame_tree_node_, | 1219 validated_params.url, frame_tree_node_, |
1220 is_renderer_initiated, | 1220 is_renderer_initiated, |
1221 true, // is_synchronous | 1221 validated_params.was_within_same_page, |
1222 validated_params.is_srcdoc, base::TimeTicks::Now(), | 1222 validated_params.is_srcdoc, base::TimeTicks::Now(), |
1223 entry_id_for_data_nav); | 1223 entry_id_for_data_nav); |
1224 // PlzNavigate | 1224 // PlzNavigate |
1225 if (IsBrowserSideNavigationEnabled()) { | 1225 if (IsBrowserSideNavigationEnabled()) { |
1226 // PlzNavigate: synchronous loads happen in the renderer, and the browser | 1226 // PlzNavigate: synchronous loads happen in the renderer, and the browser |
1227 // has not been notified about the start of the load yet. Do it now. | 1227 // has not been notified about the start of the load yet. Do it now. |
1228 if (!is_loading()) { | 1228 if (!is_loading()) { |
1229 bool was_loading = frame_tree_node()->frame_tree()->IsLoading(); | 1229 bool was_loading = frame_tree_node()->frame_tree()->IsLoading(); |
1230 is_loading_ = true; | 1230 is_loading_ = true; |
1231 frame_tree_node()->DidStartLoading(true, was_loading); | 1231 frame_tree_node()->DidStartLoading(true, was_loading); |
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3092 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3092 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3093 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3093 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3094 return web_bluetooth_service_.get(); | 3094 return web_bluetooth_service_.get(); |
3095 } | 3095 } |
3096 | 3096 |
3097 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3097 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3098 web_bluetooth_service_.reset(); | 3098 web_bluetooth_service_.reset(); |
3099 } | 3099 } |
3100 | 3100 |
3101 } // namespace content | 3101 } // namespace content |
OLD | NEW |