OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/remote_media_stream_impl.h" | 5 #include "content/renderer/media/remote_media_stream_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 DCHECK(main_thread_->BelongsToCurrentThread()); | 96 DCHECK(main_thread_->BelongsToCurrentThread()); |
97 } | 97 } |
98 | 98 |
99 void InitializeWebkitTrack(blink::WebMediaStreamSource::Type type) { | 99 void InitializeWebkitTrack(blink::WebMediaStreamSource::Type type) { |
100 DCHECK(main_thread_->BelongsToCurrentThread()); | 100 DCHECK(main_thread_->BelongsToCurrentThread()); |
101 DCHECK(webkit_track_.isNull()); | 101 DCHECK(webkit_track_.isNull()); |
102 | 102 |
103 blink::WebString webkit_track_id(base::UTF8ToUTF16(id_)); | 103 blink::WebString webkit_track_id(base::UTF8ToUTF16(id_)); |
104 blink::WebMediaStreamSource webkit_source; | 104 blink::WebMediaStreamSource webkit_source; |
105 webkit_source.initialize(webkit_track_id, type, webkit_track_id, | 105 webkit_source.initialize(webkit_track_id, type, webkit_track_id, |
106 true /* remote */, true /* readonly */); | 106 true /* remote */); |
107 webkit_track_.initialize(webkit_track_id, webkit_source); | 107 webkit_track_.initialize(webkit_track_id, webkit_source); |
108 DCHECK(!webkit_track_.isNull()); | 108 DCHECK(!webkit_track_.isNull()); |
109 } | 109 } |
110 | 110 |
111 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; | 111 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; |
112 // This callback will be run when Initialize() is called and then freed. | 112 // This callback will be run when Initialize() is called and then freed. |
113 // The callback is used by derived classes to bind objects that need to be | 113 // The callback is used by derived classes to bind objects that need to be |
114 // instantiated and initialized on the signaling thread but then moved to | 114 // instantiated and initialized on the signaling thread but then moved to |
115 // and used on the main thread when initializing the webkit object(s). | 115 // and used on the main thread when initializing the webkit object(s). |
116 base::Callback<void()> webkit_initialize_; | 116 base::Callback<void()> webkit_initialize_; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 // Unregister all the audio track observers that were not used. | 424 // Unregister all the audio track observers that were not used. |
425 // We need to do this before destruction since the observers can't unregister | 425 // We need to do this before destruction since the observers can't unregister |
426 // from within the dtor due to a race. | 426 // from within the dtor due to a race. |
427 for (auto& track : *audio_tracks.get()) { | 427 for (auto& track : *audio_tracks.get()) { |
428 if (track.get()) | 428 if (track.get()) |
429 track->Unregister(); | 429 track->Unregister(); |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 } // namespace content | 433 } // namespace content |
OLD | NEW |