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

Side by Side Diff: content/renderer/media/media_stream_impl.h

Issue 446553002: Add histogram WebRTC.UserMediaRequest.NoResultState to track user media requests with no result. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b399835
Patch Set: Diffbase https://codereview.chromium.org/427713004/ Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const blink::WebMediaStreamSource& source, 139 const blink::WebMediaStreamSource& source,
140 const blink::WebMediaConstraints& constraints); 140 const blink::WebMediaConstraints& constraints);
141 141
142 // Triggers |callback| when all sources used in this request have either 142 // Triggers |callback| when all sources used in this request have either
143 // successfully started, or a source has failed to start. 143 // successfully started, or a source has failed to start.
144 void CallbackOnTracksStarted(const ResourcesReady& callback); 144 void CallbackOnTracksStarted(const ResourcesReady& callback);
145 145
146 bool IsSourceUsed(const blink::WebMediaStreamSource& source) const; 146 bool IsSourceUsed(const blink::WebMediaStreamSource& source) const;
147 void RemoveSource(const blink::WebMediaStreamSource& source); 147 void RemoveSource(const blink::WebMediaStreamSource& source);
148 148
149 bool AreAllSourcesRemoved() const { return sources_.empty(); } 149 bool AreAllSourcesRemoved() const { return sources_.empty(); }
vrk (LEFT CHROMIUM) 2014/08/05 19:05:40 I think both AreAllSourcesRemoved and HasPendingSo
andresp-chromium 2014/08/06 10:13:56 Done.
150 bool HasPendingSources() { return !sources_waiting_for_callback_.empty(); }
vrk (LEFT CHROMIUM) 2014/08/05 19:05:41 const?
andresp-chromium 2014/08/06 10:13:56 Done.
150 151
151 private: 152 private:
152 void OnTrackStarted(MediaStreamSource* source, bool success); 153 void OnTrackStarted(MediaStreamSource* source, bool success);
153 void CheckAllTracksStarted(); 154 void CheckAllTracksStarted();
154 155
155 ResourcesReady ready_callback_; 156 ResourcesReady ready_callback_;
156 bool request_failed_; 157 bool request_failed_;
157 // Sources used in this request. 158 // Sources used in this request.
158 std::vector<blink::WebMediaStreamSource> sources_; 159 std::vector<blink::WebMediaStreamSource> sources_;
159 std::vector<MediaStreamSource*> sources_waiting_for_callback_; 160 std::vector<MediaStreamSource*> sources_waiting_for_callback_;
(...skipping 24 matching lines...) Expand all
184 const blink::WebMediaConstraints& constraints, 185 const blink::WebMediaConstraints& constraints,
185 blink::WebVector<blink::WebMediaStreamTrack>* webkit_tracks, 186 blink::WebVector<blink::WebMediaStreamTrack>* webkit_tracks,
186 UserMediaRequestInfo* request); 187 UserMediaRequestInfo* request);
187 188
188 // Callback function triggered when all native versions of the 189 // Callback function triggered when all native versions of the
189 // underlying media sources and tracks have been created and started. 190 // underlying media sources and tracks have been created and started.
190 void OnCreateNativeTracksCompleted( 191 void OnCreateNativeTracksCompleted(
191 UserMediaRequestInfo* request, 192 UserMediaRequestInfo* request,
192 content::MediaStreamRequestResult result); 193 content::MediaStreamRequestResult result);
193 194
195 void OnStreamGeneratedForCancelledRequest(
196 const StreamDeviceInfoArray& audio_array,
197 const StreamDeviceInfoArray& video_array);
198
194 UserMediaRequestInfo* FindUserMediaRequestInfo(int request_id); 199 UserMediaRequestInfo* FindUserMediaRequestInfo(int request_id);
195 UserMediaRequestInfo* FindUserMediaRequestInfo( 200 UserMediaRequestInfo* FindUserMediaRequestInfo(
196 const blink::WebUserMediaRequest& request); 201 const blink::WebUserMediaRequest& request);
197 void DeleteUserMediaRequestInfo(UserMediaRequestInfo* request); 202 void DeleteUserMediaRequestInfo(UserMediaRequestInfo* request);
203 void DeleteAllUserMediaRequests();
198 204
199 MediaDevicesRequestInfo* FindMediaDevicesRequestInfo(int request_id); 205 MediaDevicesRequestInfo* FindMediaDevicesRequestInfo(int request_id);
200 MediaDevicesRequestInfo* FindMediaDevicesRequestInfo( 206 MediaDevicesRequestInfo* FindMediaDevicesRequestInfo(
201 const blink::WebMediaDevicesRequest& request); 207 const blink::WebMediaDevicesRequest& request);
202 void CancelAndDeleteMediaDevicesRequest(MediaDevicesRequestInfo* request); 208 void CancelAndDeleteMediaDevicesRequest(MediaDevicesRequestInfo* request);
203 209
204 // Returns the source that use a device with |device.session_id| 210 // Returns the source that use a device with |device.session_id|
205 // and |device.device.id|. NULL if such source doesn't exist. 211 // and |device.device.id|. NULL if such source doesn't exist.
206 const blink::WebMediaStreamSource* FindLocalSource( 212 const blink::WebMediaStreamSource* FindLocalSource(
207 const StreamDeviceInfo& device) const; 213 const StreamDeviceInfo& device) const;
(...skipping 21 matching lines...) Expand all
229 // Note: This member must be the last to ensure all outstanding weak pointers 235 // Note: This member must be the last to ensure all outstanding weak pointers
230 // are invalidated first. 236 // are invalidated first.
231 base::WeakPtrFactory<MediaStreamImpl> weak_factory_; 237 base::WeakPtrFactory<MediaStreamImpl> weak_factory_;
232 238
233 DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl); 239 DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl);
234 }; 240 };
235 241
236 } // namespace content 242 } // namespace content
237 243
238 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ 244 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/media_stream_impl.cc » ('j') | content/renderer/media/media_stream_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698