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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2821203005: Add a mojo implementation of AudioOutputIPC. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5991bde2b7d391a939795b39bcf23c865611d58f..5505afa585356260c1d78f4589370ab23bf02698 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -62,6 +62,7 @@
#include "content/common/frame_owner_properties.h"
#include "content/common/frame_replication_state.h"
#include "content/common/input_messages.h"
+#include "content/common/media/renderer_audio_output_stream_factory.mojom.h"
#include "content/common/navigation_params.h"
#include "content/common/page_messages.h"
#include "content/common/savable_subframe.h"
@@ -114,6 +115,7 @@
#include "content/renderer/internal_document_state_data.h"
#include "content/renderer/manifest/manifest_manager.h"
#include "content/renderer/media/audio_device_factory.h"
+#include "content/renderer/media/audio_ipc_factory.h"
#include "content/renderer/media/media_devices_listener_impl.h"
#include "content/renderer/media/media_permission_dispatcher.h"
#include "content/renderer/media/media_stream_dispatcher.h"
@@ -1220,6 +1222,12 @@ RenderFrameImpl::~RenderFrameImpl() {
if (input_handler_manager)
input_handler_manager->UnregisterRoutingID(GetRoutingID());
+ if (base::FeatureList::IsEnabled(
o1ka 2017/04/20 10:36:00 Hide register/deregister logic in static methods o
Max Morin 2017/05/05 13:10:59 Done.
+ features::kUseMojoAudioOutputStreamFactory) &&
+ render_thread) {
+ AudioIPCFactory::get()->DeregisterRemoteFactory(GetRoutingID());
+ }
+
if (is_main_frame_) {
// Ensure the RenderView doesn't point to this object, once it is destroyed.
// TODO(nasko): Add a check that the |main_render_frame_| of |render_view_|
@@ -1293,6 +1301,15 @@ void RenderFrameImpl::Initialize() {
GetRoutingID(), render_view_->GetRoutingID());
}
+ if (base::FeatureList::IsEnabled(
+ features::kUseMojoAudioOutputStreamFactory) &&
+ render_thread) {
+ mojom::RendererAudioOutputStreamFactoryPtr factory_ptr;
+ GetRemoteInterfaces()->GetInterface(&factory_ptr);
+ AudioIPCFactory::get()->RegisterRemoteFactory(GetRoutingID(),
+ std::move(factory_ptr));
+ }
+
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDomAutomationController))

Powered by Google App Engine
This is Rietveld 408576698