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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, | 388 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, |
389 OnVisualStateResponse) | 389 OnVisualStateResponse) |
390 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, | 390 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, |
391 OnRunJavaScriptMessage) | 391 OnRunJavaScriptMessage) |
392 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, | 392 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, |
393 OnRunBeforeUnloadConfirm) | 393 OnRunBeforeUnloadConfirm) |
394 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, | 394 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, |
395 OnDidAccessInitialDocument) | 395 OnDidAccessInitialDocument) |
396 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) | 396 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) |
397 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName) | 397 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName) |
398 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId) | |
399 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags, | 398 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags, |
400 OnDidChangeSandboxFlags) | 399 OnDidChangeSandboxFlags) |
401 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) | 400 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) |
402 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) | 401 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) |
403 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, | 402 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, |
404 OnBeginNavigation) | 403 OnBeginNavigation) |
405 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) | 404 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) |
406 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, | 405 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, |
407 OnTextSurroundingSelectionResponse) | 406 OnTextSurroundingSelectionResponse) |
408 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 407 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 // This message is only sent for top-level frames. TODO(avi): when frame tree | 1237 // This message is only sent for top-level frames. TODO(avi): when frame tree |
1239 // mirroring works correctly, add a check here to enforce it. | 1238 // mirroring works correctly, add a check here to enforce it. |
1240 delegate_->DidDisownOpener(this); | 1239 delegate_->DidDisownOpener(this); |
1241 } | 1240 } |
1242 | 1241 |
1243 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { | 1242 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { |
1244 frame_tree_node()->SetFrameName(name); | 1243 frame_tree_node()->SetFrameName(name); |
1245 delegate_->DidChangeName(this, name); | 1244 delegate_->DidChangeName(this, name); |
1246 } | 1245 } |
1247 | 1246 |
1248 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { | |
1249 // Update the RVH's current page ID so that future IPCs from the renderer | |
1250 // correspond to the new page. | |
1251 render_view_host_->page_id_ = page_id; | |
1252 } | |
1253 | |
1254 void RenderFrameHostImpl::OnDidChangeSandboxFlags(int32 frame_routing_id, | 1247 void RenderFrameHostImpl::OnDidChangeSandboxFlags(int32 frame_routing_id, |
1255 SandboxFlags flags) { | 1248 SandboxFlags flags) { |
1256 FrameTree* frame_tree = frame_tree_node()->frame_tree(); | 1249 FrameTree* frame_tree = frame_tree_node()->frame_tree(); |
1257 FrameTreeNode* child = | 1250 FrameTreeNode* child = |
1258 frame_tree->FindByRoutingID(GetProcess()->GetID(), frame_routing_id); | 1251 frame_tree->FindByRoutingID(GetProcess()->GetID(), frame_routing_id); |
1259 if (!child) | 1252 if (!child) |
1260 return; | 1253 return; |
1261 | 1254 |
1262 // Ensure that a frame can only update sandbox flags for its immediate | 1255 // Ensure that a frame can only update sandbox flags for its immediate |
1263 // children. If this is not the case, the renderer is considered malicious | 1256 // children. If this is not the case, the renderer is considered malicious |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2092 // We may be returning to an existing NavigationEntry that had been granted | 2085 // We may be returning to an existing NavigationEntry that had been granted |
2093 // file access. If this is a different process, we will need to grant the | 2086 // file access. If this is a different process, we will need to grant the |
2094 // access again. The files listed in the page state are validated when they | 2087 // access again. The files listed in the page state are validated when they |
2095 // are received from the renderer to prevent abuse. | 2088 // are received from the renderer to prevent abuse. |
2096 if (request_params.page_state.IsValid()) { | 2089 if (request_params.page_state.IsValid()) { |
2097 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); | 2090 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); |
2098 } | 2091 } |
2099 } | 2092 } |
2100 | 2093 |
2101 } // namespace content | 2094 } // namespace content |
OLD | NEW |