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

Side by Side Diff: Source/core/platform/mediastream/chromium/MediaStreamCenterChromium.cpp

Issue 16778002: MediaStream API: Changing the device enumeration to be async (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed review comments Created 7 years, 6 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 32
33 #include "core/platform/mediastream/chromium/MediaStreamCenterChromium.h" 33 #include "core/platform/mediastream/chromium/MediaStreamCenterChromium.h"
34 34
35 #include "core/platform/mediastream/MediaStreamDescriptor.h" 35 #include "core/platform/mediastream/MediaStreamDescriptor.h"
36 #include "core/platform/mediastream/MediaStreamSourcesQueryClient.h" 36 #include "core/platform/mediastream/MediaStreamSourcesQueryClient.h"
37 #include "modules/mediastream/MediaStreamTrackSourcesRequest.h"
jamesr 2013/06/12 17:39:40 this is also unfortunate
37 #include "public/platform/Platform.h" 38 #include "public/platform/Platform.h"
38 #include "public/platform/WebMediaStream.h" 39 #include "public/platform/WebMediaStream.h"
39 #include "public/platform/WebMediaStreamCenter.h" 40 #include "public/platform/WebMediaStreamCenter.h"
40 #include "public/platform/WebMediaStreamSourcesRequest.h" 41 #include "public/platform/WebMediaStreamSourcesRequest.h"
41 #include "public/platform/WebMediaStreamTrack.h" 42 #include "public/platform/WebMediaStreamTrack.h"
43 #include "public/platform/WebMediaStreamTrackSourcesRequest.h"
42 #include "wtf/MainThread.h" 44 #include "wtf/MainThread.h"
43 #include "wtf/PassOwnPtr.h" 45 #include "wtf/PassOwnPtr.h"
44 46
45 namespace WebCore { 47 namespace WebCore {
46 48
47 MediaStreamCenter& MediaStreamCenter::instance() 49 MediaStreamCenter& MediaStreamCenter::instance()
48 { 50 {
49 ASSERT(isMainThread()); 51 ASSERT(isMainThread());
50 DEFINE_STATIC_LOCAL(MediaStreamCenterChromium, center, ()); 52 DEFINE_STATIC_LOCAL(MediaStreamCenterChromium, center, ());
51 return center; 53 return center;
(...skipping 11 matching lines...) Expand all
63 void MediaStreamCenterChromium::queryMediaStreamSources(PassRefPtr<MediaStreamSo urcesQueryClient> client) 65 void MediaStreamCenterChromium::queryMediaStreamSources(PassRefPtr<MediaStreamSo urcesQueryClient> client)
64 { 66 {
65 if (m_private) 67 if (m_private)
66 m_private->queryMediaStreamSources(client); 68 m_private->queryMediaStreamSources(client);
67 else { 69 else {
68 MediaStreamSourceVector audioSources, videoSources; 70 MediaStreamSourceVector audioSources, videoSources;
69 client->didCompleteQuery(audioSources, videoSources); 71 client->didCompleteQuery(audioSources, videoSources);
70 } 72 }
71 } 73 }
72 74
73 bool MediaStreamCenterChromium::getSourceInfos(const String& url, WebKit::WebVec tor<WebKit::WebSourceInfo>& sourceInfos) 75 bool MediaStreamCenterChromium::getMediaStreamTrackSources(PassRefPtr<MediaStrea mTrackSourcesRequest> request)
74 { 76 {
75 return m_private && m_private->getSourceInfos(url, sourceInfos); 77 return m_private && m_private->getMediaStreamTrackSources(request);
76 } 78 }
77 79
78 void MediaStreamCenterChromium::didSetMediaStreamTrackEnabled(MediaStreamDescrip tor* stream, MediaStreamComponent* component) 80 void MediaStreamCenterChromium::didSetMediaStreamTrackEnabled(MediaStreamDescrip tor* stream, MediaStreamComponent* component)
79 { 81 {
80 if (m_private) { 82 if (m_private) {
81 if (component->enabled()) 83 if (component->enabled())
82 m_private->didEnableMediaStreamTrack(stream, component); 84 m_private->didEnableMediaStreamTrack(stream, component);
83 else 85 else
84 m_private->didDisableMediaStreamTrack(stream, component); 86 m_private->didDisableMediaStreamTrack(stream, component);
85 } 87 }
(...skipping 27 matching lines...) Expand all
113 m_private->didCreateMediaStream(webStream); 115 m_private->didCreateMediaStream(webStream);
114 } 116 }
115 } 117 }
116 118
117 void MediaStreamCenterChromium::stopLocalMediaStream(const WebKit::WebMediaStrea m& stream) 119 void MediaStreamCenterChromium::stopLocalMediaStream(const WebKit::WebMediaStrea m& stream)
118 { 120 {
119 endLocalMediaStream(stream); 121 endLocalMediaStream(stream);
120 } 122 }
121 123
122 } // namespace WebCore 124 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698