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

Side by Side Diff: trunk/src/content/browser/frame_host/render_frame_host_impl.cc

Issue 352013002: Revert 279557 "Support exposing Mojo services between render fra..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | Annotate | Revision Log
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_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/containers/hash_tables.h" 8 #include "base/containers/hash_tables.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/user_metrics_action.h" 10 #include "base/metrics/user_metrics_action.h"
11 #include "content/browser/child_process_security_policy_impl.h" 11 #include "content/browser/child_process_security_policy_impl.h"
12 #include "content/browser/frame_host/cross_process_frame_connector.h" 12 #include "content/browser/frame_host/cross_process_frame_connector.h"
13 #include "content/browser/frame_host/cross_site_transferring_request.h" 13 #include "content/browser/frame_host/cross_site_transferring_request.h"
14 #include "content/browser/frame_host/frame_tree.h" 14 #include "content/browser/frame_host/frame_tree.h"
15 #include "content/browser/frame_host/frame_tree_node.h" 15 #include "content/browser/frame_host/frame_tree_node.h"
16 #include "content/browser/frame_host/navigator.h" 16 #include "content/browser/frame_host/navigator.h"
17 #include "content/browser/frame_host/render_frame_host_delegate.h" 17 #include "content/browser/frame_host/render_frame_host_delegate.h"
18 #include "content/browser/frame_host/render_frame_proxy_host.h" 18 #include "content/browser/frame_host/render_frame_proxy_host.h"
19 #include "content/browser/renderer_host/input/input_router.h" 19 #include "content/browser/renderer_host/input/input_router.h"
20 #include "content/browser/renderer_host/input/timeout_monitor.h" 20 #include "content/browser/renderer_host/input/timeout_monitor.h"
21 #include "content/browser/renderer_host/render_process_host_impl.h"
22 #include "content/browser/renderer_host/render_view_host_impl.h" 21 #include "content/browser/renderer_host/render_view_host_impl.h"
23 #include "content/browser/renderer_host/render_widget_host_impl.h" 22 #include "content/browser/renderer_host/render_widget_host_impl.h"
24 #include "content/browser/transition_request_manager.h" 23 #include "content/browser/transition_request_manager.h"
25 #include "content/common/desktop_notification_messages.h" 24 #include "content/common/desktop_notification_messages.h"
26 #include "content/common/frame_messages.h" 25 #include "content/common/frame_messages.h"
27 #include "content/common/input_messages.h" 26 #include "content/common/input_messages.h"
28 #include "content/common/inter_process_time_ticks_converter.h" 27 #include "content/common/inter_process_time_ticks_converter.h"
29 #include "content/common/render_frame_setup.mojom.h"
30 #include "content/common/swapped_out_messages.h" 28 #include "content/common/swapped_out_messages.h"
31 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/content_browser_client.h" 30 #include "content/public/browser/content_browser_client.h"
33 #include "content/public/browser/desktop_notification_delegate.h" 31 #include "content/public/browser/desktop_notification_delegate.h"
34 #include "content/public/browser/render_process_host.h" 32 #include "content/public/browser/render_process_host.h"
35 #include "content/public/browser/render_widget_host_view.h" 33 #include "content/public/browser/render_widget_host_view.h"
36 #include "content/public/browser/user_metrics.h" 34 #include "content/public/browser/user_metrics.h"
37 #include "content/public/common/content_constants.h" 35 #include "content/public/common/content_constants.h"
38 #include "content/public/common/url_constants.h" 36 #include "content/public/common/url_constants.h"
39 #include "content/public/common/url_utils.h" 37 #include "content/public/common/url_utils.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 frame_tree_(frame_tree), 155 frame_tree_(frame_tree),
158 frame_tree_node_(frame_tree_node), 156 frame_tree_node_(frame_tree_node),
159 routing_id_(routing_id), 157 routing_id_(routing_id),
160 is_swapped_out_(is_swapped_out), 158 is_swapped_out_(is_swapped_out),
161 weak_ptr_factory_(this) { 159 weak_ptr_factory_(this) {
162 frame_tree_->RegisterRenderFrameHost(this); 160 frame_tree_->RegisterRenderFrameHost(this);
163 GetProcess()->AddRoute(routing_id_, this); 161 GetProcess()->AddRoute(routing_id_, this);
164 g_routing_id_frame_map.Get().insert(std::make_pair( 162 g_routing_id_frame_map.Get().insert(std::make_pair(
165 RenderFrameHostID(GetProcess()->GetID(), routing_id_), 163 RenderFrameHostID(GetProcess()->GetID(), routing_id_),
166 this)); 164 this));
167
168 if (GetProcess()->GetServiceRegistry()) {
169 RenderFrameSetupPtr setup;
170 GetProcess()->GetServiceRegistry()->GetRemoteInterface(&setup);
171 mojo::IInterfaceProviderPtr service_provider;
172 setup->GetServiceProviderForFrame(routing_id_,
173 mojo::Get(&service_provider));
174 service_registry_.BindRemoteServiceProvider(
175 service_provider.PassMessagePipe());
176 }
177 } 165 }
178 166
179 RenderFrameHostImpl::~RenderFrameHostImpl() { 167 RenderFrameHostImpl::~RenderFrameHostImpl() {
180 GetProcess()->RemoveRoute(routing_id_); 168 GetProcess()->RemoveRoute(routing_id_);
181 g_routing_id_frame_map.Get().erase( 169 g_routing_id_frame_map.Get().erase(
182 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); 170 RenderFrameHostID(GetProcess()->GetID(), routing_id_));
183 if (delegate_) 171 if (delegate_)
184 delegate_->RenderFrameDeleted(this); 172 delegate_->RenderFrameDeleted(this);
185 173
186 // Notify the FrameTree that this RFH is going away, allowing it to shut down 174 // Notify the FrameTree that this RFH is going away, allowing it to shut down
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 Send(new FrameMsg_JavaScriptExecuteRequest(routing_id_, 235 Send(new FrameMsg_JavaScriptExecuteRequest(routing_id_,
248 javascript, 236 javascript,
249 key, true)); 237 key, true));
250 javascript_callbacks_.insert(std::make_pair(key, callback)); 238 javascript_callbacks_.insert(std::make_pair(key, callback));
251 } 239 }
252 240
253 RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() { 241 RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() {
254 return render_view_host_; 242 return render_view_host_;
255 } 243 }
256 244
257 ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() {
258 static_cast<RenderProcessHostImpl*>(GetProcess())->EnsureMojoActivated();
259 return &service_registry_;
260 }
261
262 bool RenderFrameHostImpl::Send(IPC::Message* message) { 245 bool RenderFrameHostImpl::Send(IPC::Message* message) {
263 if (IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart) { 246 if (IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart) {
264 return render_view_host_->input_router()->SendInput( 247 return render_view_host_->input_router()->SendInput(
265 make_scoped_ptr(message)); 248 make_scoped_ptr(message));
266 } 249 }
267 250
268 if (render_view_host_->IsSwappedOut()) { 251 if (render_view_host_->IsSwappedOut()) {
269 DCHECK(render_frame_proxy_host_); 252 DCHECK(render_frame_proxy_host_);
270 return render_frame_proxy_host_->Send(message); 253 return render_frame_proxy_host_->Send(message);
271 } 254 }
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 FROM_HERE, 927 FROM_HERE,
945 base::Bind( 928 base::Bind(
946 &TransitionRequestManager::SetHasPendingTransitionRequest, 929 &TransitionRequestManager::SetHasPendingTransitionRequest,
947 base::Unretained(TransitionRequestManager::GetInstance()), 930 base::Unretained(TransitionRequestManager::GetInstance()),
948 GetProcess()->GetID(), 931 GetProcess()->GetID(),
949 routing_id_, 932 routing_id_,
950 has_pending_request)); 933 has_pending_request));
951 } 934 }
952 935
953 } // namespace content 936 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/browser/frame_host/render_frame_host_impl.h ('k') | trunk/src/content/browser/mojo/mojo_application_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698