OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 options.get(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, PassOwnPtrWillBeRawPtr<Navigat
orUserMediaSuccessCallback> successCallback, PassOwnPtrWillBeRawPtr<NavigatorUse
rMediaErrorCallback> errorCallback, ExceptionState& exceptionState) | 68 UserMediaRequest* UserMediaRequest::create(ExecutionContext* context, UserMediaC
ontroller* controller, const Dictionary& options, PassOwnPtrWillBeRawPtr<Navigat
orUserMediaSuccessCallback> successCallback, PassOwnPtrWillBeRawPtr<NavigatorUse
rMediaErrorCallback> errorCallback, ExceptionState& exceptionState) |
69 { | 69 { |
70 WebMediaConstraints audio = parseOptions(options, "audio", exceptionState); | 70 WebMediaConstraints audio = parseOptions(options, "audio", exceptionState); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |