| Index: third_party/WebKit/Source/platform/inspector_protocol/Array.h
|
| diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Array.h b/third_party/WebKit/Source/platform/inspector_protocol/Array.h
|
| index efc9f75eef2db8d4c8484f182e50027380657ea0..cc2d3b23e972a7848fc09e9eab484b273bc8ced0 100644
|
| --- a/third_party/WebKit/Source/platform/inspector_protocol/Array.h
|
| +++ b/third_party/WebKit/Source/platform/inspector_protocol/Array.h
|
| @@ -18,12 +18,12 @@ namespace protocol {
|
| template<typename T>
|
| class ArrayBase {
|
| public:
|
| - static PassOwnPtr<Array<T>> create()
|
| + static std::unique_ptr<Array<T>> create()
|
| {
|
| - return adoptPtr(new Array<T>());
|
| + return wrapUnique(new Array<T>());
|
| }
|
|
|
| - static PassOwnPtr<Array<T>> parse(protocol::Value* value, ErrorSupport* errors)
|
| + static std::unique_ptr<Array<T>> parse(protocol::Value* value, ErrorSupport* errors)
|
| {
|
| protocol::ListValue* array = ListValue::cast(value);
|
| if (!array) {
|
| @@ -31,7 +31,7 @@ public:
|
| return nullptr;
|
| }
|
| errors->push();
|
| - OwnPtr<Array<T>> result = adoptPtr(new Array<T>());
|
| + std::unique_ptr<Array<T>> result(new Array<T>());
|
| for (size_t i = 0; i < array->size(); ++i) {
|
| errors->setName(String16::number(i));
|
| T item = FromValue<T>::parse(array->at(i), errors);
|
| @@ -58,9 +58,9 @@ public:
|
| return m_vector[index];
|
| }
|
|
|
| - PassOwnPtr<protocol::ListValue> serialize()
|
| + std::unique_ptr<protocol::ListValue> serialize()
|
| {
|
| - OwnPtr<protocol::ListValue> result = ListValue::create();
|
| + std::unique_ptr<protocol::ListValue> result = ListValue::create();
|
| for (auto& item : m_vector)
|
| result->pushValue(toValue(item));
|
| return result;
|
| @@ -79,23 +79,23 @@ template<> class Array<bool> : public ArrayBase<bool> {};
|
| template<typename T>
|
| class Array {
|
| public:
|
| - static PassOwnPtr<Array<T>> create()
|
| + static std::unique_ptr<Array<T>> create()
|
| {
|
| - return adoptPtr(new Array<T>());
|
| + return wrapUnique(new Array<T>());
|
| }
|
|
|
| - static PassOwnPtr<Array<T>> parse(protocol::Value* value, ErrorSupport* errors)
|
| + static std::unique_ptr<Array<T>> parse(protocol::Value* value, ErrorSupport* errors)
|
| {
|
| protocol::ListValue* array = ListValue::cast(value);
|
| if (!array) {
|
| errors->addError("array expected");
|
| return nullptr;
|
| }
|
| - OwnPtr<Array<T>> result = adoptPtr(new Array<T>());
|
| + std::unique_ptr<Array<T>> result(new Array<T>());
|
| errors->push();
|
| for (size_t i = 0; i < array->size(); ++i) {
|
| errors->setName(String16::number(i));
|
| - OwnPtr<T> item = FromValue<T>::parse(array->at(i), errors);
|
| + std::unique_ptr<T> item = FromValue<T>::parse(array->at(i), errors);
|
| result->m_vector.append(std::move(item));
|
| }
|
| errors->pop();
|
| @@ -104,7 +104,7 @@ public:
|
| return result;
|
| }
|
|
|
| - void addItem(PassOwnPtr<T> value)
|
| + void addItem(std::unique_ptr<T> value)
|
| {
|
| m_vector.append(std::move(value));
|
| }
|
| @@ -119,16 +119,16 @@ public:
|
| return m_vector[index];
|
| }
|
|
|
| - PassOwnPtr<protocol::ListValue> serialize()
|
| + std::unique_ptr<protocol::ListValue> serialize()
|
| {
|
| - OwnPtr<protocol::ListValue> result = ListValue::create();
|
| + std::unique_ptr<protocol::ListValue> result = ListValue::create();
|
| for (auto& item : m_vector)
|
| result->pushValue(toValue(item.get()));
|
| return result;
|
| }
|
|
|
| private:
|
| - protocol::Vector<OwnPtr<T>> m_vector;
|
| + protocol::Vector<std::unique_ptr<T>> m_vector;
|
| };
|
|
|
| } // namespace platform
|
|
|