Chromium Code Reviews| 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 bae1b22a4c8ac500fa45dc79a5d869cddec20f0c..eaafe097be177b0cf57202ef54b1696b29afc54d 100644 |
| --- a/third_party/WebKit/Source/core/inspector/InspectorLogAgent.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/InspectorLogAgent.cpp |
| @@ -5,6 +5,7 @@ |
| #include "core/inspector/InspectorLogAgent.h" |
| #include "bindings/core/v8/SourceLocation.h" |
| +#include "core/frame/PerformanceMonitor.h" |
| #include "core/inspector/ConsoleMessage.h" |
| #include "core/inspector/ConsoleMessageStorage.h" |
| #include "core/inspector/IdentifiersFactory.h" |
| @@ -57,19 +58,25 @@ String messageLevelValue(MessageLevel level) { |
| return protocol::Log::LogEntry::LevelEnum::Error; |
| case InfoMessageLevel: |
| return protocol::Log::LogEntry::LevelEnum::Info; |
| + case ViolationMessageLevel: |
| + return protocol::Log::LogEntry::LevelEnum::Violation; |
| } |
| return protocol::Log::LogEntry::LevelEnum::Log; |
| } |
| } // namespace |
| -InspectorLogAgent::InspectorLogAgent(ConsoleMessageStorage* storage) |
| - : m_enabled(false), m_storage(storage) {} |
| +InspectorLogAgent::InspectorLogAgent(ConsoleMessageStorage* storage, |
| + PerformanceMonitor* performanceMonitor) |
| + : m_enabled(false), |
| + m_storage(storage), |
| + m_performanceMonitor(performanceMonitor) {} |
| InspectorLogAgent::~InspectorLogAgent() {} |
| DEFINE_TRACE(InspectorLogAgent) { |
| visitor->trace(m_storage); |
| + visitor->trace(m_performanceMonitor); |
| InspectorBaseAgent::trace(visitor); |
| } |
| @@ -112,6 +119,8 @@ void InspectorLogAgent::consoleMessageAdded(ConsoleMessage* message) { |
| void InspectorLogAgent::enable(ErrorString*) { |
| if (m_enabled) |
| return; |
| + if (m_performanceMonitor) |
|
panicker
2016/11/04 20:59:28
under what conditions is this enabled ?
is this ex
pfeldman
2016/11/04 21:26:39
This is called when devtools is opened, so one get
|
| + m_performanceMonitor->setLoggingEnabled(true); |
| m_instrumentingAgents->addInspectorLogAgent(this); |
| m_state->setBoolean(LogAgentState::logEnabled, true); |
| m_enabled = true; |
| @@ -135,6 +144,8 @@ void InspectorLogAgent::enable(ErrorString*) { |
| void InspectorLogAgent::disable(ErrorString*) { |
| if (!m_enabled) |
| return; |
| + if (m_performanceMonitor) |
| + m_performanceMonitor->setLoggingEnabled(false); |
| m_state->setBoolean(LogAgentState::logEnabled, false); |
| m_enabled = false; |
| m_instrumentingAgents->removeInspectorLogAgent(this); |