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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp

Issue 2194063002: [DevTools] Move canExecuteScript to V8DebuggerClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h"
6 6
7 #include "platform/inspector_protocol/String16.h" 7 #include "platform/inspector_protocol/String16.h"
8 #include "platform/inspector_protocol/Values.h" 8 #include "platform/inspector_protocol/Values.h"
9 #include "platform/v8_inspector/InjectedScript.h" 9 #include "platform/v8_inspector/InjectedScript.h"
10 #include "platform/v8_inspector/InspectedContext.h" 10 #include "platform/v8_inspector/InspectedContext.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool V8DebuggerAgentImpl::enabled() 145 bool V8DebuggerAgentImpl::enabled()
146 { 146 {
147 return m_enabled; 147 return m_enabled;
148 } 148 }
149 149
150 void V8DebuggerAgentImpl::enable(ErrorString* errorString) 150 void V8DebuggerAgentImpl::enable(ErrorString* errorString)
151 { 151 {
152 if (enabled()) 152 if (enabled())
153 return; 153 return;
154 154
155 if (!m_session->client()->canExecuteScripts()) { 155 if (!m_debugger->client()->canExecuteScripts(m_session->contextGroupId())) {
156 *errorString = "Script execution is prohibited"; 156 *errorString = "Script execution is prohibited";
157 return; 157 return;
158 } 158 }
159 159
160 enable(); 160 enable();
161 } 161 }
162 162
163 void V8DebuggerAgentImpl::disable(ErrorString*) 163 void V8DebuggerAgentImpl::disable(ErrorString*)
164 { 164 {
165 if (!enabled()) 165 if (!enabled())
(...skipping 27 matching lines...) Expand all
193 m_state->remove(DebuggerAgentState::blackboxPattern); 193 m_state->remove(DebuggerAgentState::blackboxPattern);
194 m_enabled = false; 194 m_enabled = false;
195 m_state->setBoolean(DebuggerAgentState::debuggerEnabled, false); 195 m_state->setBoolean(DebuggerAgentState::debuggerEnabled, false);
196 } 196 }
197 197
198 void V8DebuggerAgentImpl::restore() 198 void V8DebuggerAgentImpl::restore()
199 { 199 {
200 DCHECK(!m_enabled); 200 DCHECK(!m_enabled);
201 if (!m_state->booleanProperty(DebuggerAgentState::debuggerEnabled, false)) 201 if (!m_state->booleanProperty(DebuggerAgentState::debuggerEnabled, false))
202 return; 202 return;
203 if (!m_session->client()->canExecuteScripts()) 203 if (!m_debugger->client()->canExecuteScripts(m_session->contextGroupId()))
204 return; 204 return;
205 205
206 enable(); 206 enable();
207 ErrorString error; 207 ErrorString error;
208 208
209 int pauseState = V8DebuggerImpl::DontPauseOnExceptions; 209 int pauseState = V8DebuggerImpl::DontPauseOnExceptions;
210 m_state->getInteger(DebuggerAgentState::pauseOnExceptionsState, &pauseState) ; 210 m_state->getInteger(DebuggerAgentState::pauseOnExceptionsState, &pauseState) ;
211 setPauseOnExceptionsImpl(&error, pauseState); 211 setPauseOnExceptionsImpl(&error, pauseState);
212 DCHECK(error.isEmpty()); 212 DCHECK(error.isEmpty());
213 213
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 { 1189 {
1190 if (!enabled()) 1190 if (!enabled())
1191 return; 1191 return;
1192 m_scheduledDebuggerStep = NoStep; 1192 m_scheduledDebuggerStep = NoStep;
1193 m_scripts.clear(); 1193 m_scripts.clear();
1194 m_blackboxedPositions.clear(); 1194 m_blackboxedPositions.clear();
1195 m_breakpointIdToDebuggerBreakpointIds.clear(); 1195 m_breakpointIdToDebuggerBreakpointIds.clear();
1196 } 1196 }
1197 1197
1198 } // namespace blink 1198 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698