Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 367653002: Add a FrameHostMsg_BeginNavigation IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implemented the IPC handler Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "content/browser/child_process_security_policy_impl.h" 13 #include "content/browser/child_process_security_policy_impl.h"
14 #include "content/browser/devtools/render_view_devtools_agent_host.h" 14 #include "content/browser/devtools/render_view_devtools_agent_host.h"
15 #include "content/browser/frame_host/cross_site_transferring_request.h" 15 #include "content/browser/frame_host/cross_site_transferring_request.h"
16 #include "content/browser/frame_host/debug_urls.h" 16 #include "content/browser/frame_host/debug_urls.h"
17 #include "content/browser/frame_host/interstitial_page_impl.h" 17 #include "content/browser/frame_host/interstitial_page_impl.h"
18 #include "content/browser/frame_host/navigation_controller_impl.h" 18 #include "content/browser/frame_host/navigation_controller_impl.h"
19 #include "content/browser/frame_host/navigation_entry_impl.h" 19 #include "content/browser/frame_host/navigation_entry_impl.h"
20 #include "content/browser/frame_host/navigation_request.h"
21 #include "content/browser/frame_host/navigation_request_info.h"
20 #include "content/browser/frame_host/navigator.h" 22 #include "content/browser/frame_host/navigator.h"
21 #include "content/browser/frame_host/render_frame_host_factory.h" 23 #include "content/browser/frame_host/render_frame_host_factory.h"
22 #include "content/browser/frame_host/render_frame_host_impl.h" 24 #include "content/browser/frame_host/render_frame_host_impl.h"
23 #include "content/browser/frame_host/render_frame_proxy_host.h" 25 #include "content/browser/frame_host/render_frame_proxy_host.h"
24 #include "content/browser/renderer_host/render_process_host_impl.h" 26 #include "content/browser/renderer_host/render_process_host_impl.h"
25 #include "content/browser/renderer_host/render_view_host_factory.h" 27 #include "content/browser/renderer_host/render_view_host_factory.h"
26 #include "content/browser/renderer_host/render_view_host_impl.h" 28 #include "content/browser/renderer_host/render_view_host_impl.h"
27 #include "content/browser/site_instance_impl.h" 29 #include "content/browser/site_instance_impl.h"
28 #include "content/browser/webui/web_ui_controller_factory_registry.h" 30 #include "content/browser/webui/web_ui_controller_factory_registry.h"
29 #include "content/browser/webui/web_ui_impl.h" 31 #include "content/browser/webui/web_ui_impl.h"
32 #include "content/common/frame_messages.h"
30 #include "content/common/view_messages.h" 33 #include "content/common/view_messages.h"
31 #include "content/public/browser/content_browser_client.h" 34 #include "content/public/browser/content_browser_client.h"
32 #include "content/public/browser/notification_service.h" 35 #include "content/public/browser/notification_service.h"
33 #include "content/public/browser/notification_types.h" 36 #include "content/public/browser/notification_types.h"
34 #include "content/public/browser/render_widget_host_iterator.h" 37 #include "content/public/browser/render_widget_host_iterator.h"
35 #include "content/public/browser/render_widget_host_view.h" 38 #include "content/public/browser/render_widget_host_view.h"
36 #include "content/public/browser/user_metrics.h" 39 #include "content/public/browser/user_metrics.h"
37 #include "content/public/browser/web_ui_controller.h" 40 #include "content/public/browser/web_ui_controller.h"
38 #include "content/public/common/content_switches.h" 41 #include "content/public/common/content_switches.h"
39 #include "content/public/common/url_constants.h" 42 #include "content/public/common/url_constants.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 RFHPendingDeleteMap::iterator iter = 563 RFHPendingDeleteMap::iterator iter =
561 pending_delete_hosts_.find(site_instance_id); 564 pending_delete_hosts_.find(site_instance_id);
562 if (iter != pending_delete_hosts_.end() && iter->second.get() == rfh) 565 if (iter != pending_delete_hosts_.end() && iter->second.get() == rfh)
563 pending_delete_hosts_.erase(site_instance_id); 566 pending_delete_hosts_.erase(site_instance_id);
564 } 567 }
565 568
566 void RenderFrameHostManager::ResetProxyHosts() { 569 void RenderFrameHostManager::ResetProxyHosts() {
567 STLDeleteValues(&proxy_hosts_); 570 STLDeleteValues(&proxy_hosts_);
568 } 571 }
569 572
573 void RenderFrameHostManager::BeginNavigation(
574 const FrameHostMsg_BeginNavigation_Params& params) {
575 NavigationRequestInfo info(params);
576 FrameTreeNode* node = render_frame_host_->frame_tree_node();
577
578 info.first_party_for_cookies = node->IsMainFrame() ?
579 params.url : node->frame_tree()->root()->current_url();
580 info.is_main_frame = node->IsMainFrame();
581 info.parent_is_main_frame = node->parent()->IsMainFrame();
582 info.is_showing = GetRenderWidgetHostView()->IsShowing();
583
584 navigation_request_.reset(new NavigationRequest());
585 navigation_request_->BeginNavigation(
586 info, params.request_body, node->frame_tree_node_id());
587 }
588
570 void RenderFrameHostManager::Observe( 589 void RenderFrameHostManager::Observe(
571 int type, 590 int type,
572 const NotificationSource& source, 591 const NotificationSource& source,
573 const NotificationDetails& details) { 592 const NotificationDetails& details) {
574 switch (type) { 593 switch (type) {
575 case NOTIFICATION_RENDERER_PROCESS_CLOSED: 594 case NOTIFICATION_RENDERER_PROCESS_CLOSED:
576 case NOTIFICATION_RENDERER_PROCESS_CLOSING: 595 case NOTIFICATION_RENDERER_PROCESS_CLOSING:
577 RendererProcessClosing( 596 RendererProcessClosing(
578 Source<RenderProcessHost>(source).ptr()); 597 Source<RenderProcessHost>(source).ptr());
579 break; 598 break;
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 SiteInstance* instance) const { 1503 SiteInstance* instance) const {
1485 RenderFrameProxyHostMap::const_iterator iter = 1504 RenderFrameProxyHostMap::const_iterator iter =
1486 proxy_hosts_.find(instance->GetId()); 1505 proxy_hosts_.find(instance->GetId());
1487 if (iter != proxy_hosts_.end()) 1506 if (iter != proxy_hosts_.end())
1488 return iter->second; 1507 return iter->second;
1489 1508
1490 return NULL; 1509 return NULL;
1491 } 1510 }
1492 1511
1493 } // namespace content 1512 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698