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

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

Issue 1738073002: DevTools: introduce protocol::Value, baseline for hierarchical data in remote debugging protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: 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 b583d403172fe8d23a611c97f2810c59748f0f23..c744741f5d7d0e75a35ef3ce8a38c3e5b6afcd95 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
@@ -4,7 +4,7 @@
#include "platform/v8_inspector/V8DebuggerAgentImpl.h"
-#include "platform/JSONValues.h"
+#include "platform/inspector_protocol/Values.h"
#include "platform/v8_inspector/AsyncCallChain.h"
#include "platform/v8_inspector/IgnoreExceptionsScope.h"
#include "platform/v8_inspector/InjectedScript.h"
@@ -196,7 +196,7 @@ void V8DebuggerAgentImpl::disable(ErrorString*)
if (!enabled())
return;
- m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, JSONObject::create());
+ m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::DictionaryValue::create());
m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImpl::DontPauseOnExceptions);
m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0);
m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false);
@@ -236,7 +236,7 @@ void V8DebuggerAgentImpl::internalSetAsyncCallStackDepth(int depth)
m_v8AsyncCallTracker->asyncCallTrackingStateChanged(m_maxAsyncCallStackDepth);
}
-void V8DebuggerAgentImpl::setInspectorState(PassRefPtr<JSONObject> state)
+void V8DebuggerAgentImpl::setInspectorState(PassRefPtr<protocol::DictionaryValue> state)
{
m_state = state;
}
@@ -256,7 +256,7 @@ void V8DebuggerAgentImpl::restore()
enable();
String error;
- long pauseState = V8DebuggerImpl::DontPauseOnExceptions;
+ int pauseState = V8DebuggerImpl::DontPauseOnExceptions;
m_state->getNumber(DebuggerAgentState::pauseOnExceptionsState, &pauseState);
setPauseOnExceptionsImpl(&error, pauseState);
@@ -287,9 +287,9 @@ bool V8DebuggerAgentImpl::isPaused()
return debugger().isPaused();
}
-static PassRefPtr<JSONObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, bool isRegex)
+static PassRefPtr<protocol::DictionaryValue> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, bool isRegex)
{
- RefPtr<JSONObject> breakpointObject = JSONObject::create();
+ RefPtr<protocol::DictionaryValue> breakpointObject = protocol::DictionaryValue::create();
breakpointObject->setString(DebuggerAgentState::url, url);
breakpointObject->setNumber(DebuggerAgentState::lineNumber, lineNumber);
breakpointObject->setNumber(DebuggerAgentState::columnNumber, columnNumber);
@@ -335,9 +335,9 @@ void V8DebuggerAgentImpl::setBreakpointByUrl(ErrorString* errorString,
bool isRegex = optionalURLRegex.isJust();
String breakpointId = (isRegex ? "/" + url + "/" : url) + ':' + String::number(lineNumber) + ':' + String::number(columnNumber);
- RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
+ RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
if (!breakpointsCookie) {
- breakpointsCookie = JSONObject::create();
+ breakpointsCookie = protocol::DictionaryValue::create();
m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpointsCookie);
}
if (breakpointsCookie->find(breakpointId) != breakpointsCookie->end()) {
@@ -400,7 +400,7 @@ void V8DebuggerAgentImpl::removeBreakpoint(ErrorString* errorString, const Strin
{
if (!checkEnabled(errorString))
return;
- RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
+ RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
if (breakpointsCookie)
breakpointsCookie->remove(breakpointId);
removeBreakpoint(breakpointId);
@@ -727,7 +727,7 @@ void V8DebuggerAgentImpl::getCollectionEntries(ErrorString* errorString, const S
injectedScript->getCollectionEntries(errorString, objectId, entries);
}
-void V8DebuggerAgentImpl::schedulePauseOnNextStatement(const String& breakReason, PassRefPtr<JSONObject> data)
+void V8DebuggerAgentImpl::schedulePauseOnNextStatement(const String& breakReason, PassRefPtr<protocol::DictionaryValue> data)
{
ASSERT(enabled());
if (m_scheduledDebuggerStep == StepInto || m_javaScriptPauseScheduled || isPaused())
@@ -1445,12 +1445,12 @@ void V8DebuggerAgentImpl::didParseSource(const V8DebuggerParsedScript& parsedScr
if (scriptURL.isEmpty() || !parsedScript.success)
return;
- RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
+ RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
if (!breakpointsCookie)
return;
for (auto& cookie : *breakpointsCookie) {
- RefPtr<JSONObject> breakpointObject = JSONObject::cast(cookie.value);
+ RefPtr<protocol::DictionaryValue> breakpointObject = protocol::DictionaryValue::cast(cookie.value);
bool isRegex;
breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex);
String url;
@@ -1507,7 +1507,7 @@ V8DebuggerAgentImpl::SkipPauseRequest V8DebuggerAgentImpl::didPause(v8::Local<v8
}
} else if (m_pausingOnAsyncOperation) {
m_breakReason = protocol::Debugger::Paused::ReasonEnum::AsyncOperation;
- m_breakAuxData = JSONObject::create();
+ m_breakAuxData = protocol::DictionaryValue::create();
m_breakAuxData->setNumber("operationId", m_currentAsyncOperationId);
}
@@ -1557,7 +1557,7 @@ bool V8DebuggerAgentImpl::canBreakProgram()
return debugger().canBreakProgram();
}
-void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassRefPtr<JSONObject> data)
+void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassRefPtr<protocol::DictionaryValue> data)
{
ASSERT(enabled());
if (m_skipAllPauses || !m_pausedContext.IsEmpty() || isCallStackEmptyOrBlackboxed())
@@ -1571,7 +1571,7 @@ void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassRefPtr<JSO
debugger().breakProgram();
}
-void V8DebuggerAgentImpl::breakProgramOnException(const String& breakReason, PassRefPtr<JSONObject> data)
+void V8DebuggerAgentImpl::breakProgramOnException(const String& breakReason, PassRefPtr<protocol::DictionaryValue> data)
{
if (m_debugger->pauseOnExceptionsState() == V8DebuggerImpl::DontPauseOnExceptions)
return;

Powered by Google App Engine
This is Rietveld 408576698