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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 995 validated_params.page_state)) { | 995 validated_params.page_state)) { |
| 996 bad_message::ReceivedBadMessage( | 996 bad_message::ReceivedBadMessage( |
| 997 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE); | 997 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE); |
| 998 return; | 998 return; |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 // If the URL does not match what the NavigationHandle expects, treat the | 1001 // If the URL does not match what the NavigationHandle expects, treat the |
| 1002 // commit as a new navigation. This can happen if an ongoing slow | 1002 // commit as a new navigation. This can happen if an ongoing slow |
| 1003 // same-process navigation is interrupted by a synchronous renderer-initiated | 1003 // same-process navigation is interrupted by a synchronous renderer-initiated |
| 1004 // navigation. | 1004 // navigation. |
| 1005 // TODO(csharrison): Data navigations with base URLs get reset here, because | |
| 1006 // the NavigationHandle tracks the base URL but the validated_params.url track | |
| 1007 // the data. The trick of saving the old entry ids for these navigations | |
| 1008 // should go away when this is properly handled. | |
| 1009 int entry_id_for_data_nav = 0; | |
| 1005 if (navigation_handle_ && | 1010 if (navigation_handle_ && |
| 1006 navigation_handle_->GetURL() != validated_params.url) { | 1011 (navigation_handle_->GetURL() != validated_params.url)) { |
| 1012 if (navigation_handle_->GetURL() == validated_params.base_url) | |
|
Charlie Reis
2016/02/10 00:25:42
Why even reset the NavHandle in this case? Creati
Charlie Harrison
2016/02/11 20:23:05
It is wrong, but I think we have to do a more fund
| |
| 1013 entry_id_for_data_nav = navigation_handle_->pending_nav_entry_id(); | |
| 1007 navigation_handle_.reset(); | 1014 navigation_handle_.reset(); |
| 1008 } | 1015 } |
| 1009 | 1016 |
| 1010 // Synchronous renderer-initiated navigations will send a | 1017 // Synchronous renderer-initiated navigations will send a |
| 1011 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad | 1018 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad |
| 1012 // message. | 1019 // message. |
| 1013 if (!navigation_handle_) { | 1020 if (!navigation_handle_) { |
| 1021 // There is no pending NavigationEntry in these cases, so pass 0 as the | |
| 1022 // nav_id. If the previous handle was a prematurely aborted data nav, then | |
| 1023 // propagate the entry id. | |
| 1014 navigation_handle_ = NavigationHandleImpl::Create( | 1024 navigation_handle_ = NavigationHandleImpl::Create( |
| 1015 validated_params.url, frame_tree_node_, base::TimeTicks::Now()); | 1025 validated_params.url, frame_tree_node_, base::TimeTicks::Now(), |
| 1026 entry_id_for_data_nav); | |
| 1016 } | 1027 } |
| 1017 | 1028 |
| 1018 accessibility_reset_count_ = 0; | 1029 accessibility_reset_count_ = 0; |
| 1019 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 1030 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
| 1020 | 1031 |
| 1021 // For a top-level frame, there are potential security concerns associated | 1032 // For a top-level frame, there are potential security concerns associated |
| 1022 // with displaying graphics from a previously loaded page after the URL in | 1033 // with displaying graphics from a previously loaded page after the URL in |
| 1023 // the omnibar has been changed. It is unappealing to clear the page | 1034 // the omnibar has been changed. It is unappealing to clear the page |
| 1024 // immediately, but if the renderer is taking a long time to issue any | 1035 // immediately, but if the renderer is taking a long time to issue any |
| 1025 // compositor output (possibly because of script deliberately creating this | 1036 // compositor output (possibly because of script deliberately creating this |
| (...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2553 *dst = src; | 2564 *dst = src; |
| 2554 | 2565 |
| 2555 if (src.routing_id != -1) | 2566 if (src.routing_id != -1) |
| 2556 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2567 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2557 | 2568 |
| 2558 if (src.parent_routing_id != -1) | 2569 if (src.parent_routing_id != -1) |
| 2559 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2570 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2560 } | 2571 } |
| 2561 | 2572 |
| 2562 } // namespace content | 2573 } // namespace content |
| OLD | NEW |