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

Side by Side Diff: third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp

Issue 2899763002: Measure usage of only CredentialRequestOptions.unmediated (Closed)
Patch Set: Rebase Created 3 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 | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/enums.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/credentialmanager/CredentialsContainer.h" 5 #include "modules/credentialmanager/CredentialsContainer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include "bindings/core/v8/Dictionary.h" 9 #include "bindings/core/v8/Dictionary.h"
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 ExecutionContext* context = ExecutionContext::From(script_state); 175 ExecutionContext* context = ExecutionContext::From(script_state);
176 // Set the default mediation option if none is provided. 176 // Set the default mediation option if none is provided.
177 // If both 'unmediated' and 'mediation' are set log a warning if they are 177 // If both 'unmediated' and 'mediation' are set log a warning if they are
178 // contradicting. 178 // contradicting.
179 // Also sets 'mediation' appropriately when only 'unmediated' is set. 179 // Also sets 'mediation' appropriately when only 'unmediated' is set.
180 // TODO(http://crbug.com/715077): Remove this when 'unmediated' is removed. 180 // TODO(http://crbug.com/715077): Remove this when 'unmediated' is removed.
181 String mediation = "optional"; 181 String mediation = "optional";
182 if (options.hasUnmediated() && !options.hasMediation()) { 182 if (options.hasUnmediated() && !options.hasMediation()) {
183 mediation = options.unmediated() ? "silent" : "optional"; 183 mediation = options.unmediated() ? "silent" : "optional";
184 UseCounter::Count(
185 context,
186 UseCounter::kCredentialManagerCredentialRequestOptionsOnlyUnmediated);
184 } else if (options.hasMediation()) { 187 } else if (options.hasMediation()) {
185 mediation = options.mediation(); 188 mediation = options.mediation();
186 if (options.hasUnmediated() && 189 if (options.hasUnmediated() &&
187 ((options.unmediated() && options.mediation() != "silent") || 190 ((options.unmediated() && options.mediation() != "silent") ||
188 (!options.unmediated() && options.mediation() != "optional"))) { 191 (!options.unmediated() && options.mediation() != "optional"))) {
189 context->AddConsoleMessage(ConsoleMessage::Create( 192 context->AddConsoleMessage(ConsoleMessage::Create(
190 kJSMessageSource, kWarningMessageLevel, 193 kJSMessageSource, kWarningMessageLevel,
191 "mediation: '" + options.mediation() + "' overrides unmediated: " + 194 "mediation: '" + options.mediation() + "' overrides unmediated: " +
192 (options.unmediated() ? "true" : "false") + ".")); 195 (options.unmediated() ? "true" : "false") + "."));
193 } 196 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 ScriptPromise promise = resolver->Promise(); 283 ScriptPromise promise = resolver->Promise();
281 if (!CheckBoilerplate(resolver)) 284 if (!CheckBoilerplate(resolver))
282 return promise; 285 return promise;
283 286
284 CredentialManagerClient::From(ExecutionContext::From(script_state)) 287 CredentialManagerClient::From(ExecutionContext::From(script_state))
285 ->DispatchRequireUserMediation(new NotificationCallbacks(resolver)); 288 ->DispatchRequireUserMediation(new NotificationCallbacks(resolver));
286 return promise; 289 return promise;
287 } 290 }
288 291
289 } // namespace blink 292 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698