| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 AssociatedInterfaceProvider* | 584 AssociatedInterfaceProvider* |
| 585 RenderFrameHostImpl::GetRemoteAssociatedInterfaces() { | 585 RenderFrameHostImpl::GetRemoteAssociatedInterfaces() { |
| 586 if (!remote_associated_interfaces_) { | 586 if (!remote_associated_interfaces_) { |
| 587 mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; | 587 mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; |
| 588 IPC::ChannelProxy* channel = GetProcess()->GetChannel(); | 588 IPC::ChannelProxy* channel = GetProcess()->GetChannel(); |
| 589 if (channel) { | 589 if (channel) { |
| 590 RenderProcessHostImpl* process = | 590 RenderProcessHostImpl* process = |
| 591 static_cast<RenderProcessHostImpl*>(GetProcess()); | 591 static_cast<RenderProcessHostImpl*>(GetProcess()); |
| 592 process->GetRemoteRouteProvider()->GetRoute( | 592 process->GetRemoteRouteProvider()->GetRoute( |
| 593 GetRoutingID(), | 593 GetRoutingID(), |
| 594 mojo::GetProxy(&remote_interfaces, channel->GetAssociatedGroup())); | 594 mojo::MakeRequest(&remote_interfaces, channel->GetAssociatedGroup())); |
| 595 } else { | 595 } else { |
| 596 // The channel may not be initialized in some tests environments. In this | 596 // The channel may not be initialized in some tests environments. In this |
| 597 // case we set up a dummy interface provider. | 597 // case we set up a dummy interface provider. |
| 598 mojo::GetDummyProxyForTesting(&remote_interfaces); | 598 mojo::GetDummyProxyForTesting(&remote_interfaces); |
| 599 } | 599 } |
| 600 remote_associated_interfaces_.reset(new AssociatedInterfaceProviderImpl( | 600 remote_associated_interfaces_.reset(new AssociatedInterfaceProviderImpl( |
| 601 std::move(remote_interfaces))); | 601 std::move(remote_interfaces))); |
| 602 } | 602 } |
| 603 return remote_associated_interfaces_.get(); | 603 return remote_associated_interfaces_.get(); |
| 604 } | 604 } |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 base::Bind(&RenderFrameHostImpl::OnRendererConnect, | 2634 base::Bind(&RenderFrameHostImpl::OnRendererConnect, |
| 2635 weak_ptr_factory_.GetWeakPtr())); | 2635 weak_ptr_factory_.GetWeakPtr())); |
| 2636 } | 2636 } |
| 2637 | 2637 |
| 2638 if (!GetProcess()->GetRemoteInterfaces()) | 2638 if (!GetProcess()->GetRemoteInterfaces()) |
| 2639 return; | 2639 return; |
| 2640 | 2640 |
| 2641 RegisterMojoInterfaces(); | 2641 RegisterMojoInterfaces(); |
| 2642 mojom::FrameFactoryPtr frame_factory; | 2642 mojom::FrameFactoryPtr frame_factory; |
| 2643 GetProcess()->GetRemoteInterfaces()->GetInterface(&frame_factory); | 2643 GetProcess()->GetRemoteInterfaces()->GetInterface(&frame_factory); |
| 2644 frame_factory->CreateFrame(routing_id_, GetProxy(&frame_), | 2644 frame_factory->CreateFrame(routing_id_, MakeRequest(&frame_), |
| 2645 frame_host_binding_.CreateInterfacePtrAndBind()); | 2645 frame_host_binding_.CreateInterfacePtrAndBind()); |
| 2646 | 2646 |
| 2647 service_manager::mojom::InterfaceProviderPtr remote_interfaces; | 2647 service_manager::mojom::InterfaceProviderPtr remote_interfaces; |
| 2648 service_manager::mojom::InterfaceProviderRequest remote_interfaces_request = | 2648 service_manager::mojom::InterfaceProviderRequest remote_interfaces_request = |
| 2649 GetProxy(&remote_interfaces); | 2649 MakeRequest(&remote_interfaces); |
| 2650 remote_interfaces_.reset(new service_manager::InterfaceProvider); | 2650 remote_interfaces_.reset(new service_manager::InterfaceProvider); |
| 2651 remote_interfaces_->Bind(std::move(remote_interfaces)); | 2651 remote_interfaces_->Bind(std::move(remote_interfaces)); |
| 2652 frame_->GetInterfaceProvider(std::move(remote_interfaces_request)); | 2652 frame_->GetInterfaceProvider(std::move(remote_interfaces_request)); |
| 2653 } | 2653 } |
| 2654 | 2654 |
| 2655 void RenderFrameHostImpl::InvalidateMojoConnection() { | 2655 void RenderFrameHostImpl::InvalidateMojoConnection() { |
| 2656 interface_registry_.reset(); | 2656 interface_registry_.reset(); |
| 2657 | 2657 |
| 2658 ServiceManagerConnection* service_manager_connection = | 2658 ServiceManagerConnection* service_manager_connection = |
| 2659 BrowserContext::GetServiceManagerConnectionFor( | 2659 BrowserContext::GetServiceManagerConnectionFor( |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3316 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3316 // There is no pending NavigationEntry in these cases, so pass 0 as the |
| 3317 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3317 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
| 3318 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3318 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
| 3319 return NavigationHandleImpl::Create( | 3319 return NavigationHandleImpl::Create( |
| 3320 params.url, frame_tree_node_, is_renderer_initiated, | 3320 params.url, frame_tree_node_, is_renderer_initiated, |
| 3321 params.was_within_same_page, base::TimeTicks::Now(), | 3321 params.was_within_same_page, base::TimeTicks::Now(), |
| 3322 entry_id_for_data_nav, false); // started_from_context_menu | 3322 entry_id_for_data_nav, false); // started_from_context_menu |
| 3323 } | 3323 } |
| 3324 | 3324 |
| 3325 } // namespace content | 3325 } // namespace content |
| OLD | NEW |