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

Unified Diff: src/inspector/v8-runtime-agent-impl.cc

Issue 2713023004: [inspector] added reconnect method for tests (Closed)
Patch Set: addressed comments Created 3 years, 10 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
Index: src/inspector/v8-runtime-agent-impl.cc
diff --git a/src/inspector/v8-runtime-agent-impl.cc b/src/inspector/v8-runtime-agent-impl.cc
index 17c8a7b1accbd2507f5fb34ea15a76ba284c9e98..1118f350f30894b07b3c84ed80ae93f169d4fe48 100644
--- a/src/inspector/v8-runtime-agent-impl.cc
+++ b/src/inspector/v8-runtime-agent-impl.cc
@@ -521,6 +521,7 @@ Response V8RuntimeAgentImpl::runIfWaitingForDebugger() {
Response V8RuntimeAgentImpl::setCustomObjectFormatterEnabled(bool enabled) {
m_state->setBoolean(V8RuntimeAgentImplState::customObjectFormatterEnabled,
enabled);
+ if (!m_enabled) return Response::Error("Runtime agent is not enabled");
m_session->setCustomObjectFormatterEnabled(enabled);
return Response::OK();
}
@@ -664,6 +665,7 @@ Response V8RuntimeAgentImpl::enable() {
m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true);
m_inspector->enableStackCapturingIfNeeded();
m_session->reportAllContexts(this);
+
V8ConsoleMessageStorage* storage =
m_inspector->ensureConsoleMessageStorage(m_session->contextGroupId());
for (const auto& message : storage->messages()) {
@@ -678,6 +680,7 @@ Response V8RuntimeAgentImpl::disable() {
m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false);
m_inspector->disableStackCapturingIfNeeded();
m_session->discardInjectedScripts();
+ m_session->setCustomObjectFormatterEnabled(false);
dgozman 2017/02/28 19:46:40 Nice one!
reset();
m_inspector->client()->endEnsureAllContextsInGroup(
m_session->contextGroupId());
« no previous file with comments | « no previous file | test/inspector/console/memory-setter-in-strict-mode.js » ('j') | test/inspector/runtime/runtime-restore.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698