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

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

Issue 1121053002: Add metrics for dialogs triggered inside sandboxed documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 910d97e89ed762cbde1ef975296265d49a815018..6934f4b2610fa44618642dbf6680c2ade8beae9f 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -825,6 +825,9 @@ void LocalDOMWindow::print()
}
m_shouldPrintWhenFinishedLoading = false;
host->chrome().print(frame());
+
+ if (frame()->document()->sandboxFlags())
+ UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
}
void LocalDOMWindow::stop()
@@ -845,6 +848,9 @@ void LocalDOMWindow::alert(const String& message)
if (!host)
return;
+ if (frame()->document()->sandboxFlags())
+ UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
+
host->chrome().runJavaScriptAlert(frame(), message);
}
@@ -859,6 +865,9 @@ bool LocalDOMWindow::confirm(const String& message)
if (!host)
return false;
+ if (frame()->document()->sandboxFlags())
+ UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
+
return host->chrome().runJavaScriptConfirm(frame(), message);
}
@@ -873,6 +882,9 @@ String LocalDOMWindow::prompt(const String& message, const String& defaultValue)
if (!host)
return String();
+ if (frame()->document()->sandboxFlags())
+ UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
+
String returnValue;
if (host->chrome().runJavaScriptPrompt(frame(), message, defaultValue, returnValue))
return returnValue;
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698