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

Unified Diff: chrome/browser/extensions/api/debugger/debugger_api.cc

Issue 2323993004: Remove use of deprecated base::ListValue::Append(Value*) overload in extensions. (Closed)
Patch Set: Less explosions Created 4 years, 3 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: chrome/browser/extensions/api/debugger/debugger_api.cc
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index a64ff5b36bbae2716df31b287e059517c8e3df3d..079e9625f90f0233d3cbbbba92fce32706caa7e4 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -677,8 +677,10 @@ const char kTargetTabIdField[] = "tabId";
const char kTargetExtensionIdField[] = "extensionId";
const char kTargetTypeWorker[] = "worker";
-base::Value* SerializeTarget(scoped_refptr<DevToolsAgentHost> host) {
- base::DictionaryValue* dictionary = new base::DictionaryValue();
+std::unique_ptr<base::Value> SerializeTarget(
+ scoped_refptr<DevToolsAgentHost> host) {
+ std::unique_ptr<base::DictionaryValue> dictionary(
+ new base::DictionaryValue());
dictionary->SetString(kTargetIdField, host->GetId());
dictionary->SetString(kTargetTitleField, host->GetTitle());
dictionary->SetBoolean(kTargetAttachedField, host->IsAttached());
@@ -704,7 +706,7 @@ base::Value* SerializeTarget(scoped_refptr<DevToolsAgentHost> host) {
if (favicon_url.is_valid())
dictionary->SetString(kTargetFaviconUrlField, favicon_url.spec());
- return dictionary;
+ return std::move(dictionary);
Devlin 2016/09/12 19:12:34 isn't this a pessimising move?
dcheng 2016/09/12 20:26:45 std::move() is required when the return type is di
Devlin 2016/09/14 14:56:52 Ah, interesting. I was wondering why there wasn't
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698