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

Unified Diff: Source/modules/mediastream/MediaStreamTrack.cpp

Issue 560843002: Interface for requestSources through UserMediaController/Client. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleaning. Created 6 years, 3 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
« no previous file with comments | « no previous file | Source/modules/mediastream/UserMediaClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediastream/MediaStreamTrack.cpp
diff --git a/Source/modules/mediastream/MediaStreamTrack.cpp b/Source/modules/mediastream/MediaStreamTrack.cpp
index 593d8d6a299aeeb6259af3f40d4276bd6449c115..fd22a6167a735c9fcdb258ab31e7ccb4a73bf760 100644
--- a/Source/modules/mediastream/MediaStreamTrack.cpp
+++ b/Source/modules/mediastream/MediaStreamTrack.cpp
@@ -27,12 +27,14 @@
#include "modules/mediastream/MediaStreamTrack.h"
#include "bindings/core/v8/ExceptionMessages.h"
+#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
#include "core/events/Event.h"
#include "modules/mediastream/MediaStream.h"
#include "modules/mediastream/MediaStreamTrackSourcesCallback.h"
#include "modules/mediastream/MediaStreamTrackSourcesRequestImpl.h"
+#include "modules/mediastream/UserMediaController.h"
#include "platform/mediastream/MediaStreamCenter.h"
#include "platform/mediastream/MediaStreamComponent.h"
#include "public/platform/WebSourceInfo.h"
@@ -127,9 +129,14 @@ String MediaStreamTrack::readyState() const
void MediaStreamTrack::getSources(ExecutionContext* context, PassOwnPtrWillBeRawPtr<MediaStreamTrackSourcesCallback> callback, ExceptionState& exceptionState)
{
+ LocalFrame* frame = toDocument(context)->frame();
+ UserMediaController* userMedia = UserMediaController::from(frame);
+ if (!userMedia) {
+ exceptionState.throwDOMException(NotSupportedError, "No sources controller available; is this a detached window?");
jochen (gone - plz use gerrit) 2014/09/11 11:35:44 That's an odd exception. What would a developer do
Henrik Grunell 2014/09/11 11:43:22 Hmm, I borrowed this from NavigatorMediaStream::we
jochen (gone - plz use gerrit) 2014/09/11 11:49:21 ok I guess
Henrik Grunell 2014/09/11 11:58:50 OK. Can you please continue review the CL?
+ return;
+ }
MediaStreamTrackSourcesRequest* request = MediaStreamTrackSourcesRequestImpl::create(*context, callback);
- if (!MediaStreamCenter::instance().getMediaStreamTrackSources(request))
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("getSources", "MediaStreamTrack", "Functionality not implemented yet"));
+ userMedia->requestSources(request);
}
void MediaStreamTrack::stopTrack(ExceptionState& exceptionState)
« no previous file with comments | « no previous file | Source/modules/mediastream/UserMediaClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698