Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index 80a60c017e7694c80b6632ff6461dfb5b60f444c..228ce8aecff12916ac1bc666a9c93cdc484cbef0 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -63,6 +63,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" |
@@ -116,6 +117,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" |
@@ -1227,6 +1229,9 @@ RenderFrameImpl::~RenderFrameImpl() { |
if (input_handler_manager) |
input_handler_manager->UnregisterRoutingID(GetRoutingID()); |
+ if (AudioIPCFactory::get()) |
+ AudioIPCFactory::get()->MaybeDeregisterRemoteFactory(GetRoutingID()); |
o1ka
2017/05/11 10:58:41
Wrap it into a static method?
Max Morin
2017/05/11 15:31:18
I feel like this code is consistent with the code
o1ka
2017/05/15 13:27:08
Why would you need consistency here? This is "Mayb
|
+ |
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_| |
@@ -1300,6 +1305,14 @@ void RenderFrameImpl::Initialize() { |
GetRoutingID(), render_view_->GetRoutingID()); |
} |
+ // AudioIPCFactory may be null in tests. |
+ if (AudioIPCFactory::get() && AudioIPCFactory::get()->UsingMojoFactories()) { |
+ mojom::RendererAudioOutputStreamFactoryPtr factory_ptr; |
+ GetRemoteInterfaces()->GetInterface(&factory_ptr); |
+ AudioIPCFactory::get()->RegisterRemoteFactory(GetRoutingID(), |
o1ka
2017/05/11 10:58:41
It looks like a static MaybeRegisterRemoteFactorie
Max Morin
2017/05/11 15:31:18
I moved some logic into AudioIPCFactory, but still
|
+ std::move(factory_ptr)); |
+ } |
+ |
const base::CommandLine& command_line = |
*base::CommandLine::ForCurrentProcess(); |
if (command_line.HasSwitch(switches::kDomAutomationController)) |