Chromium Code Reviews| 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/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 998 validated_params.page_state)) { | 998 validated_params.page_state)) { |
| 999 bad_message::ReceivedBadMessage( | 999 bad_message::ReceivedBadMessage( |
| 1000 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE); | 1000 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE); |
| 1001 return; | 1001 return; |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 // If the URL does not match what the NavigationHandle expects, treat the | 1004 // If the URL does not match what the NavigationHandle expects, treat the |
| 1005 // commit as a new navigation. This can happen if an ongoing slow | 1005 // commit as a new navigation. This can happen if an ongoing slow |
| 1006 // same-process navigation is interrupted by a synchronous renderer-initiated | 1006 // same-process navigation is interrupted by a synchronous renderer-initiated |
| 1007 // navigation. | 1007 // navigation. |
| 1008 // TODO(csharrison): Data navigations with base URLs get reset here, because | |
|
Charlie Reis
2016/02/19 18:00:11
Mention LoadDataWithBaseURL explicitly here.
Charlie Harrison
2016/02/22 14:50:42
Done.
| |
| 1009 // the NavigationHandle tracks the base URL but the validated_params.url track | |
|
Charlie Reis
2016/02/19 18:00:11
nit: tracks the data
Charlie Harrison
2016/02/22 14:50:42
Done.
| |
| 1010 // the data. The trick of saving the old entry ids for these navigations | |
| 1011 // should go away when this is properly handled. | |
|
Charlie Reis
2016/02/19 18:00:11
Let's add a bug number for this work, since it's g
Charlie Harrison
2016/02/22 14:50:42
Done.
| |
| 1012 int entry_id_for_data_nav = 0; | |
| 1008 if (navigation_handle_ && | 1013 if (navigation_handle_ && |
| 1009 navigation_handle_->GetURL() != validated_params.url) { | 1014 (navigation_handle_->GetURL() != validated_params.url)) { |
| 1015 if (navigation_handle_->GetURL() == validated_params.base_url) | |
|
Charlie Reis
2016/02/19 18:00:11
This base_url gets used for other cases as well, a
| |
| 1016 entry_id_for_data_nav = navigation_handle_->pending_nav_entry_id(); | |
| 1010 navigation_handle_.reset(); | 1017 navigation_handle_.reset(); |
| 1011 } | 1018 } |
| 1012 | 1019 |
| 1013 // Synchronous renderer-initiated navigations will send a | 1020 // Synchronous renderer-initiated navigations will send a |
| 1014 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad | 1021 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad |
| 1015 // message. | 1022 // message. |
| 1016 if (!navigation_handle_) { | 1023 if (!navigation_handle_) { |
| 1024 // There is no pending NavigationEntry in these cases, so pass 0 as the | |
| 1025 // nav_id. If the previous handle was a prematurely aborted data nav, then | |
|
Charlie Reis
2016/02/19 18:00:11
Note: It's important to distinguish between a data
Charlie Harrison
2016/02/22 14:50:42
Fixed the wording.
| |
| 1026 // propagate the entry id. | |
| 1017 navigation_handle_ = | 1027 navigation_handle_ = |
| 1018 NavigationHandleImpl::Create(validated_params.url, frame_tree_node_, | 1028 NavigationHandleImpl::Create(validated_params.url, frame_tree_node_, |
| 1019 true, // is_synchronous | 1029 true, // is_synchronous |
| 1020 false, // is_srcdoc | 1030 false, // is_srcdoc |
| 1021 base::TimeTicks::Now()); | 1031 base::TimeTicks::Now(), |
| 1032 entry_id_for_data_nav); | |
| 1022 } | 1033 } |
| 1023 | 1034 |
| 1024 accessibility_reset_count_ = 0; | 1035 accessibility_reset_count_ = 0; |
| 1025 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 1036 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
| 1026 | 1037 |
| 1027 // For a top-level frame, there are potential security concerns associated | 1038 // For a top-level frame, there are potential security concerns associated |
| 1028 // with displaying graphics from a previously loaded page after the URL in | 1039 // with displaying graphics from a previously loaded page after the URL in |
| 1029 // the omnibar has been changed. It is unappealing to clear the page | 1040 // the omnibar has been changed. It is unappealing to clear the page |
| 1030 // immediately, but if the renderer is taking a long time to issue any | 1041 // immediately, but if the renderer is taking a long time to issue any |
| 1031 // compositor output (possibly because of script deliberately creating this | 1042 // compositor output (possibly because of script deliberately creating this |
| (...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2565 *dst = src; | 2576 *dst = src; |
| 2566 | 2577 |
| 2567 if (src.routing_id != -1) | 2578 if (src.routing_id != -1) |
| 2568 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2579 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2569 | 2580 |
| 2570 if (src.parent_routing_id != -1) | 2581 if (src.parent_routing_id != -1) |
| 2571 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2582 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2572 } | 2583 } |
| 2573 | 2584 |
| 2574 } // namespace content | 2585 } // namespace content |
| OLD | NEW |