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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/CodeGenerator.py

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/inspector_protocol/CodeGenerator.py
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/CodeGenerator.py b/third_party/WebKit/Source/platform/inspector_protocol/CodeGenerator.py
index 8b14eef4be207cc5b4a7f208efab076285b71850..57bd6cea47911adae46fbe1d9a00ff449bff0395 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/CodeGenerator.py
+++ b/third_party/WebKit/Source/platform/inspector_protocol/CodeGenerator.py
@@ -111,12 +111,12 @@ def patch_full_qualified_refs():
def create_user_type_definition(domain_name, type):
return {
- "return_type": "PassOwnPtr<protocol::%s::%s>" % (domain_name, type["id"]),
- "pass_type": "PassOwnPtr<protocol::%s::%s>" % (domain_name, type["id"]),
+ "return_type": "std::unique_ptr<protocol::%s::%s>" % (domain_name, type["id"]),
+ "pass_type": "std::unique_ptr<protocol::%s::%s>" % (domain_name, type["id"]),
"to_raw_type": "%s.get()",
"to_pass_type": "std::move(%s)",
"to_rvalue": "std::move(%s)",
- "type": "OwnPtr<protocol::%s::%s>" % (domain_name, type["id"]),
+ "type": "std::unique_ptr<protocol::%s::%s>" % (domain_name, type["id"]),
"raw_type": "protocol::%s::%s" % (domain_name, type["id"]),
"raw_pass_type": "protocol::%s::%s*" % (domain_name, type["id"]),
"raw_return_type": "protocol::%s::%s*" % (domain_name, type["id"]),
@@ -125,12 +125,12 @@ def create_user_type_definition(domain_name, type):
def create_object_type_definition():
return {
- "return_type": "PassOwnPtr<protocol::DictionaryValue>",
- "pass_type": "PassOwnPtr<protocol::DictionaryValue>",
+ "return_type": "std::unique_ptr<protocol::DictionaryValue>",
+ "pass_type": "std::unique_ptr<protocol::DictionaryValue>",
"to_raw_type": "%s.get()",
"to_pass_type": "std::move(%s)",
"to_rvalue": "std::move(%s)",
- "type": "OwnPtr<protocol::DictionaryValue>",
+ "type": "std::unique_ptr<protocol::DictionaryValue>",
"raw_type": "protocol::DictionaryValue",
"raw_pass_type": "protocol::DictionaryValue*",
"raw_return_type": "protocol::DictionaryValue*",
@@ -139,12 +139,12 @@ def create_object_type_definition():
def create_any_type_definition():
return {
- "return_type": "PassOwnPtr<protocol::Value>",
- "pass_type": "PassOwnPtr<protocol::Value>",
+ "return_type": "std::unique_ptr<protocol::Value>",
+ "pass_type": "std::unique_ptr<protocol::Value>",
"to_raw_type": "%s.get()",
"to_pass_type": "std::move(%s)",
"to_rvalue": "std::move(%s)",
- "type": "OwnPtr<protocol::Value>",
+ "type": "std::unique_ptr<protocol::Value>",
"raw_type": "protocol::Value",
"raw_pass_type": "protocol::Value*",
"raw_return_type": "protocol::Value*",
@@ -209,16 +209,16 @@ type_definitions["any"] = create_any_type_definition()
def wrap_array_definition(type):
return {
- "return_type": "PassOwnPtr<protocol::Array<%s>>" % type["raw_type"],
- "pass_type": "PassOwnPtr<protocol::Array<%s>>" % type["raw_type"],
+ "return_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"],
+ "pass_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"],
"to_raw_type": "%s.get()",
"to_pass_type": "std::move(%s)",
"to_rvalue": "std::move(%s)",
- "type": "OwnPtr<protocol::Array<%s>>" % type["raw_type"],
+ "type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"],
"raw_type": "protocol::Array<%s>" % type["raw_type"],
"raw_pass_type": "protocol::Array<%s>*" % type["raw_type"],
"raw_return_type": "protocol::Array<%s>*" % type["raw_type"],
- "create_type": "adoptPtr(new protocol::Array<%s>())" % type["raw_type"],
+ "create_type": "wrapUnique(new protocol::Array<%s>())" % type["raw_type"],
"out_type": "protocol::Array<%s>&" % type["raw_type"],
}

Powered by Google App Engine
This is Rietveld 408576698