Chromium Code Reviews| 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 28 matching lines...) Expand all Loading... | |
| 39 #include "core/dom/SpaceSplitString.h" | 39 #include "core/dom/SpaceSplitString.h" |
| 40 #include "core/frame/Deprecation.h" | 40 #include "core/frame/Deprecation.h" |
| 41 #include "core/frame/HostsUsingFeatures.h" | 41 #include "core/frame/HostsUsingFeatures.h" |
| 42 #include "modules/mediastream/MediaConstraintsImpl.h" | 42 #include "modules/mediastream/MediaConstraintsImpl.h" |
| 43 #include "modules/mediastream/MediaStream.h" | 43 #include "modules/mediastream/MediaStream.h" |
| 44 #include "modules/mediastream/MediaStreamConstraints.h" | 44 #include "modules/mediastream/MediaStreamConstraints.h" |
| 45 #include "modules/mediastream/MediaTrackConstraints.h" | 45 #include "modules/mediastream/MediaTrackConstraints.h" |
| 46 #include "modules/mediastream/UserMediaController.h" | 46 #include "modules/mediastream/UserMediaController.h" |
| 47 #include "platform/mediastream/MediaStreamCenter.h" | 47 #include "platform/mediastream/MediaStreamCenter.h" |
| 48 #include "platform/mediastream/MediaStreamDescriptor.h" | 48 #include "platform/mediastream/MediaStreamDescriptor.h" |
| 49 #include "public/platform/Platform.h" | |
| 49 | 50 |
| 50 namespace blink { | 51 namespace blink { |
| 51 | 52 |
| 52 static WebMediaConstraints parseOptions(ExecutionContext* context, const Boolean OrMediaTrackConstraints& options, MediaErrorState& errorState) | 53 static WebMediaConstraints parseOptions(ExecutionContext* context, const Boolean OrMediaTrackConstraints& options, MediaErrorState& errorState) |
| 53 { | 54 { |
| 54 WebMediaConstraints constraints; | 55 WebMediaConstraints constraints; |
| 55 | 56 |
| 56 Dictionary constraintsDictionary; | 57 Dictionary constraintsDictionary; |
| 57 if (options.isNull()) { | 58 if (options.isNull()) { |
| 58 // Do nothing. | 59 // Do nothing. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 } | 127 } |
| 127 | 128 |
| 128 bool UserMediaRequest::isSecureContextUse(String& errorMessage) | 129 bool UserMediaRequest::isSecureContextUse(String& errorMessage) |
| 129 { | 130 { |
| 130 Document* document = ownerDocument(); | 131 Document* document = ownerDocument(); |
| 131 | 132 |
| 132 if (document->isSecureContext(errorMessage)) { | 133 if (document->isSecureContext(errorMessage)) { |
| 133 UseCounter::count(document->frame(), UseCounter::GetUserMediaSecureOrigi n); | 134 UseCounter::count(document->frame(), UseCounter::GetUserMediaSecureOrigi n); |
| 134 UseCounter::countCrossOriginIframe(*document, UseCounter::GetUserMediaSe cureOriginIframe); | 135 UseCounter::countCrossOriginIframe(*document, UseCounter::GetUserMediaSe cureOriginIframe); |
| 135 HostsUsingFeatures::countAnyWorld(*document, HostsUsingFeatures::Feature ::GetUserMediaSecureHost); | 136 HostsUsingFeatures::countAnyWorld(*document, HostsUsingFeatures::Feature ::GetUserMediaSecureHost); |
| 137 Platform::current()->recordRapporURL("GetUserMedia.SecureOrigin", WebURL (document->url())); | |
|
Guido Urdaneta
2016/06/10 12:47:49
Is "GetUserMedia.SecureOrigin" a good name for thi
tommi (sloooow) - chröme
2016/06/10 13:19:36
Sounds reasonable to me and consistent with how th
| |
| 136 return true; | 138 return true; |
| 137 } | 139 } |
| 138 | 140 |
| 139 // While getUserMedia is blocked on insecure origins, we still want to | 141 // While getUserMedia is blocked on insecure origins, we still want to |
| 140 // count attempts to use it. | 142 // count attempts to use it. |
| 141 Deprecation::countDeprecation(document->frame(), UseCounter::GetUserMediaIns ecureOrigin); | 143 Deprecation::countDeprecation(document->frame(), UseCounter::GetUserMediaIns ecureOrigin); |
| 142 Deprecation::countDeprecationCrossOriginIframe(*document, UseCounter::GetUse rMediaInsecureOriginIframe); | 144 Deprecation::countDeprecationCrossOriginIframe(*document, UseCounter::GetUse rMediaInsecureOriginIframe); |
| 143 HostsUsingFeatures::countAnyWorld(*document, HostsUsingFeatures::Feature::Ge tUserMediaInsecureHost); | 145 HostsUsingFeatures::countAnyWorld(*document, HostsUsingFeatures::Feature::Ge tUserMediaInsecureHost); |
| 146 Platform::current()->recordRapporURL("GetUserMedia.InsecureOrigin", WebURL(d ocument->url())); | |
| 144 return false; | 147 return false; |
| 145 } | 148 } |
| 146 | 149 |
| 147 Document* UserMediaRequest::ownerDocument() | 150 Document* UserMediaRequest::ownerDocument() |
| 148 { | 151 { |
| 149 if (ExecutionContext* context = getExecutionContext()) { | 152 if (ExecutionContext* context = getExecutionContext()) { |
| 150 return toDocument(context); | 153 return toDocument(context); |
| 151 } | 154 } |
| 152 | 155 |
| 153 return 0; | 156 return 0; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 | 219 |
| 217 DEFINE_TRACE(UserMediaRequest) | 220 DEFINE_TRACE(UserMediaRequest) |
| 218 { | 221 { |
| 219 visitor->trace(m_controller); | 222 visitor->trace(m_controller); |
| 220 visitor->trace(m_successCallback); | 223 visitor->trace(m_successCallback); |
| 221 visitor->trace(m_errorCallback); | 224 visitor->trace(m_errorCallback); |
| 222 ContextLifecycleObserver::trace(visitor); | 225 ContextLifecycleObserver::trace(visitor); |
| 223 } | 226 } |
| 224 | 227 |
| 225 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |