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

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

Issue 2502843002: DevTools: issue document.write(script) violation reports. (Closed)
Patch Set: rebaselined 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/InspectorLogAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLogAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorLogAgent.cpp
index d2c295e9384104df7a77325332c89943bc1e47f4..afc43d59f3b1afbe7be35f85275c3fb5d047ba36 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorLogAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorLogAgent.cpp
@@ -171,6 +171,8 @@ static PerformanceMonitor::Violation parseViolation(const String& name) {
return PerformanceMonitor::kLongLayout;
if (name == ViolationSetting::NameEnum::BlockedEvent)
return PerformanceMonitor::kBlockedEvent;
+ if (name == ViolationSetting::NameEnum::BlockedParser)
+ return PerformanceMonitor::kBlockedParser;
return PerformanceMonitor::kAfterLast;
}
@@ -207,7 +209,7 @@ void InspectorLogAgent::reportLongTask(
const HeapHashSet<Member<Frame>>& contextFrames) {
double time = (endTime - startTime) * 1000;
String messageText =
- String::format("Long running JavaScript task took %ldms.", lround(time));
+ String::format("Long running JavaScript task took %ldms", lround(time));
ConsoleMessage* message = ConsoleMessage::create(
ViolationMessageSource, WarningMessageLevel, messageText);
consoleMessageAdded(message);
@@ -215,7 +217,7 @@ void InspectorLogAgent::reportLongTask(
void InspectorLogAgent::reportLongLayout(double duration) {
String messageText =
- String::format("Forced reflow while executing JavaScript took %ldms.",
+ String::format("Forced reflow while executing JavaScript took %ldms",
lround(duration * 1000));
ConsoleMessage* message = ConsoleMessage::create(
ViolationMessageSource, WarningMessageLevel, messageText);
@@ -226,9 +228,8 @@ void InspectorLogAgent::reportGenericViolation(PerformanceMonitor::Violation,
const String& text,
double time,
SourceLocation* location) {
- ConsoleMessage* message =
- ConsoleMessage::create(ViolationMessageSource, WarningMessageLevel, text,
- location ? location->clone() : nullptr);
+ ConsoleMessage* message = ConsoleMessage::create(
+ ViolationMessageSource, WarningMessageLevel, text, location->clone());
consoleMessageAdded(message);
};

Powered by Google App Engine
This is Rietveld 408576698