| 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 21 matching lines...) Expand all Loading... |
| 32 #include "config.h" | 32 #include "config.h" |
| 33 | 33 |
| 34 #include "modules/mediastream/UserMediaRequest.h" | 34 #include "modules/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 "core/frame/UseCounter.h" |
| 42 #include "modules/mediastream/MediaConstraintsImpl.h" | 43 #include "modules/mediastream/MediaConstraintsImpl.h" |
| 43 #include "modules/mediastream/MediaStream.h" | 44 #include "modules/mediastream/MediaStream.h" |
| 44 #include "modules/mediastream/MediaStreamConstraints.h" | 45 #include "modules/mediastream/MediaStreamConstraints.h" |
| 45 #include "modules/mediastream/UserMediaController.h" | 46 #include "modules/mediastream/UserMediaController.h" |
| 46 #include "platform/mediastream/MediaStreamCenter.h" | 47 #include "platform/mediastream/MediaStreamCenter.h" |
| 47 #include "platform/mediastream/MediaStreamDescriptor.h" | 48 #include "platform/mediastream/MediaStreamDescriptor.h" |
| 48 | 49 |
| 49 namespace blink { | 50 namespace blink { |
| 50 | 51 |
| 51 static WebMediaConstraints parseOptions(const BooleanOrDictionary& options, Exce
ptionState& exceptionState) | 52 static WebMediaConstraints parseOptions(const BooleanOrDictionary& options, Exce
ptionState& exceptionState) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 WebMediaConstraints UserMediaRequest::audioConstraints() const | 110 WebMediaConstraints UserMediaRequest::audioConstraints() const |
| 110 { | 111 { |
| 111 return m_audio; | 112 return m_audio; |
| 112 } | 113 } |
| 113 | 114 |
| 114 WebMediaConstraints UserMediaRequest::videoConstraints() const | 115 WebMediaConstraints UserMediaRequest::videoConstraints() const |
| 115 { | 116 { |
| 116 return m_video; | 117 return m_video; |
| 117 } | 118 } |
| 118 | 119 |
| 120 bool UserMediaRequest::isPrivilegedContextUse(String& errorMessage) |
| 121 { |
| 122 Document* document = ownerDocument(); |
| 123 |
| 124 if (document->isPrivilegedContext(errorMessage)) { |
| 125 UseCounter::count(document->frame(), UseCounter::GetUserMediaSecureOrigi
n); |
| 126 OriginsUsingFeatures::countAnyWorld(*document, OriginsUsingFeatures::Fea
ture::GetUserMediaSecureOrigin); |
| 127 return true; |
| 128 } |
| 129 |
| 130 // While getUserMedia is blocked on insecure origins, we still want to |
| 131 // count attempts to use it. |
| 132 UseCounter::countDeprecation(document->frame(), UseCounter::GetUserMediaInse
cureOrigin); |
| 133 OriginsUsingFeatures::countAnyWorld(*document, OriginsUsingFeatures::Feature
::GetUserMediaInsecureOrigin); |
| 134 return false; |
| 135 } |
| 136 |
| 119 Document* UserMediaRequest::ownerDocument() | 137 Document* UserMediaRequest::ownerDocument() |
| 120 { | 138 { |
| 121 if (ExecutionContext* context = executionContext()) { | 139 if (ExecutionContext* context = executionContext()) { |
| 122 return toDocument(context); | 140 return toDocument(context); |
| 123 } | 141 } |
| 124 | 142 |
| 125 return 0; | 143 return 0; |
| 126 } | 144 } |
| 127 | 145 |
| 128 void UserMediaRequest::start() | 146 void UserMediaRequest::start() |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 204 |
| 187 DEFINE_TRACE(UserMediaRequest) | 205 DEFINE_TRACE(UserMediaRequest) |
| 188 { | 206 { |
| 189 visitor->trace(m_controller); | 207 visitor->trace(m_controller); |
| 190 visitor->trace(m_successCallback); | 208 visitor->trace(m_successCallback); |
| 191 visitor->trace(m_errorCallback); | 209 visitor->trace(m_errorCallback); |
| 192 ContextLifecycleObserver::trace(visitor); | 210 ContextLifecycleObserver::trace(visitor); |
| 193 } | 211 } |
| 194 | 212 |
| 195 } // namespace blink | 213 } // namespace blink |
| OLD | NEW |