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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp

Issue 1936593002: [DevTools] Remove state from v8 agent wrappers, remove unnecessary classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-everything-from-agents
Patch Set: rebased Created 4 years, 7 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: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
index 7b46e8a2581e5b3aa075c9750c87312735b817de..84338fee8042dcf53de200f77c995f9923509c92 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
@@ -43,6 +43,7 @@ namespace blink {
namespace V8RuntimeAgentImplState {
static const char customObjectFormatterEnabled[] = "customObjectFormatterEnabled";
+static const char runtimeEnabled[] = "runtimeEnabled";
};
using protocol::Runtime::ExceptionDetails;
@@ -365,6 +366,8 @@ void V8RuntimeAgentImpl::clearFrontend()
void V8RuntimeAgentImpl::restore()
{
+ if (!m_state->booleanProperty(V8RuntimeAgentImplState::runtimeEnabled, false))
+ return;
m_frontend->executionContextsCleared();
ErrorString error;
enable(&error);
@@ -378,6 +381,7 @@ void V8RuntimeAgentImpl::enable(ErrorString* errorString)
return;
m_session->changeInstrumentationCounter(+1);
m_enabled = true;
+ m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true);
v8::HandleScope handles(m_debugger->isolate());
m_session->reportAllContexts(this);
}
@@ -387,6 +391,7 @@ void V8RuntimeAgentImpl::disable(ErrorString* errorString)
if (!m_enabled)
return;
m_enabled = false;
+ m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false);
m_session->discardInjectedScripts();
reset();
m_session->changeInstrumentationCounter(-1);

Powered by Google App Engine
This is Rietveld 408576698