| Index: content/browser/renderer_host/media/audio_renderer_host.h
 | 
| diff --git a/content/browser/renderer_host/media/audio_renderer_host.h b/content/browser/renderer_host/media/audio_renderer_host.h
 | 
| index 4f2747be94790027c10675da740f38ef16530e7b..5d794865194652fb0882f1d0ffbfd3458e59e248 100644
 | 
| --- a/content/browser/renderer_host/media/audio_renderer_host.h
 | 
| +++ b/content/browser/renderer_host/media/audio_renderer_host.h
 | 
| @@ -51,6 +51,7 @@
 | 
|  #include "base/gtest_prod_util.h"
 | 
|  #include "base/macros.h"
 | 
|  #include "base/memory/ref_counted.h"
 | 
| +#include "base/memory/shared_memory.h"
 | 
|  #include "base/process/process.h"
 | 
|  #include "base/sequenced_task_runner_helpers.h"
 | 
|  #include "content/browser/renderer_host/media/audio_output_device_enumerator.h"
 | 
| @@ -63,6 +64,7 @@
 | 
|  #include "media/audio/audio_logging.h"
 | 
|  #include "media/audio/audio_output_controller.h"
 | 
|  #include "media/audio/simple_sources.h"
 | 
| +#include "media/mojo/interfaces/audio_output.mojom.h"
 | 
|  #include "url/origin.h"
 | 
|  
 | 
|  namespace media {
 | 
| @@ -73,6 +75,8 @@ class AudioParameters;
 | 
|  namespace content {
 | 
|  
 | 
|  class AudioMirroringManager;
 | 
| +class AudioOutputImpl;
 | 
| +class AudioOutputStreamImpl;
 | 
|  class MediaInternals;
 | 
|  class MediaStreamManager;
 | 
|  class MediaStreamUIProxy;
 | 
| @@ -107,6 +111,9 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
 | 
|    bool RenderFrameHasActiveAudio(int render_frame_id) const;
 | 
|  
 | 
|   private:
 | 
| +  friend class AudioEntry;
 | 
| +  friend class AudioOutputImpl;
 | 
| +  friend class AudioOutputStreamImpl;
 | 
|    friend class AudioRendererHostTest;
 | 
|    friend class BrowserThread;
 | 
|    friend class base::DeleteHelper<AudioRendererHost>;
 | 
| @@ -152,9 +159,11 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
 | 
|    // Creates an audio output stream with the specified format.
 | 
|    // Upon success/failure, the peer is notified via the NotifyStreamCreated
 | 
|    // message.
 | 
| -  void OnCreateStream(int stream_id,
 | 
| -                      int render_frame_id,
 | 
| -                      const media::AudioParameters& params);
 | 
| +  void CreateStream(
 | 
| +      int stream_id,
 | 
| +      int render_frame_id,
 | 
| +      const media::AudioParameters& params,
 | 
| +      const media::mojom::AudioOutput::CreateStreamCallback& callback);
 | 
|  
 | 
|    // Play the audio stream referenced by |stream_id|.
 | 
|    void OnPlayStream(int stream_id);
 | 
| @@ -183,15 +192,21 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
 | 
|  
 | 
|    // Start the actual creation of an audio stream, after the device
 | 
|    // authorization process is complete.
 | 
| -  void DoCreateStream(int stream_id,
 | 
| -                      int render_frame_id,
 | 
| -                      const media::AudioParameters& params,
 | 
| -                      const std::string& device_unique_id);
 | 
| +  void DoCreateStream(
 | 
| +      int stream_id,
 | 
| +      int render_frame_id,
 | 
| +      const media::AudioParameters& params,
 | 
| +      const std::string& device_unique_id,
 | 
| +      const media::mojom::AudioOutput::CreateStreamCallback&
 | 
| +          create_stream_callback);
 | 
|  
 | 
|    // Complete the process of creating an audio stream. This will set up the
 | 
|    // shared memory or shared socket in low latency mode and send the
 | 
|    // NotifyStreamCreated message to the peer.
 | 
| -  void DoCompleteCreation(int stream_id);
 | 
| +  void DoCompleteCreation(
 | 
| +      int stream_id,
 | 
| +      const media::mojom::AudioOutput::CreateStreamCallback&
 | 
| +          create_stream_callback);
 | 
|  
 | 
|    // Send playing/paused status to the renderer.
 | 
|    void DoNotifyStreamStateChanged(int stream_id, bool is_playing);
 | 
| @@ -208,6 +223,11 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
 | 
|    // Send an error message to the renderer, then close the stream.
 | 
|    void ReportErrorAndClose(int stream_id);
 | 
|  
 | 
| +  // Send an error message to the renderer, then close the stream.
 | 
| +  void ReportErrorAndCloseStream(
 | 
| +      int stream_id,
 | 
| +      const media::mojom::AudioOutput::CreateStreamCallback& callback);
 | 
| +
 | 
|    // A helper method to look up a AudioEntry identified by |stream_id|.
 | 
|    // Returns NULL if not found.
 | 
|    AudioEntry* LookupById(int stream_id);
 | 
| @@ -243,6 +263,7 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
 | 
|    media::AudioManager* const audio_manager_;
 | 
|    AudioMirroringManager* const mirroring_manager_;
 | 
|    std::unique_ptr<media::AudioLog> audio_log_;
 | 
| +  AudioOutputImpl* audio_output_impl_;
 | 
|  
 | 
|    // Used to access to AudioInputDeviceManager.
 | 
|    MediaStreamManager* media_stream_manager_;
 | 
| @@ -267,6 +288,8 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
 | 
|    // host. Reported as UMA stat at shutdown.
 | 
|    size_t max_simultaneous_streams_;
 | 
|  
 | 
| +  media::mojom::AudioOutputStreamPtr stream_ptr_;
 | 
| +
 | 
|    DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
 | 
|  };
 | 
|  
 | 
| 
 |