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

Unified Diff: third_party/WebKit/Source/modules/notifications/Notification.cpp

Issue 2695433002: Add a UseCounter for notification permission requests from iframes (Closed)
Patch Set: rebase again 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/notifications/Notification.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp
index 597041c315052cd3fe8a8450225ae7b1225faf02..7d110ddc04fd3142cd5082837d45487706b05462 100644
--- a/third_party/WebKit/Source/modules/notifications/Notification.cpp
+++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp
@@ -366,8 +366,17 @@ ScriptPromise Notification::requestPermission(
Deprecation::countDeprecation(
context, UseCounter::NotificationPermissionRequestedInsecureOrigin);
}
+ if (context->isDocument()) {
+ LocalFrame* frame = toDocument(context)->frame();
+ if (frame && !frame->isMainFrame()) {
+ UseCounter::count(context,
+ UseCounter::NotificationPermissionRequestedIframe);
+ }
+ }
+
InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(
context, "Notification.requestPermission", true, true);
+
return NotificationManager::from(context)->requestPermission(
scriptState, deprecatedCallback);
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698