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

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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/web_navigation/web_navigation_api_helpers.cc
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
index 9065ac4e85f292ea8ba3af6b0310e53420029f4a..2c5ac916a2dc9a4638f729d10a57fda6809cea99 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.h"
+#include <memory>
#include <utility>
#include "base/json/json_writer.h"
@@ -99,7 +100,7 @@ void DispatchOnCommitted(events::HistogramValue histogram_value,
url = GURL(content::kAboutSrcDocURL);
std::unique_ptr<base::ListValue> args(new base::ListValue());
- base::DictionaryValue* dict = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetInteger(keys::kTabIdKey, ExtensionTabUtil::GetTabId(web_contents));
dict->SetString(keys::kUrlKey, url.spec());
dict->SetInteger(keys::kProcessIdKey, frame_host->GetProcess()->GetID());
@@ -130,7 +131,7 @@ void DispatchOnCommitted(events::HistogramValue histogram_value,
qualifiers->AppendString("from_address_bar");
dict->Set(keys::kTransitionQualifiersKey, qualifiers);
dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
- args->Append(dict);
+ args->Append(std::move(dict));
std::unique_ptr<Event> event(
new Event(histogram_value, event_name, std::move(args)));

Powered by Google App Engine
This is Rietveld 408576698