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

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

Issue 1933573002: [DevTools] Remove last bits of logic from v8 agent wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1913283003
Patch Set: rebased, fixed uninitialized variable 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/V8DebuggerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
index 1291a5664fdd3b9eed6b04b0d4e0d54d20df7c94..0b53f67c2e8667307d993b8b441f826ac10faa29 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
@@ -210,13 +210,17 @@ bool V8DebuggerAgentImpl::enabled()
return m_enabled;
}
-void V8DebuggerAgentImpl::enable(ErrorString*)
+void V8DebuggerAgentImpl::enable(ErrorString* errorString)
{
if (enabled())
return;
- enable();
+ if (!m_session->client()->canExecuteScripts()) {
+ *errorString = "Script execution is prohibited";
+ return;
+ }
+ enable();
ASSERT(m_frontend);
}
@@ -281,6 +285,9 @@ void V8DebuggerAgentImpl::clearFrontend()
void V8DebuggerAgentImpl::restore()
{
ASSERT(!m_enabled);
+ if (!m_session->client()->canExecuteScripts())
+ return;
+
enable();
ErrorString error;

Powered by Google App Engine
This is Rietveld 408576698