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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 2490563002: Revert of DevTools: add the logging aspect into the PerformanceMonitor (Closed)
Patch Set: Created 4 years, 1 month 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/core/inspector/InspectorPageAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index a06b1a98f70ebb35fc1471817134d44117287920..cb2a9de69b10ec297e673e02b7b201f71ee825f3 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -81,6 +81,8 @@
"pageAgentScriptsToEvaluateOnLoad";
static const char screencastEnabled[] = "screencastEnabled";
static const char autoAttachToCreatedPages[] = "autoAttachToCreatedPages";
+static const char blockedEventsWarningThreshold[] =
+ "blockedEventsWarningThreshold";
static const char overlaySuspended[] = "overlaySuspended";
static const char overlayMessage[] = "overlayMessage";
}
@@ -369,6 +371,8 @@
void InspectorPageAgent::restore() {
if (m_state->booleanProperty(PageAgentState::pageAgentEnabled, false))
enable();
+ setBlockedEventsWarningThreshold(m_state->doubleProperty(
+ PageAgentState::blockedEventsWarningThreshold, 0.0));
if (m_client) {
String overlayMessage;
m_state->getString(PageAgentState::overlayMessage, &overlayMessage);
@@ -841,6 +845,16 @@
return Response::OK();
}
+Response InspectorPageAgent::setBlockedEventsWarningThreshold(
+ double threshold) {
+ m_state->setDouble(PageAgentState::blockedEventsWarningThreshold, threshold);
+ FrameHost* host = m_inspectedFrames->root()->host();
+ if (!host)
+ return Response::Error("Host not found");
+ host->settings().setBlockedMainThreadEventsWarningThreshold(threshold);
+ return Response::OK();
+}
+
Response InspectorPageAgent::getLayoutMetrics(
std::unique_ptr<protocol::Page::LayoutViewport>* outLayoutViewport,
std::unique_ptr<protocol::Page::VisualViewport>* outVisualViewport) {

Powered by Google App Engine
This is Rietveld 408576698