Commit 63f526d3 authored by Hongchan Choi's avatar Hongchan Choi Committed by Commit Bot

Have AudioContextManagerImpl derive from content::FrameServiceBase.

This is a fix suggested by dcheng@ at:
https://bugs.chromium.org/p/chromium/issues/detail?id=888366#c12

Locally confirmed the change stops the crash.

Bug: 888366
Test: The CL build does not crash on the repro case anymore.
Change-Id: I4b56228589b4c71f1191fb82e849240f39c938ed
Reviewed-on: https://chromium-review.googlesource.com/1246945
Commit-Queue: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: default avatarOlga Sharonova <olka@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarRaymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595127}
parent 089ea1f9
hongchan@chromium.org
rtoy@chromium.org
# COMPONENT: Blink>WebAudio
\ No newline at end of file
...@@ -15,14 +15,18 @@ namespace content { ...@@ -15,14 +15,18 @@ namespace content {
void AudioContextManagerImpl::Create( void AudioContextManagerImpl::Create(
RenderFrameHost* render_frame_host, RenderFrameHost* render_frame_host,
blink::mojom::AudioContextManagerRequest request) { blink::mojom::AudioContextManagerRequest request) {
mojo::MakeStrongBinding( DCHECK(render_frame_host);
std::make_unique<AudioContextManagerImpl>(render_frame_host),
std::move(request)); // The object is bound to the lifetime of |render_frame_host| and the mojo
// connection. See FrameServiceBase for details.
new AudioContextManagerImpl(render_frame_host, std::move(request));
} }
AudioContextManagerImpl::AudioContextManagerImpl( AudioContextManagerImpl::AudioContextManagerImpl(
RenderFrameHost* render_frame_host) RenderFrameHost* render_frame_host,
: render_frame_host_impl_( blink::mojom::AudioContextManagerRequest request)
: FrameServiceBase(render_frame_host, std::move(request)),
render_frame_host_impl_(
static_cast<RenderFrameHostImpl*>(render_frame_host)) { static_cast<RenderFrameHostImpl*>(render_frame_host)) {
DCHECK(render_frame_host); DCHECK(render_frame_host);
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_MEDIA_WEBAUDIO_AUDIO_CONTEXT_MANAGER_IMPL_H_ #define CONTENT_BROWSER_MEDIA_WEBAUDIO_AUDIO_CONTEXT_MANAGER_IMPL_H_
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "content/public/browser/frame_service_base.h"
#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/binding.h"
#include "third_party/blink/public/mojom/webaudio/audio_context_manager.mojom.h" #include "third_party/blink/public/mojom/webaudio/audio_context_manager.mojom.h"
...@@ -17,10 +18,12 @@ class RenderFrameHostImpl; ...@@ -17,10 +18,12 @@ class RenderFrameHostImpl;
// Implements the mojo interface between WebAudio and the browser so that // Implements the mojo interface between WebAudio and the browser so that
// WebAudio can report when audible sounds from an AudioContext starts and // WebAudio can report when audible sounds from an AudioContext starts and
// stops. // stops.
class CONTENT_EXPORT AudioContextManagerImpl class CONTENT_EXPORT AudioContextManagerImpl final
: public blink::mojom::AudioContextManager { : public content::FrameServiceBase<blink::mojom::AudioContextManager> {
public: public:
explicit AudioContextManagerImpl(RenderFrameHost* render_frame_host); explicit AudioContextManagerImpl(
RenderFrameHost* render_frame_host,
blink::mojom::AudioContextManagerRequest request);
~AudioContextManagerImpl() override; ~AudioContextManagerImpl() override;
static void Create(RenderFrameHost* render_frame_host, static void Create(RenderFrameHost* render_frame_host,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment