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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/public/V8ToProtocolValue.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/public/V8ToProtocolValue.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/public/V8ToProtocolValue.cpp b/third_party/WebKit/Source/platform/v8_inspector/public/V8ToProtocolValue.cpp
index 8c4a92152c865f7d88945a6a33b9de89cf409c0e..4bd0b37f228e5f4b0493c809620a249273394113 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/public/V8ToProtocolValue.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/public/V8ToProtocolValue.cpp
@@ -15,7 +15,7 @@ static String coreString(v8::Local<v8::String> v8String)
return result;
}
-PassRefPtr<protocol::Value> toProtocolValue(v8::Local<v8::Context> context, v8::Local<v8::Value> value, int maxDepth)
+PassOwnPtr<protocol::Value> toProtocolValue(v8::Local<v8::Context> context, v8::Local<v8::Value> value, int maxDepth)
{
if (value.IsEmpty()) {
ASSERT_NOT_REACHED();
@@ -36,21 +36,21 @@ PassRefPtr<protocol::Value> toProtocolValue(v8::Local<v8::Context> context, v8::
return protocol::StringValue::create(coreString(value.As<v8::String>()));
if (value->IsArray()) {
v8::Local<v8::Array> array = value.As<v8::Array>();
- RefPtr<protocol::ListValue> inspectorArray = protocol::ListValue::create();
+ OwnPtr<protocol::ListValue> inspectorArray = protocol::ListValue::create();
uint32_t length = array->Length();
for (uint32_t i = 0; i < length; i++) {
v8::Local<v8::Value> value;
if (!array->Get(context, i).ToLocal(&value))
return nullptr;
- RefPtr<protocol::Value> element = toProtocolValue(context, value, maxDepth);
+ OwnPtr<protocol::Value> element = toProtocolValue(context, value, maxDepth);
if (!element)
return nullptr;
- inspectorArray->pushValue(element);
+ inspectorArray->pushValue(element.release());
}
- return inspectorArray;
+ return inspectorArray.release();
}
if (value->IsObject()) {
- RefPtr<protocol::DictionaryValue> jsonObject = protocol::DictionaryValue::create();
+ OwnPtr<protocol::DictionaryValue> jsonObject = protocol::DictionaryValue::create();
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
v8::Local<v8::Array> propertyNames;
if (!object->GetPropertyNames(context).ToLocal(&propertyNames))
@@ -72,12 +72,12 @@ PassRefPtr<protocol::Value> toProtocolValue(v8::Local<v8::Context> context, v8::
v8::Local<v8::Value> property;
if (!object->Get(context, name).ToLocal(&property))
return nullptr;
- RefPtr<protocol::Value> propertyValue = toProtocolValue(context, property, maxDepth);
+ OwnPtr<protocol::Value> propertyValue = toProtocolValue(context, property, maxDepth);
if (!propertyValue)
return nullptr;
- jsonObject->setValue(coreString(propertyName), propertyValue);
+ jsonObject->setValue(coreString(propertyName), propertyValue.release());
}
- return jsonObject;
+ return jsonObject.release();
}
ASSERT_NOT_REACHED();
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698