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

Side by Side Diff: Source/core/mediastream/UserMediaRequest.cpp

Issue 650063002: Move MediaStream and MediaStreamTrack implementation from modules/mediastream to core/mediastream. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. Created 6 years, 2 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 /* 1 /*
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 13 matching lines...) Expand all
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 33
34 #include "modules/mediastream/UserMediaRequest.h" 34 #include "core/mediastream/UserMediaRequest.h"
35 35
36 #include "bindings/core/v8/Dictionary.h" 36 #include "bindings/core/v8/Dictionary.h"
37 #include "bindings/core/v8/ExceptionMessages.h" 37 #include "bindings/core/v8/ExceptionMessages.h"
38 #include "bindings/core/v8/ExceptionState.h" 38 #include "bindings/core/v8/ExceptionState.h"
39 #include "core/dom/Document.h" 39 #include "core/dom/Document.h"
40 #include "core/dom/ExceptionCode.h" 40 #include "core/dom/ExceptionCode.h"
41 #include "core/dom/SpaceSplitString.h" 41 #include "core/dom/SpaceSplitString.h"
42 #include "modules/mediastream/MediaConstraintsImpl.h" 42 #include "core/mediastream/MediaConstraintsImpl.h"
43 #include "modules/mediastream/MediaStream.h" 43 #include "core/mediastream/MediaStream.h"
44 #include "modules/mediastream/UserMediaController.h" 44 #include "core/mediastream/UserMediaController.h"
45 #include "platform/mediastream/MediaStreamCenter.h" 45 #include "platform/mediastream/MediaStreamCenter.h"
46 #include "platform/mediastream/MediaStreamDescriptor.h" 46 #include "platform/mediastream/MediaStreamDescriptor.h"
47 47
48 namespace blink { 48 namespace blink {
49 49
50 static WebMediaConstraints parseOptions(const Dictionary& options, const String& mediaType, ExceptionState& exceptionState) 50 static WebMediaConstraints parseOptions(const Dictionary& options, const String& mediaType, ExceptionState& exceptionState)
51 { 51 {
52 WebMediaConstraints constraints; 52 WebMediaConstraints constraints;
53 53
54 Dictionary constraintsDictionary; 54 Dictionary constraintsDictionary;
55 bool ok = options.get(mediaType, constraintsDictionary); 55 bool ok = options.get(mediaType, constraintsDictionary);
56 if (ok && !constraintsDictionary.isUndefinedOrNull()) 56 if (ok && !constraintsDictionary.isUndefinedOrNull()) {
57 constraints = MediaConstraintsImpl::create(constraintsDictionary, except ionState); 57 constraints = MediaConstraintsImpl::create(constraintsDictionary, except ionState);
58 else { 58 } else {
59 bool mediaRequested = false; 59 bool mediaRequested = false;
60 DictionaryHelper::get(options, mediaType, mediaRequested); 60 DictionaryHelper::get(options, mediaType, mediaRequested);
61 if (mediaRequested) 61 if (mediaRequested)
62 constraints = MediaConstraintsImpl::create(); 62 constraints = MediaConstraintsImpl::create();
63 } 63 }
64 64
65 return constraints; 65 return constraints;
66 } 66 }
67 67
68 UserMediaRequest* UserMediaRequest::create(ExecutionContext* context, UserMediaC ontroller* controller, const Dictionary& options, NavigatorUserMediaSuccessCallb ack* successCallback, NavigatorUserMediaErrorCallback* errorCallback, ExceptionS tate& exceptionState) 68 UserMediaRequest* UserMediaRequest::create(ExecutionContext* context, UserMediaC ontroller* controller, const Dictionary& options, NavigatorUserMediaSuccessCallb ack* successCallback, NavigatorUserMediaErrorCallback* errorCallback, ExceptionS tate& exceptionState)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ContextLifecycleObserver::contextDestroyed(); 185 ContextLifecycleObserver::contextDestroyed();
186 } 186 }
187 187
188 void UserMediaRequest::trace(Visitor* visitor) 188 void UserMediaRequest::trace(Visitor* visitor)
189 { 189 {
190 visitor->trace(m_successCallback); 190 visitor->trace(m_successCallback);
191 visitor->trace(m_errorCallback); 191 visitor->trace(m_errorCallback);
192 } 192 }
193 193
194 } // namespace blink 194 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/mediastream/UserMediaRequest.h ('k') | Source/core/mediastream/WindowMediaStream.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698