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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 bool handled = true; | 341 bool handled = true; |
342 IPC_BEGIN_MESSAGE_MAP(RenderFrameHostImpl, msg) | 342 IPC_BEGIN_MESSAGE_MAP(RenderFrameHostImpl, msg) |
343 IPC_MESSAGE_HANDLER(FrameHostMsg_AddMessageToConsole, OnAddMessageToConsole) | 343 IPC_MESSAGE_HANDLER(FrameHostMsg_AddMessageToConsole, OnAddMessageToConsole) |
344 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) | 344 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) |
345 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused) | 345 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused) |
346 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, | 346 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, |
347 OnDidStartProvisionalLoadForFrame) | 347 OnDidStartProvisionalLoadForFrame) |
348 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, | 348 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, |
349 OnDidFailProvisionalLoadWithError) | 349 OnDidFailProvisionalLoadWithError) |
350 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRedirectProvisionalLoad, | |
351 OnDidRedirectProvisionalLoad) | |
352 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, | 350 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, |
353 OnDidFailLoadWithError) | 351 OnDidFailLoadWithError) |
354 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, | 352 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, |
355 OnDidCommitProvisionalLoad(msg)) | 353 OnDidCommitProvisionalLoad(msg)) |
356 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) | 354 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) |
357 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, | 355 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, |
358 OnDocumentOnLoadCompleted) | 356 OnDocumentOnLoadCompleted) |
359 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) | 357 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) |
360 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) | 358 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) |
361 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) | 359 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 const GURL& url, | 637 const GURL& url, |
640 int error_code, | 638 int error_code, |
641 const base::string16& error_description) { | 639 const base::string16& error_description) { |
642 GURL validated_url(url); | 640 GURL validated_url(url); |
643 GetProcess()->FilterURL(false, &validated_url); | 641 GetProcess()->FilterURL(false, &validated_url); |
644 | 642 |
645 frame_tree_node_->navigator()->DidFailLoadWithError( | 643 frame_tree_node_->navigator()->DidFailLoadWithError( |
646 this, validated_url, error_code, error_description); | 644 this, validated_url, error_code, error_description); |
647 } | 645 } |
648 | 646 |
649 void RenderFrameHostImpl::OnDidRedirectProvisionalLoad( | |
650 int32 page_id, | |
651 const GURL& source_url, | |
652 const GURL& target_url) { | |
653 frame_tree_node_->navigator()->DidRedirectProvisionalLoad( | |
654 this, page_id, source_url, target_url); | |
655 } | |
656 | |
657 // Called when the renderer navigates. For every frame loaded, we'll get this | 647 // Called when the renderer navigates. For every frame loaded, we'll get this |
658 // notification containing parameters identifying the navigation. | 648 // notification containing parameters identifying the navigation. |
659 // | 649 // |
660 // Subframes are identified by the page transition type. For subframes loaded | 650 // Subframes are identified by the page transition type. For subframes loaded |
661 // as part of a wider page load, the page_id will be the same as for the top | 651 // as part of a wider page load, the page_id will be the same as for the top |
662 // level frame. If the user explicitly requests a subframe navigation, we will | 652 // level frame. If the user explicitly requests a subframe navigation, we will |
663 // get a new page_id because we need to create a new navigation entry for that | 653 // get a new page_id because we need to create a new navigation entry for that |
664 // action. | 654 // action. |
665 void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) { | 655 void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) { |
666 // Read the parameters out of the IPC message directly to avoid making another | 656 // Read the parameters out of the IPC message directly to avoid making another |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1474 // Clear any state if a pending navigation is canceled or preempted. | 1464 // Clear any state if a pending navigation is canceled or preempted. |
1475 if (suspended_nav_params_) | 1465 if (suspended_nav_params_) |
1476 suspended_nav_params_.reset(); | 1466 suspended_nav_params_.reset(); |
1477 | 1467 |
1478 TRACE_EVENT_ASYNC_END0("navigation", | 1468 TRACE_EVENT_ASYNC_END0("navigation", |
1479 "RenderFrameHostImpl navigation suspended", this); | 1469 "RenderFrameHostImpl navigation suspended", this); |
1480 navigations_suspended_ = false; | 1470 navigations_suspended_ = false; |
1481 } | 1471 } |
1482 | 1472 |
1483 } // namespace content | 1473 } // namespace content |
OLD | NEW |