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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1035 // compositor output (possibly because of script deliberately creating this | 1035 // compositor output (possibly because of script deliberately creating this |
| 1036 // situation) then we clear it after a while anyway. | 1036 // situation) then we clear it after a while anyway. |
| 1037 // See https://crbug.com/497588. | 1037 // See https://crbug.com/497588. |
| 1038 if (frame_tree_node_->IsMainFrame() && GetView() && | 1038 if (frame_tree_node_->IsMainFrame() && GetView() && |
| 1039 !validated_params.was_within_same_page) { | 1039 !validated_params.was_within_same_page) { |
| 1040 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) | 1040 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) |
| 1041 ->StartNewContentRenderingTimeout(); | 1041 ->StartNewContentRenderingTimeout(); |
| 1042 } | 1042 } |
| 1043 | 1043 |
| 1044 // PlzNavigate | 1044 // PlzNavigate |
| 1045 if (IsBrowserSideNavigationEnabled()) | 1045 if (IsBrowserSideNavigationEnabled()) { |
| 1046 // PlzNavigate: synchronous loads happen in the renderer, and the browser | |
| 1047 // has not been notified about the start of the load yet. Do it now. | |
| 1048 if (!is_loading()) { | |
|
nasko
2016/02/03 22:28:14
Why not put this in the same section above, where
clamy
2016/02/10 16:39:35
Done.
| |
| 1049 is_loading_ = true; | |
| 1050 frame_tree_node()->DidStartLoading(true, false); | |
| 1051 } | |
| 1046 pending_commit_ = false; | 1052 pending_commit_ = false; |
| 1053 } | |
| 1047 } | 1054 } |
| 1048 | 1055 |
| 1049 void RenderFrameHostImpl::OnUpdateState(const PageState& state) { | 1056 void RenderFrameHostImpl::OnUpdateState(const PageState& state) { |
| 1050 // TODO(creis): Verify the state's ISN matches the last committed FNE. | 1057 // TODO(creis): Verify the state's ISN matches the last committed FNE. |
| 1051 | 1058 |
| 1052 // Without this check, the renderer can trick the browser into using | 1059 // Without this check, the renderer can trick the browser into using |
| 1053 // filenames it can't access in a future session restore. | 1060 // filenames it can't access in a future session restore. |
| 1054 // TODO(creis): Move CanAccessFilesOfPageState to RenderFrameHostImpl. | 1061 // TODO(creis): Move CanAccessFilesOfPageState to RenderFrameHostImpl. |
| 1055 if (!render_view_host_->CanAccessFilesOfPageState(state)) { | 1062 if (!render_view_host_->CanAccessFilesOfPageState(state)) { |
| 1056 bad_message::ReceivedBadMessage( | 1063 bad_message::ReceivedBadMessage( |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1687 delegate_->EnterFullscreenMode(GetLastCommittedURL().GetOrigin()); | 1694 delegate_->EnterFullscreenMode(GetLastCommittedURL().GetOrigin()); |
| 1688 else | 1695 else |
| 1689 delegate_->ExitFullscreenMode(/* will_cause_resize */ true); | 1696 delegate_->ExitFullscreenMode(/* will_cause_resize */ true); |
| 1690 | 1697 |
| 1691 // The previous call might change the fullscreen state. We need to make sure | 1698 // The previous call might change the fullscreen state. We need to make sure |
| 1692 // the renderer is aware of that, which is done via the resize message. | 1699 // the renderer is aware of that, which is done via the resize message. |
| 1693 render_view_host_->GetWidget()->WasResized(); | 1700 render_view_host_->GetWidget()->WasResized(); |
| 1694 } | 1701 } |
| 1695 | 1702 |
| 1696 void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) { | 1703 void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) { |
| 1704 // PlzNavigate: the browser is responsible for knowing the start of all | |
| 1705 // non-synchronous navigations. | |
| 1706 if (IsBrowserSideNavigationEnabled() && to_different_document) | |
| 1707 return; | |
|
carlosk
2016/02/03 12:41:56
Instead of ignoring shouldn't we stop it from bein
clamy
2016/02/10 16:39:35
Done.
| |
| 1708 | |
| 1697 bool was_previously_loading = frame_tree_node_->frame_tree()->IsLoading(); | 1709 bool was_previously_loading = frame_tree_node_->frame_tree()->IsLoading(); |
| 1698 is_loading_ = true; | 1710 is_loading_ = true; |
| 1699 frame_tree_node_->DidStartLoading(to_different_document, | 1711 frame_tree_node_->DidStartLoading(to_different_document, |
| 1700 was_previously_loading); | 1712 was_previously_loading); |
| 1701 } | 1713 } |
| 1702 | 1714 |
| 1703 void RenderFrameHostImpl::OnDidStopLoading() { | 1715 void RenderFrameHostImpl::OnDidStopLoading() { |
| 1704 // This method should never be called when the frame is not loading. | 1716 // This method should never be called when the frame is not loading. |
| 1705 // Unfortunately, it can happen if a history navigation happens during a | 1717 // Unfortunately, it can happen if a history navigation happens during a |
| 1706 // BeforeUnload or Unload event. | 1718 // BeforeUnload or Unload event. |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2551 *dst = src; | 2563 *dst = src; |
| 2552 | 2564 |
| 2553 if (src.routing_id != -1) | 2565 if (src.routing_id != -1) |
| 2554 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2566 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2555 | 2567 |
| 2556 if (src.parent_routing_id != -1) | 2568 if (src.parent_routing_id != -1) |
| 2557 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2569 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2558 } | 2570 } |
| 2559 | 2571 |
| 2560 } // namespace content | 2572 } // namespace content |
| OLD | NEW |