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

Side by Side Diff: content/renderer/media/media_stream_audio_source.cc

Issue 364123002: [Cross-Site Isolation] Migrate entire MediaStream verticals to be per-RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: It's random enough. + REBASE Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderer/media/media_stream_audio_source.h" 5 #include "content/renderer/media/media_stream_audio_source.h"
6 6
7 #include "content/renderer/render_frame_impl.h"
8 #include "content/renderer/render_view_impl.h"
9
7 namespace content { 10 namespace content {
8 11
12 namespace {
13 // TODO(miu): This is a temporary hack until the Chrome audio vertical is
14 // migrated for the Cross-Site Isolation project. http://crbug.com/392596
15 int ToRenderViewId(int render_frame_id) {
16 RenderFrameImpl* const frame =
17 RenderFrameImpl::FromRoutingID(render_frame_id);
18 RenderViewImpl* const view = frame ? frame->render_view() : NULL;
19 return view ? view->GetRoutingID() : -1;
20 }
21 } // namespace
22
9 MediaStreamAudioSource::MediaStreamAudioSource( 23 MediaStreamAudioSource::MediaStreamAudioSource(
10 int render_view_id, 24 int render_frame_id,
11 const StreamDeviceInfo& device_info, 25 const StreamDeviceInfo& device_info,
12 const SourceStoppedCallback& stop_callback, 26 const SourceStoppedCallback& stop_callback,
13 PeerConnectionDependencyFactory* factory) 27 PeerConnectionDependencyFactory* factory)
14 : render_view_id_(render_view_id), 28 : render_view_id_(ToRenderViewId(render_frame_id)),
15 factory_(factory) { 29 factory_(factory) {
16 SetDeviceInfo(device_info); 30 SetDeviceInfo(device_info);
17 SetStopCallback(stop_callback); 31 SetStopCallback(stop_callback);
18 } 32 }
19 33
20 MediaStreamAudioSource::MediaStreamAudioSource() 34 MediaStreamAudioSource::MediaStreamAudioSource()
21 : render_view_id_(-1), 35 : render_view_id_(-1),
22 factory_(NULL) { 36 factory_(NULL) {
23 } 37 }
24 38
(...skipping 22 matching lines...) Expand all
47 StopSource(); 61 StopSource();
48 return; 62 return;
49 } 63 }
50 } 64 }
51 65
52 factory_->CreateLocalAudioTrack(track); 66 factory_->CreateLocalAudioTrack(track);
53 callback.Run(this, true); 67 callback.Run(this, true);
54 } 68 }
55 69
56 } // namespace content 70 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_audio_source.h ('k') | content/renderer/media/media_stream_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698