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

Unified Diff: content/renderer/media/user_media_client_impl.cc

Issue 2803183002: Revert of Move getUserMedia finish to "when audio track configured". (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/user_media_client_impl.cc
diff --git a/content/renderer/media/user_media_client_impl.cc b/content/renderer/media/user_media_client_impl.cc
index a0fce82d5d0f6ae75530aedb5382fe0c174c3b35..771ed274a147638e3a8f74e7ed8914c47c76a900 100644
--- a/content/renderer/media/user_media_client_impl.cc
+++ b/content/renderer/media/user_media_client_impl.cc
@@ -20,7 +20,6 @@
#include "content/public/renderer/render_frame.h"
#include "content/renderer/media/local_media_stream_audio_source.h"
#include "content/renderer/media/media_stream.h"
-#include "content/renderer/media/media_stream_audio_track.h"
#include "content/renderer/media/media_stream_constraints_util.h"
#include "content/renderer/media/media_stream_constraints_util_video_content.h"
#include "content/renderer/media/media_stream_constraints_util_video_device.h"
@@ -32,7 +31,6 @@
#include "content/renderer/media/webrtc_logging.h"
#include "content/renderer/media/webrtc_uma_histograms.h"
#include "content/renderer/render_thread_impl.h"
-#include "media/base/bind_to_current_loop.h"
#include "media/capture/video_capture_types.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h"
@@ -712,6 +710,8 @@
if (result == MEDIA_DEVICE_OK)
local_sources_.push_back((*it));
pending_local_sources_.erase(it);
+
+ NotifyCurrentRequestInfoOfAudioSourceStarted(source, result, result_name);
return;
}
NOTREACHED();
@@ -1292,18 +1292,10 @@
sources_.push_back(track.source());
bool connected = native_source->ConnectToTrack(track);
- if (!is_pending && !connected) {
- // It's a failure, and it's final.
- OnTrackStarted(native_source, MEDIA_DEVICE_TRACK_START_FAILURE, "");
- } else {
- // The request may succeed later.
- // The track will be marked as connected once the configuration has
- // propagated.
- MediaStreamAudioTrack::From(track)->SetFormatConfiguredCallback(
- media::BindToCurrentLoop(base::Bind(
- &UserMediaClientImpl::UserMediaRequestInfo::OnTrackStarted,
- AsWeakPtr(), native_source, content::MEDIA_DEVICE_OK,
- blink::WebString())));
+ if (!is_pending) {
+ OnTrackStarted(
+ native_source,
+ connected ? MEDIA_DEVICE_OK : MEDIA_DEVICE_TRACK_START_FAILURE, "");
}
}
@@ -1371,9 +1363,7 @@
// ignore the notification.
auto found = std::find(sources_waiting_for_callback_.begin(),
sources_waiting_for_callback_.end(), source);
- // If the start failed, inform the request here.
- if (found != sources_waiting_for_callback_.end() &&
- result != content::MEDIA_DEVICE_OK)
+ if (found != sources_waiting_for_callback_.end())
OnTrackStarted(source, result, result_name);
}
« no previous file with comments | « content/renderer/media/media_stream_audio_unittest.cc ('k') | content/renderer/media/user_media_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698