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

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

Issue 391703002: Implement ConstraintNotSatisfiedError for getusermedia (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and change the reviewers list 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 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" 7 #include "content/renderer/render_frame_impl.h"
8 #include "content/renderer/render_view_impl.h" 8 #include "content/renderer/render_view_impl.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // TODO(xians): Properly implement for audio sources. 50 // TODO(xians): Properly implement for audio sources.
51 if (!local_audio_source_) { 51 if (!local_audio_source_) {
52 if (!factory_->InitializeMediaStreamAudioSource(render_view_id_, 52 if (!factory_->InitializeMediaStreamAudioSource(render_view_id_,
53 constraints, 53 constraints,
54 this)) { 54 this)) {
55 // The source failed to start. 55 // The source failed to start.
56 // MediaStreamImpl rely on the |stop_callback| to be triggered when the 56 // MediaStreamImpl rely on the |stop_callback| to be triggered when the
57 // last track is removed from the source. But in this case, the source is 57 // last track is removed from the source. But in this case, the source is
58 // is not even started. So we need to fail both adding the track and 58 // is not even started. So we need to fail both adding the track and
59 // trigger |stop_callback|. 59 // trigger |stop_callback|.
60 callback.Run(this, false); 60 callback.Run(this, MEDIA_DEVICE_TRACK_START_FAILURE, "");
61 StopSource(); 61 StopSource();
62 return; 62 return;
63 } 63 }
64 } 64 }
65 65
66 factory_->CreateLocalAudioTrack(track); 66 factory_->CreateLocalAudioTrack(track);
67 callback.Run(this, true); 67 callback.Run(this, MEDIA_DEVICE_OK, "");
68 } 68 }
69 69
70 } // namespace content 70 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/media_stream_request.h ('k') | content/renderer/media/media_stream_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698