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

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2079183002: Measure the usage of cross-origin modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update histograms.xml again 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 20a01b9f6b24d98edfe157a16ae76c19f7f7615c..a956131d01253adcebf09c72beb48f7f2fbd9329 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -764,6 +764,10 @@ void LocalDOMWindow::print(ScriptState* scriptState)
m_shouldPrintWhenFinishedLoading = true;
return;
}
+
+ if (frame()->isCrossOrigin()) {
dcheng 2016/06/21 11:20:02 Nit: no { } around a single-line conditional body
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowPrint);
+ }
m_shouldPrintWhenFinishedLoading = false;
host->chromeClient().print(frame());
}
@@ -802,6 +806,10 @@ void LocalDOMWindow::alert(ScriptState* scriptState, const String& message)
if (!host)
return;
+ if (frame()->isCrossOrigin()) {
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowAlert);
+ }
+
host->chromeClient().openJavaScriptAlert(frame(), message);
}
@@ -832,6 +840,9 @@ bool LocalDOMWindow::confirm(ScriptState* scriptState, const String& message)
if (!host)
return false;
+ if (frame()->isCrossOrigin()) {
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowConfirm);
+ }
return host->chromeClient().openJavaScriptConfirm(frame(), message);
}
@@ -866,6 +877,10 @@ String LocalDOMWindow::prompt(ScriptState* scriptState, const String& message, c
if (host->chromeClient().openJavaScriptPrompt(frame(), message, defaultValue, returnValue))
return returnValue;
+ if (frame()->isCrossOrigin()) {
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowPrompt);
+ }
+
return String();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698