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

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

Issue 2119973002: Port WebSockets to Mojo IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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_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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "content/browser/renderer_host/input/input_router_impl.h" 44 #include "content/browser/renderer_host/input/input_router_impl.h"
45 #include "content/browser/renderer_host/input/timeout_monitor.h" 45 #include "content/browser/renderer_host/input/timeout_monitor.h"
46 #include "content/browser/renderer_host/render_process_host_impl.h" 46 #include "content/browser/renderer_host/render_process_host_impl.h"
47 #include "content/browser/renderer_host/render_view_host_delegate.h" 47 #include "content/browser/renderer_host/render_view_host_delegate.h"
48 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 48 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
49 #include "content/browser/renderer_host/render_view_host_impl.h" 49 #include "content/browser/renderer_host/render_view_host_impl.h"
50 #include "content/browser/renderer_host/render_widget_host_delegate.h" 50 #include "content/browser/renderer_host/render_widget_host_delegate.h"
51 #include "content/browser/renderer_host/render_widget_host_impl.h" 51 #include "content/browser/renderer_host/render_widget_host_impl.h"
52 #include "content/browser/renderer_host/render_widget_host_view_base.h" 52 #include "content/browser/renderer_host/render_widget_host_view_base.h"
53 #include "content/browser/wake_lock/wake_lock_service_context.h" 53 #include "content/browser/wake_lock/wake_lock_service_context.h"
54 #include "content/browser/websocket/websocket_manager.h"
54 #include "content/browser/webui/web_ui_controller_factory_registry.h" 55 #include "content/browser/webui/web_ui_controller_factory_registry.h"
55 #include "content/common/accessibility_messages.h" 56 #include "content/common/accessibility_messages.h"
56 #include "content/common/frame_messages.h" 57 #include "content/common/frame_messages.h"
57 #include "content/common/input_messages.h" 58 #include "content/common/input_messages.h"
58 #include "content/common/inter_process_time_ticks_converter.h" 59 #include "content/common/inter_process_time_ticks_converter.h"
59 #include "content/common/navigation_params.h" 60 #include "content/common/navigation_params.h"
60 #include "content/common/site_isolation_policy.h" 61 #include "content/common/site_isolation_policy.h"
61 #include "content/common/swapped_out_messages.h" 62 #include "content/common/swapped_out_messages.h"
63 #include "content/common/websocket.mojom.h"
62 #include "content/public/browser/ax_event_notification_details.h" 64 #include "content/public/browser/ax_event_notification_details.h"
63 #include "content/public/browser/browser_accessibility_state.h" 65 #include "content/public/browser/browser_accessibility_state.h"
64 #include "content/public/browser/browser_context.h" 66 #include "content/public/browser/browser_context.h"
65 #include "content/public/browser/browser_plugin_guest_manager.h" 67 #include "content/public/browser/browser_plugin_guest_manager.h"
66 #include "content/public/browser/browser_thread.h" 68 #include "content/public/browser/browser_thread.h"
67 #include "content/public/browser/content_browser_client.h" 69 #include "content/public/browser/content_browser_client.h"
68 #include "content/public/browser/permission_manager.h" 70 #include "content/public/browser/permission_manager.h"
69 #include "content/public/browser/permission_type.h" 71 #include "content/public/browser/permission_type.h"
70 #include "content/public/browser/render_process_host.h" 72 #include "content/public/browser/render_process_host.h"
71 #include "content/public/browser/render_widget_host_view.h" 73 #include "content/public/browser/render_widget_host_view.h"
(...skipping 1952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 base::Unretained(permission_service_context_.get()))); 2026 base::Unretained(permission_service_context_.get())));
2025 2027
2026 GetServiceRegistry()->AddService(base::Bind( 2028 GetServiceRegistry()->AddService(base::Bind(
2027 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); 2029 &PresentationServiceImpl::CreateMojoService, base::Unretained(this)));
2028 2030
2029 #if !defined(OS_ANDROID) 2031 #if !defined(OS_ANDROID)
2030 GetServiceRegistry()->AddService( 2032 GetServiceRegistry()->AddService(
2031 base::Bind(&device::VibrationManagerImpl::Create)); 2033 base::Bind(&device::VibrationManagerImpl::Create));
2032 #endif 2034 #endif
2033 2035
2036 GetServiceRegistry()->AddService(
Ben Goodger (Google) 2016/07/01 21:19:51 When you rebase, you'll find that this is GetInte
darin (slow to review) 2016/07/06 16:57:21 Done.
2037 base::Bind(&RenderFrameHostImpl::CreateWebSocket,
2038 base::Unretained(this)));
Ben Goodger (Google) 2016/07/01 21:19:51 See: https://chromium.googlesource.com/chromium/sr
darin (slow to review) 2016/07/06 16:57:21 This is at odds with constructing the WebSocketMan
2039
2034 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch( 2040 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch(
2035 switches::kEnableWebBluetooth); 2041 switches::kEnableWebBluetooth);
2036 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) 2042 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
2037 enable_web_bluetooth = true; 2043 enable_web_bluetooth = true;
2038 #endif 2044 #endif
2039 2045
2040 if (enable_web_bluetooth) { 2046 if (enable_web_bluetooth) {
2041 GetServiceRegistry()->AddService( 2047 GetServiceRegistry()->AddService(
2042 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, 2048 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService,
2043 base::Unretained(this))); 2049 base::Unretained(this)));
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2923 // For the root frame tree node, also store the AXTreeID of the focused frame. 2929 // For the root frame tree node, also store the AXTreeID of the focused frame.
2924 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); 2930 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame();
2925 if (!focused_frame_tree_node) 2931 if (!focused_frame_tree_node)
2926 return; 2932 return;
2927 RenderFrameHostImpl* focused_frame = 2933 RenderFrameHostImpl* focused_frame =
2928 focused_frame_tree_node->current_frame_host(); 2934 focused_frame_tree_node->current_frame_host();
2929 DCHECK(focused_frame); 2935 DCHECK(focused_frame);
2930 dst->focused_tree_id = focused_frame->GetAXTreeID(); 2936 dst->focused_tree_id = focused_frame->GetAXTreeID();
2931 } 2937 }
2932 2938
2939 void RenderFrameHostImpl::CreateWebSocket(
2940 mojo::InterfaceRequest<mojom::WebSocket> request) {
2941 static_cast<RenderProcessHostImpl*>(process_)->websocket_manager()->
2942 CreateWebSocket(routing_id_, std::move(request));
2943 }
2944
2933 void RenderFrameHostImpl::CreateWebBluetoothService( 2945 void RenderFrameHostImpl::CreateWebBluetoothService(
2934 blink::mojom::WebBluetoothServiceRequest request) { 2946 blink::mojom::WebBluetoothServiceRequest request) {
2935 DCHECK(!web_bluetooth_service_); 2947 DCHECK(!web_bluetooth_service_);
2936 web_bluetooth_service_.reset( 2948 web_bluetooth_service_.reset(
2937 new WebBluetoothServiceImpl(this, std::move(request))); 2949 new WebBluetoothServiceImpl(this, std::move(request)));
2938 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the 2950 // RFHI owns web_bluetooth_service_ and web_bluetooth_service owns the
2939 // binding_ which may run the error handler. binding_ can't run the error 2951 // binding_ which may run the error handler. binding_ can't run the error
2940 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2952 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2941 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2953 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2942 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2954 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2943 } 2955 }
2944 2956
2945 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2957 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2946 web_bluetooth_service_.reset(); 2958 web_bluetooth_service_.reset();
2947 } 2959 }
2948 2960
2949 } // namespace content 2961 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698