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

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

Issue 2004313003: DevTools: migrate from OwnPtr to std::unique_ptr for inspector protocol classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 4 years, 7 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/RemoteObjectId.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/RemoteObjectId.cpp b/third_party/WebKit/Source/platform/v8_inspector/RemoteObjectId.cpp
index 50f430fe4a254dbd34c98be618e57c086dc8fcb5..1f0332b44fb1a0dd842a14d410e568d94de8dfdd 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/RemoteObjectId.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/RemoteObjectId.cpp
@@ -6,19 +6,19 @@
#include "platform/inspector_protocol/Parser.h"
#include "platform/inspector_protocol/Values.h"
-#include "wtf/PassOwnPtr.h"
+#include "wtf/PtrUtil.h"
namespace blink {
RemoteObjectIdBase::RemoteObjectIdBase() : m_injectedScriptId(0) { }
-PassOwnPtr<protocol::DictionaryValue> RemoteObjectIdBase::parseInjectedScriptId(const String16& objectId)
+std::unique_ptr<protocol::DictionaryValue> RemoteObjectIdBase::parseInjectedScriptId(const String16& objectId)
{
- OwnPtr<protocol::Value> parsedValue = protocol::parseJSON(objectId);
+ std::unique_ptr<protocol::Value> parsedValue = protocol::parseJSON(objectId);
if (!parsedValue || parsedValue->type() != protocol::Value::TypeObject)
return nullptr;
- OwnPtr<protocol::DictionaryValue> parsedObjectId = adoptPtr(protocol::DictionaryValue::cast(parsedValue.leakPtr()));
+ std::unique_ptr<protocol::DictionaryValue> parsedObjectId(protocol::DictionaryValue::cast(parsedValue.release()));
bool success = parsedObjectId->getNumber("injectedScriptId", &m_injectedScriptId);
if (success)
return parsedObjectId;
@@ -27,10 +27,10 @@ PassOwnPtr<protocol::DictionaryValue> RemoteObjectIdBase::parseInjectedScriptId(
RemoteObjectId::RemoteObjectId() : RemoteObjectIdBase(), m_id(0) { }
-PassOwnPtr<RemoteObjectId> RemoteObjectId::parse(ErrorString* errorString, const String16& objectId)
+std::unique_ptr<RemoteObjectId> RemoteObjectId::parse(ErrorString* errorString, const String16& objectId)
{
- OwnPtr<RemoteObjectId> result = adoptPtr(new RemoteObjectId());
- OwnPtr<protocol::DictionaryValue> parsedObjectId = result->parseInjectedScriptId(objectId);
+ std::unique_ptr<RemoteObjectId> result(new RemoteObjectId());
+ std::unique_ptr<protocol::DictionaryValue> parsedObjectId = result->parseInjectedScriptId(objectId);
if (!parsedObjectId) {
*errorString = "Invalid remote object id";
return nullptr;
@@ -46,10 +46,10 @@ PassOwnPtr<RemoteObjectId> RemoteObjectId::parse(ErrorString* errorString, const
RemoteCallFrameId::RemoteCallFrameId() : RemoteObjectIdBase(), m_frameOrdinal(0) { }
-PassOwnPtr<RemoteCallFrameId> RemoteCallFrameId::parse(ErrorString* errorString, const String16& objectId)
+std::unique_ptr<RemoteCallFrameId> RemoteCallFrameId::parse(ErrorString* errorString, const String16& objectId)
{
- OwnPtr<RemoteCallFrameId> result = adoptPtr(new RemoteCallFrameId());
- OwnPtr<protocol::DictionaryValue> parsedObjectId = result->parseInjectedScriptId(objectId);
+ std::unique_ptr<RemoteCallFrameId> result(new RemoteCallFrameId());
+ std::unique_ptr<protocol::DictionaryValue> parsedObjectId = result->parseInjectedScriptId(objectId);
if (!parsedObjectId) {
*errorString = "Invalid call frame id";
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698