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

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: use wrap 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 21 matching lines...) Expand all
32 #include "content/browser/frame_host/navigation_entry_impl.h" 32 #include "content/browser/frame_host/navigation_entry_impl.h"
33 #include "content/browser/frame_host/navigation_handle_impl.h" 33 #include "content/browser/frame_host/navigation_handle_impl.h"
34 #include "content/browser/frame_host/navigation_request.h" 34 #include "content/browser/frame_host/navigation_request.h"
35 #include "content/browser/frame_host/navigator.h" 35 #include "content/browser/frame_host/navigator.h"
36 #include "content/browser/frame_host/navigator_impl.h" 36 #include "content/browser/frame_host/navigator_impl.h"
37 #include "content/browser/frame_host/render_frame_host_delegate.h" 37 #include "content/browser/frame_host/render_frame_host_delegate.h"
38 #include "content/browser/frame_host/render_frame_proxy_host.h" 38 #include "content/browser/frame_host/render_frame_proxy_host.h"
39 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 39 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
40 #include "content/browser/geolocation/geolocation_service_context.h" 40 #include "content/browser/geolocation/geolocation_service_context.h"
41 #include "content/browser/loader/resource_dispatcher_host_impl.h" 41 #include "content/browser/loader/resource_dispatcher_host_impl.h"
42 #include "content/browser/media/audio_output_impl.h"
42 #include "content/browser/permissions/permission_service_context.h" 43 #include "content/browser/permissions/permission_service_context.h"
43 #include "content/browser/permissions/permission_service_impl.h" 44 #include "content/browser/permissions/permission_service_impl.h"
44 #include "content/browser/presentation/presentation_service_impl.h" 45 #include "content/browser/presentation/presentation_service_impl.h"
45 #include "content/browser/renderer_host/input/input_router_impl.h" 46 #include "content/browser/renderer_host/input/input_router_impl.h"
46 #include "content/browser/renderer_host/input/timeout_monitor.h" 47 #include "content/browser/renderer_host/input/timeout_monitor.h"
47 #include "content/browser/renderer_host/render_process_host_impl.h" 48 #include "content/browser/renderer_host/render_process_host_impl.h"
48 #include "content/browser/renderer_host/render_view_host_delegate.h" 49 #include "content/browser/renderer_host/render_view_host_delegate.h"
49 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 50 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
50 #include "content/browser/renderer_host/render_view_host_impl.h" 51 #include "content/browser/renderer_host/render_view_host_impl.h"
51 #include "content/browser/renderer_host/render_widget_host_delegate.h" 52 #include "content/browser/renderer_host/render_widget_host_delegate.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 render_widget_host_->owned_by_render_frame_host()) { 312 render_widget_host_->owned_by_render_frame_host()) {
312 // Shutdown causes the RenderWidgetHost to delete itself. 313 // Shutdown causes the RenderWidgetHost to delete itself.
313 render_widget_host_->ShutdownAndDestroyWidget(true); 314 render_widget_host_->ShutdownAndDestroyWidget(true);
314 } 315 }
315 316
316 // Notify the FrameTree that this RFH is going away, allowing it to shut down 317 // Notify the FrameTree that this RFH is going away, allowing it to shut down
317 // the corresponding RenderViewHost if it is no longer needed. 318 // the corresponding RenderViewHost if it is no longer needed.
318 frame_tree_->ReleaseRenderViewHostRef(render_view_host_); 319 frame_tree_->ReleaseRenderViewHostRef(render_view_host_);
319 } 320 }
320 321
322 AudioOutputImpl* RenderFrameHostImpl::GetAudioOutputImpl() {
323 return audio_output_impl_;
324 }
325
326 void RenderFrameHostImpl::SetAudioOutputImpl(
327 AudioOutputImpl* audio_output_impl) {
328 audio_output_impl_ = audio_output_impl;
329 }
330
321 int RenderFrameHostImpl::GetRoutingID() { 331 int RenderFrameHostImpl::GetRoutingID() {
322 return routing_id_; 332 return routing_id_;
323 } 333 }
324 334
325 AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::GetAXTreeID() { 335 AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::GetAXTreeID() {
326 return AXTreeIDRegistry::GetInstance()->GetOrCreateAXTreeID( 336 return AXTreeIDRegistry::GetInstance()->GetOrCreateAXTreeID(
327 GetProcess()->GetID(), routing_id_); 337 GetProcess()->GetID(), routing_id_);
328 } 338 }
329 339
330 SiteInstanceImpl* RenderFrameHostImpl::GetSiteInstance() { 340 SiteInstanceImpl* RenderFrameHostImpl::GetSiteInstance() {
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, 1978 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService,
1969 base::Unretained(this))); 1979 base::Unretained(this)));
1970 } 1980 }
1971 1981
1972 if (!frame_mojo_shell_) 1982 if (!frame_mojo_shell_)
1973 frame_mojo_shell_.reset(new FrameMojoShell(this)); 1983 frame_mojo_shell_.reset(new FrameMojoShell(this));
1974 1984
1975 GetServiceRegistry()->AddService<shell::mojom::Connector>(base::Bind( 1985 GetServiceRegistry()->AddService<shell::mojom::Connector>(base::Bind(
1976 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get()))); 1986 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get())));
1977 1987
1988 GetServiceRegistry()->AddService(
1989 base::Bind(&AudioOutputImpl::CreateService, process_, routing_id_));
1990
1978 #if defined(ENABLE_WEBVR) 1991 #if defined(ENABLE_WEBVR)
1979 const base::CommandLine& browser_command_line = 1992 const base::CommandLine& browser_command_line =
1980 *base::CommandLine::ForCurrentProcess(); 1993 *base::CommandLine::ForCurrentProcess();
1981 1994
1982 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { 1995 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) {
1983 GetServiceRegistry()->AddService<blink::mojom::VRService>( 1996 GetServiceRegistry()->AddService<blink::mojom::VRService>(
1984 base::Bind(&VRDeviceManager::BindRequest)); 1997 base::Bind(&VRDeviceManager::BindRequest));
1985 } 1998 }
1986 #endif 1999 #endif
1987 2000
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2825 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2813 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2826 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2814 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2827 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2815 } 2828 }
2816 2829
2817 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2830 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2818 web_bluetooth_service_.reset(); 2831 web_bluetooth_service_.reset();
2819 } 2832 }
2820 2833
2821 } // namespace content 2834 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698