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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Parser.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/inspector_protocol/Parser.cpp
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp b/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
index 2257c3c81653c26d462a9e1ebba2400e3dfed55b..ce72028645dfe5a13f7b592e93e25197ca87fa43 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
@@ -419,12 +419,12 @@ bool decodeString(const CharType* start, const CharType* end, String* output)
}
template<typename CharType>
-PassRefPtr<Value> buildValue(const CharType* start, const CharType* end, const CharType** valueTokenEnd, int depth)
+PassOwnPtr<Value> buildValue(const CharType* start, const CharType* end, const CharType** valueTokenEnd, int depth)
{
if (depth > stackLimit)
return nullptr;
- RefPtr<Value> result;
+ OwnPtr<Value> result;
const CharType* tokenStart;
const CharType* tokenEnd;
Token token = parseToken(start, end, &tokenStart, &tokenEnd);
@@ -459,14 +459,14 @@ PassRefPtr<Value> buildValue(const CharType* start, const CharType* end, const C
break;
}
case ArrayBegin: {
- RefPtr<ListValue> array = ListValue::create();
+ OwnPtr<ListValue> array = ListValue::create();
start = tokenEnd;
token = parseToken(start, end, &tokenStart, &tokenEnd);
while (token != ArrayEnd) {
- RefPtr<Value> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
+ OwnPtr<Value> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
if (!arrayNode)
return nullptr;
- array->pushValue(arrayNode);
+ array->pushValue(arrayNode.release());
// After a list value, we expect a comma or the end of the list.
start = tokenEnd;
@@ -487,7 +487,7 @@ PassRefPtr<Value> buildValue(const CharType* start, const CharType* end, const C
break;
}
case ObjectBegin: {
- RefPtr<DictionaryValue> object = DictionaryValue::create();
+ OwnPtr<DictionaryValue> object = DictionaryValue::create();
start = tokenEnd;
token = parseToken(start, end, &tokenStart, &tokenEnd);
while (token != ObjectEnd) {
@@ -503,10 +503,10 @@ PassRefPtr<Value> buildValue(const CharType* start, const CharType* end, const C
return nullptr;
start = tokenEnd;
- RefPtr<Value> value = buildValue(start, end, &tokenEnd, depth + 1);
+ OwnPtr<Value> value = buildValue(start, end, &tokenEnd, depth + 1);
if (!value)
return nullptr;
- object->setValue(key, value);
+ object->setValue(key, value.release());
start = tokenEnd;
// After a key/value pair, we expect a comma or the end of the
@@ -538,11 +538,11 @@ PassRefPtr<Value> buildValue(const CharType* start, const CharType* end, const C
}
template<typename CharType>
-PassRefPtr<Value> parseJSONInternal(const CharType* start, unsigned length)
+PassOwnPtr<Value> parseJSONInternal(const CharType* start, unsigned length)
{
const CharType* end = start + length;
const CharType *tokenEnd;
- RefPtr<Value> value = buildValue(start, end, &tokenEnd, 0);
+ OwnPtr<Value> value = buildValue(start, end, &tokenEnd, 0);
if (!value || tokenEnd != end)
return nullptr;
return value.release();
@@ -550,7 +550,7 @@ PassRefPtr<Value> parseJSONInternal(const CharType* start, unsigned length)
} // anonymous namespace
-PassRefPtr<Value> parseJSON(const String& json)
+PassOwnPtr<Value> parseJSON(const String& json)
{
if (json.isEmpty())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698