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

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

Issue 2179683002: [DevTools] Cleanup v8_inspector API part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: breakDetails 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/V8InspectorSessionImpl.h" 5 #include "platform/v8_inspector/V8InspectorSessionImpl.h"
6 6
7 #include "platform/inspector_protocol/Parser.h" 7 #include "platform/inspector_protocol/Parser.h"
8 #include "platform/v8_inspector/InjectedScript.h" 8 #include "platform/v8_inspector/InjectedScript.h"
9 #include "platform/v8_inspector/InspectedContext.h" 9 #include "platform/v8_inspector/InspectedContext.h"
10 #include "platform/v8_inspector/RemoteObjectId.h" 10 #include "platform/v8_inspector/RemoteObjectId.h"
11 #include "platform/v8_inspector/V8ConsoleAgentImpl.h" 11 #include "platform/v8_inspector/V8ConsoleAgentImpl.h"
12 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" 12 #include "platform/v8_inspector/V8DebuggerAgentImpl.h"
13 #include "platform/v8_inspector/V8DebuggerImpl.h" 13 #include "platform/v8_inspector/V8DebuggerImpl.h"
14 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h" 14 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h"
15 #include "platform/v8_inspector/V8ProfilerAgentImpl.h" 15 #include "platform/v8_inspector/V8ProfilerAgentImpl.h"
16 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" 16 #include "platform/v8_inspector/V8RuntimeAgentImpl.h"
17 #include "platform/v8_inspector/public/V8ContextInfo.h" 17 #include "platform/v8_inspector/public/V8ContextInfo.h"
18 #include "platform/v8_inspector/public/V8DebuggerClient.h" 18 #include "platform/v8_inspector/public/V8DebuggerClient.h"
19 19
20 namespace blink { 20 namespace blink {
21 21
22 const char V8InspectorSession::backtraceObjectGroup[] = "backtrace"; 22 const char V8InspectorSession::backtraceObjectGroup[] = "backtrace";
23 23
24 // static 24 // static
25 bool V8InspectorSession::isV8ProtocolMethod(const String16& method) 25 bool V8InspectorSession::canDispatchMethod(const String16& method)
26 { 26 {
27 return method.startWith("Debugger.") || method.startWith("HeapProfiler.") || method.startWith("Profiler.") || method.startWith("Runtime.") || method.startWi th("Console."); 27 return method.startWith(protocol::Runtime::Metainfo::commandPrefix)
28 || method.startWith(protocol::Debugger::Metainfo::commandPrefix)
29 || method.startWith(protocol::Profiler::Metainfo::commandPrefix)
30 || method.startWith(protocol::HeapProfiler::Metainfo::commandPrefix)
31 || method.startWith(protocol::Console::Metainfo::commandPrefix);
28 } 32 }
29 33
30 std::unique_ptr<V8InspectorSessionImpl> V8InspectorSessionImpl::create(V8Debugge rImpl* debugger, int contextGroupId, protocol::FrontendChannel* channel, V8Inspe ctorSessionClient* client, const String16* state) 34 std::unique_ptr<V8InspectorSessionImpl> V8InspectorSessionImpl::create(V8Debugge rImpl* debugger, int contextGroupId, protocol::FrontendChannel* channel, V8Inspe ctorSessionClient* client, const String16* state)
31 { 35 {
32 return wrapUnique(new V8InspectorSessionImpl(debugger, contextGroupId, chann el, client, state)); 36 return wrapUnique(new V8InspectorSessionImpl(debugger, contextGroupId, chann el, client, state));
33 } 37 }
34 38
35 V8InspectorSessionImpl::V8InspectorSessionImpl(V8DebuggerImpl* debugger, int con textGroupId, protocol::FrontendChannel* channel, V8InspectorSessionClient* clien t, const String16* savedState) 39 V8InspectorSessionImpl::V8InspectorSessionImpl(V8DebuggerImpl* debugger, int con textGroupId, protocol::FrontendChannel* channel, V8InspectorSessionClient* clien t, const String16* savedState)
36 : m_contextGroupId(contextGroupId) 40 : m_contextGroupId(contextGroupId)
37 , m_debugger(debugger) 41 , m_debugger(debugger)
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 m_inspectedObjects.resize(kInspectedObjectBufferSize); 275 m_inspectedObjects.resize(kInspectedObjectBufferSize);
272 } 276 }
273 277
274 V8InspectorSession::Inspectable* V8InspectorSessionImpl::inspectedObject(unsigne d num) 278 V8InspectorSession::Inspectable* V8InspectorSessionImpl::inspectedObject(unsigne d num)
275 { 279 {
276 if (num >= m_inspectedObjects.size()) 280 if (num >= m_inspectedObjects.size())
277 return nullptr; 281 return nullptr;
278 return m_inspectedObjects[num].get(); 282 return m_inspectedObjects[num].get();
279 } 283 }
280 284
281 void V8InspectorSessionImpl::schedulePauseOnNextStatement(const String16& breakR eason, std::unique_ptr<protocol::DictionaryValue> data) 285 void V8InspectorSessionImpl::schedulePauseOnNextStatement(const String16& breakR eason, const String16& breakDetails)
282 { 286 {
283 m_debuggerAgent->schedulePauseOnNextStatement(breakReason, std::move(data)); 287 m_debuggerAgent->schedulePauseOnNextStatement(breakReason, protocol::Diction aryValue::cast(parseJSON(breakDetails)));
284 } 288 }
285 289
286 void V8InspectorSessionImpl::cancelPauseOnNextStatement() 290 void V8InspectorSessionImpl::cancelPauseOnNextStatement()
287 { 291 {
288 m_debuggerAgent->cancelPauseOnNextStatement(); 292 m_debuggerAgent->cancelPauseOnNextStatement();
289 } 293 }
290 294
291 void V8InspectorSessionImpl::breakProgram(const String16& breakReason, std::uniq ue_ptr<protocol::DictionaryValue> data) 295 void V8InspectorSessionImpl::breakProgram(const String16& breakReason, const Str ing16& breakDetails)
292 { 296 {
293 m_debuggerAgent->breakProgram(breakReason, std::move(data)); 297 m_debuggerAgent->breakProgram(breakReason, protocol::DictionaryValue::cast(p arseJSON(breakDetails)));
294 } 298 }
295 299
296 void V8InspectorSessionImpl::setSkipAllPauses(bool skip) 300 void V8InspectorSessionImpl::setSkipAllPauses(bool skip)
297 { 301 {
298 ErrorString errorString; 302 ErrorString errorString;
299 m_debuggerAgent->setSkipAllPauses(&errorString, skip); 303 m_debuggerAgent->setSkipAllPauses(&errorString, skip);
300 } 304 }
301 305
302 void V8InspectorSessionImpl::resume() 306 void V8InspectorSessionImpl::resume()
303 { 307 {
304 ErrorString errorString; 308 ErrorString errorString;
305 m_debuggerAgent->resume(&errorString); 309 m_debuggerAgent->resume(&errorString);
306 } 310 }
307 311
308 void V8InspectorSessionImpl::stepOver() 312 void V8InspectorSessionImpl::stepOver()
309 { 313 {
310 ErrorString errorString; 314 ErrorString errorString;
311 m_debuggerAgent->stepOver(&errorString); 315 m_debuggerAgent->stepOver(&errorString);
312 } 316 }
313 317
314 } // namespace blink 318 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698