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

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

Issue 1930393002: Switch stream creation and closing in Chrome audio rendering from IPC to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 20 matching lines...) Expand all
31 #include "content/browser/frame_host/frame_tree_node.h" 31 #include "content/browser/frame_host/frame_tree_node.h"
32 #include "content/browser/frame_host/navigation_handle_impl.h" 32 #include "content/browser/frame_host/navigation_handle_impl.h"
33 #include "content/browser/frame_host/navigation_request.h" 33 #include "content/browser/frame_host/navigation_request.h"
34 #include "content/browser/frame_host/navigator.h" 34 #include "content/browser/frame_host/navigator.h"
35 #include "content/browser/frame_host/navigator_impl.h" 35 #include "content/browser/frame_host/navigator_impl.h"
36 #include "content/browser/frame_host/render_frame_host_delegate.h" 36 #include "content/browser/frame_host/render_frame_host_delegate.h"
37 #include "content/browser/frame_host/render_frame_proxy_host.h" 37 #include "content/browser/frame_host/render_frame_proxy_host.h"
38 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 38 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
39 #include "content/browser/geolocation/geolocation_service_context.h" 39 #include "content/browser/geolocation/geolocation_service_context.h"
40 #include "content/browser/loader/resource_dispatcher_host_impl.h" 40 #include "content/browser/loader/resource_dispatcher_host_impl.h"
41 #include "content/browser/media/audio_output_impl.h"
41 #include "content/browser/permissions/permission_service_context.h" 42 #include "content/browser/permissions/permission_service_context.h"
42 #include "content/browser/permissions/permission_service_impl.h" 43 #include "content/browser/permissions/permission_service_impl.h"
43 #include "content/browser/presentation/presentation_service_impl.h" 44 #include "content/browser/presentation/presentation_service_impl.h"
44 #include "content/browser/renderer_host/input/input_router_impl.h" 45 #include "content/browser/renderer_host/input/input_router_impl.h"
45 #include "content/browser/renderer_host/input/timeout_monitor.h" 46 #include "content/browser/renderer_host/input/timeout_monitor.h"
46 #include "content/browser/renderer_host/render_process_host_impl.h" 47 #include "content/browser/renderer_host/render_process_host_impl.h"
47 #include "content/browser/renderer_host/render_view_host_delegate.h" 48 #include "content/browser/renderer_host/render_view_host_delegate.h"
48 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 49 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
49 #include "content/browser/renderer_host/render_view_host_impl.h" 50 #include "content/browser/renderer_host/render_view_host_impl.h"
50 #include "content/browser/renderer_host/render_widget_host_delegate.h" 51 #include "content/browser/renderer_host/render_widget_host_delegate.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 render_widget_host_->owned_by_render_frame_host()) { 288 render_widget_host_->owned_by_render_frame_host()) {
288 // Shutdown causes the RenderWidgetHost to delete itself. 289 // Shutdown causes the RenderWidgetHost to delete itself.
289 render_widget_host_->ShutdownAndDestroyWidget(true); 290 render_widget_host_->ShutdownAndDestroyWidget(true);
290 } 291 }
291 292
292 // Notify the FrameTree that this RFH is going away, allowing it to shut down 293 // Notify the FrameTree that this RFH is going away, allowing it to shut down
293 // the corresponding RenderViewHost if it is no longer needed. 294 // the corresponding RenderViewHost if it is no longer needed.
294 frame_tree_->ReleaseRenderViewHostRef(render_view_host_); 295 frame_tree_->ReleaseRenderViewHostRef(render_view_host_);
295 } 296 }
296 297
298 AudioOutputImpl* RenderFrameHostImpl::GetAudioOutputImpl() {
299 return audio_output_impl_;
300 }
301
302 void RenderFrameHostImpl::SetAudioOutputImpl(
303 AudioOutputImpl* audio_output_impl) {
304 audio_output_impl_ = audio_output_impl;
305 }
306
297 int RenderFrameHostImpl::GetRoutingID() { 307 int RenderFrameHostImpl::GetRoutingID() {
298 return routing_id_; 308 return routing_id_;
299 } 309 }
300 310
301 AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::GetAXTreeID() { 311 AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::GetAXTreeID() {
302 return AXTreeIDRegistry::GetInstance()->GetOrCreateAXTreeID( 312 return AXTreeIDRegistry::GetInstance()->GetOrCreateAXTreeID(
303 GetProcess()->GetID(), routing_id_); 313 GetProcess()->GetID(), routing_id_);
304 } 314 }
305 315
306 SiteInstanceImpl* RenderFrameHostImpl::GetSiteInstance() { 316 SiteInstanceImpl* RenderFrameHostImpl::GetSiteInstance() {
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, 1937 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService,
1928 base::Unretained(this))); 1938 base::Unretained(this)));
1929 } 1939 }
1930 1940
1931 if (!frame_mojo_shell_) 1941 if (!frame_mojo_shell_)
1932 frame_mojo_shell_.reset(new FrameMojoShell(this)); 1942 frame_mojo_shell_.reset(new FrameMojoShell(this));
1933 1943
1934 GetServiceRegistry()->AddService<shell::mojom::Connector>(base::Bind( 1944 GetServiceRegistry()->AddService<shell::mojom::Connector>(base::Bind(
1935 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get()))); 1945 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get())));
1936 1946
1947 GetServiceRegistry()->AddService(
1948 base::Bind(&AudioOutputImpl::CreateService, process_, routing_id_));
1949
1937 #if defined(ENABLE_WEBVR) 1950 #if defined(ENABLE_WEBVR)
1938 const base::CommandLine& browser_command_line = 1951 const base::CommandLine& browser_command_line =
1939 *base::CommandLine::ForCurrentProcess(); 1952 *base::CommandLine::ForCurrentProcess();
1940 1953
1941 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { 1954 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) {
1942 GetServiceRegistry()->AddService<blink::mojom::VRService>( 1955 GetServiceRegistry()->AddService<blink::mojom::VRService>(
1943 base::Bind(&VRDeviceManager::BindRequest)); 1956 base::Bind(&VRDeviceManager::BindRequest));
1944 } 1957 }
1945 #endif 1958 #endif
1946 1959
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2777 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2765 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2778 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2766 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2779 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2767 } 2780 }
2768 2781
2769 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2782 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2770 web_bluetooth_service_.reset(); 2783 web_bluetooth_service_.reset();
2771 } 2784 }
2772 2785
2773 } // namespace content 2786 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698