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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp

Issue 2692333004: [Presentation API] Adds UseCounters for origin types. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
index 583a5f42bbe7d43349cd3d29da65bd71ed32e422..7f2e17eff9db3cb51db76acdeef5446f980eb9fb 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
@@ -226,6 +226,20 @@ DEFINE_TRACE(PresentationRequest) {
PresentationRequest::PresentationRequest(ExecutionContext* executionContext,
const Vector<KURL>& urls)
- : ContextLifecycleObserver(executionContext), m_urls(urls) {}
+ : ContextLifecycleObserver(executionContext), m_urls(urls) {
+ recordOriginTypeAccess(executionContext);
+}
+
+void PresentationRequest::recordOriginTypeAccess(
+ ExecutionContext* executionContext) const {
+ DCHECK(executionContext);
+ if (executionContext->isSecureContext()) {
+ UseCounter::count(executionContext,
+ UseCounter::PresentationRequestSecureOrigin);
+ } else {
+ UseCounter::count(executionContext,
+ UseCounter::PresentationRequestInsecureOrigin);
+ }
+}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/presentation/PresentationRequest.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698