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 |