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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp

Issue 2057153002: Add GetUserMedia ETLD+1 rappor metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix email Created 4 years, 6 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
« no previous file with comments | « no previous file | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28 matching lines...) Expand all
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
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
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
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698