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

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

Issue 1745423002: DevTools: migrate protocol values from RefPtr to OwnPtr. (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 c744741f5d7d0e75a35ef3ce8a38c3e5b6afcd95..3561ce8043239e46ac978023fa12dc63c57d0830 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
@@ -236,7 +236,7 @@ void V8DebuggerAgentImpl::internalSetAsyncCallStackDepth(int depth)
m_v8AsyncCallTracker->asyncCallTrackingStateChanged(m_maxAsyncCallStackDepth);
}
-void V8DebuggerAgentImpl::setInspectorState(PassRefPtr<protocol::DictionaryValue> state)
+void V8DebuggerAgentImpl::setInspectorState(protocol::DictionaryValue* state)
{
m_state = state;
}
@@ -287,9 +287,9 @@ bool V8DebuggerAgentImpl::isPaused()
return debugger().isPaused();
}
-static PassRefPtr<protocol::DictionaryValue> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, bool isRegex)
+static PassOwnPtr<protocol::DictionaryValue> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, bool isRegex)
{
- RefPtr<protocol::DictionaryValue> breakpointObject = protocol::DictionaryValue::create();
+ OwnPtr<protocol::DictionaryValue> breakpointObject = protocol::DictionaryValue::create();
breakpointObject->setString(DebuggerAgentState::url, url);
breakpointObject->setNumber(DebuggerAgentState::lineNumber, lineNumber);
breakpointObject->setNumber(DebuggerAgentState::columnNumber, columnNumber);
@@ -335,18 +335,18 @@ void V8DebuggerAgentImpl::setBreakpointByUrl(ErrorString* errorString,
bool isRegex = optionalURLRegex.isJust();
String breakpointId = (isRegex ? "/" + url + "/" : url) + ':' + String::number(lineNumber) + ':' + String::number(columnNumber);
- RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
+ protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
if (!breakpointsCookie) {
- breakpointsCookie = protocol::DictionaryValue::create();
- m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpointsCookie);
+ OwnPtr<protocol::DictionaryValue> newValue = protocol::DictionaryValue::create();
+ breakpointsCookie = newValue.get();
+ m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, newValue.release());
}
- if (breakpointsCookie->find(breakpointId) != breakpointsCookie->end()) {
+ if (breakpointsCookie->get(breakpointId)) {
*errorString = "Breakpoint at specified location already exists.";
return;
}
breakpointsCookie->setObject(breakpointId, buildObjectForBreakpointCookie(url, lineNumber, columnNumber, condition, isRegex));
- m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpointsCookie);
ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition);
for (auto& script : m_scripts) {
@@ -400,7 +400,7 @@ void V8DebuggerAgentImpl::removeBreakpoint(ErrorString* errorString, const Strin
{
if (!checkEnabled(errorString))
return;
- RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
+ 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<protocol::DictionaryValue> data)
+void V8DebuggerAgentImpl::schedulePauseOnNextStatement(const String& breakReason, PassOwnPtr<protocol::DictionaryValue> data)
{
ASSERT(enabled());
if (m_scheduledDebuggerStep == StepInto || m_javaScriptPauseScheduled || isPaused())
@@ -984,7 +984,7 @@ void V8DebuggerAgentImpl::setVariableValue(ErrorString* errorString,
*errorString = "Either call frame or function object must be specified";
return;
}
- String newValueString = protocol::toValue(newValue)->toJSONString();
+ String newValueString = protocol::toValue(newValue.get())->toJSONString();
v8::HandleScope scope(m_isolate);
v8::Local<v8::Object> currentCallStack = m_currentCallStack.Get(m_isolate);
injectedScript->setVariableValue(errorString, currentCallStack, callFrameId, functionObjectId, scopeNumber, variableName, newValueString);
@@ -1445,12 +1445,12 @@ void V8DebuggerAgentImpl::didParseSource(const V8DebuggerParsedScript& parsedScr
if (scriptURL.isEmpty() || !parsedScript.success)
return;
- RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
+ protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
if (!breakpointsCookie)
return;
for (auto& cookie : *breakpointsCookie) {
- RefPtr<protocol::DictionaryValue> breakpointObject = protocol::DictionaryValue::cast(cookie.value);
+ protocol::DictionaryValue* breakpointObject = protocol::DictionaryValue::cast(cookie.value.get());
bool isRegex;
breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex);
String url;
@@ -1528,7 +1528,7 @@ V8DebuggerAgentImpl::SkipPauseRequest V8DebuggerAgentImpl::didPause(v8::Local<v8
if (!m_asyncOperationNotifications.isEmpty())
flushAsyncOperationEvents(nullptr);
- m_frontend->paused(currentCallFrames(), m_breakReason, m_breakAuxData, hitBreakpointIds.release(), currentAsyncStackTrace());
+ m_frontend->paused(currentCallFrames(), m_breakReason, m_breakAuxData.release(), hitBreakpointIds.release(), currentAsyncStackTrace());
m_scheduledDebuggerStep = NoStep;
m_javaScriptPauseScheduled = false;
m_steppingFromFramework = false;
@@ -1557,7 +1557,7 @@ bool V8DebuggerAgentImpl::canBreakProgram()
return debugger().canBreakProgram();
}
-void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassRefPtr<protocol::DictionaryValue> data)
+void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassOwnPtr<protocol::DictionaryValue> data)
{
ASSERT(enabled());
if (m_skipAllPauses || !m_pausedContext.IsEmpty() || isCallStackEmptyOrBlackboxed())
@@ -1571,7 +1571,7 @@ void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassRefPtr<pro
debugger().breakProgram();
}
-void V8DebuggerAgentImpl::breakProgramOnException(const String& breakReason, PassRefPtr<protocol::DictionaryValue> data)
+void V8DebuggerAgentImpl::breakProgramOnException(const String& breakReason, PassOwnPtr<protocol::DictionaryValue> data)
{
if (m_debugger->pauseOnExceptionsState() == V8DebuggerImpl::DontPauseOnExceptions)
return;

Powered by Google App Engine
This is Rietveld 408576698