OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 // notification containing parameters identifying the navigation. | 955 // notification containing parameters identifying the navigation. |
956 // | 956 // |
957 // Subframes are identified by the page transition type. For subframes loaded | 957 // Subframes are identified by the page transition type. For subframes loaded |
958 // as part of a wider page load, the page_id will be the same as for the top | 958 // as part of a wider page load, the page_id will be the same as for the top |
959 // level frame. If the user explicitly requests a subframe navigation, we will | 959 // level frame. If the user explicitly requests a subframe navigation, we will |
960 // get a new page_id because we need to create a new navigation entry for that | 960 // get a new page_id because we need to create a new navigation entry for that |
961 // action. | 961 // action. |
962 void RenderViewHostImpl::OnMsgNavigate(const IPC::Message& msg) { | 962 void RenderViewHostImpl::OnMsgNavigate(const IPC::Message& msg) { |
963 // Read the parameters out of the IPC message directly to avoid making another | 963 // Read the parameters out of the IPC message directly to avoid making another |
964 // copy when we filter the URLs. | 964 // copy when we filter the URLs. |
965 void* iter = NULL; | 965 PickleIterator iter(msg); |
966 ViewHostMsg_FrameNavigate_Params validated_params; | 966 ViewHostMsg_FrameNavigate_Params validated_params; |
967 if (!IPC::ParamTraits<ViewHostMsg_FrameNavigate_Params>:: | 967 if (!IPC::ParamTraits<ViewHostMsg_FrameNavigate_Params>:: |
968 Read(&msg, &iter, &validated_params)) | 968 Read(&msg, &iter, &validated_params)) |
969 return; | 969 return; |
970 | 970 |
971 // If we're waiting for a cross-site beforeunload ack from this renderer and | 971 // If we're waiting for a cross-site beforeunload ack from this renderer and |
972 // we receive a Navigate message from the main frame, then the renderer was | 972 // we receive a Navigate message from the main frame, then the renderer was |
973 // navigating already and sent it before hearing the ViewMsg_Stop message. | 973 // navigating already and sent it before hearing the ViewMsg_Stop message. |
974 // We do not want to cancel the pending navigation in this case, since the | 974 // We do not want to cancel the pending navigation in this case, since the |
975 // old page will soon be stopped. Instead, treat this as a beforeunload ack | 975 // old page will soon be stopped. Instead, treat this as a beforeunload ack |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1671 // can cause navigations to be ignored in OnMsgNavigate. | 1671 // can cause navigations to be ignored in OnMsgNavigate. |
1672 is_waiting_for_beforeunload_ack_ = false; | 1672 is_waiting_for_beforeunload_ack_ = false; |
1673 is_waiting_for_unload_ack_ = false; | 1673 is_waiting_for_unload_ack_ = false; |
1674 } | 1674 } |
1675 | 1675 |
1676 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1676 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
1677 STLDeleteValues(&power_save_blockers_); | 1677 STLDeleteValues(&power_save_blockers_); |
1678 } | 1678 } |
1679 | 1679 |
1680 } // namespace content | 1680 } // namespace content |
OLD | NEW |