| Index: third_party/WebKit/Source/bindings/core/v8/JSONValuesForV8.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/JSONValuesForV8.cpp b/third_party/WebKit/Source/bindings/core/v8/JSONValuesForV8.cpp
|
| index 9dbf7f57d091a57739a12ce9e64c5061e73216ad..48157b92c3c60db0a5023add5b5f54cfc69ce07c 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/JSONValuesForV8.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/JSONValuesForV8.cpp
|
| @@ -19,7 +19,7 @@ static String coreString(v8::Local<v8::String> v8String)
|
| return result;
|
| }
|
|
|
| -PassRefPtr<JSONValue> toJSONValue(v8::Local<v8::Context> context, v8::Local<v8::Value> value, int maxDepth)
|
| +std::unique_ptr<JSONValue> toJSONValue(v8::Local<v8::Context> context, v8::Local<v8::Value> value, int maxDepth)
|
| {
|
| if (value.IsEmpty()) {
|
| ASSERT_NOT_REACHED();
|
| @@ -40,21 +40,21 @@ PassRefPtr<JSONValue> toJSONValue(v8::Local<v8::Context> context, v8::Local<v8::
|
| return JSONString::create(coreString(value.As<v8::String>()));
|
| if (value->IsArray()) {
|
| v8::Local<v8::Array> array = value.As<v8::Array>();
|
| - RefPtr<JSONArray> inspectorArray = JSONArray::create();
|
| + std::unique_ptr<JSONArray> inspectorArray = JSONArray::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<JSONValue> element = toJSONValue(context, value, maxDepth);
|
| + std::unique_ptr<JSONValue> element = toJSONValue(context, value, maxDepth);
|
| if (!element)
|
| return nullptr;
|
| - inspectorArray->pushValue(element);
|
| + inspectorArray->pushValue(std::move(element));
|
| }
|
| - return inspectorArray;
|
| + return std::move(inspectorArray);
|
| }
|
| if (value->IsObject()) {
|
| - RefPtr<JSONObject> jsonObject = JSONObject::create();
|
| + std::unique_ptr<JSONObject> jsonObject = JSONObject::create();
|
| v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
|
| v8::Local<v8::Array> propertyNames;
|
| if (!object->GetPropertyNames(context).ToLocal(&propertyNames))
|
| @@ -76,12 +76,12 @@ PassRefPtr<JSONValue> toJSONValue(v8::Local<v8::Context> context, v8::Local<v8::
|
| v8::Local<v8::Value> property;
|
| if (!object->Get(context, name).ToLocal(&property))
|
| return nullptr;
|
| - RefPtr<JSONValue> propertyValue = toJSONValue(context, property, maxDepth);
|
| + std::unique_ptr<JSONValue> propertyValue = toJSONValue(context, property, maxDepth);
|
| if (!propertyValue)
|
| return nullptr;
|
| - jsonObject->setValue(coreString(propertyName), propertyValue);
|
| + jsonObject->setValue(coreString(propertyName), std::move(propertyValue));
|
| }
|
| - return jsonObject;
|
| + return std::move(jsonObject);
|
| }
|
| ASSERT_NOT_REACHED();
|
| return nullptr;
|
|
|