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

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

Issue 2811673002: Reland: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Workaround with std::move Created 3 years, 8 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 ac74ce13664972421c5f89ae5e23cf827a96b023..e80814a4ae6fdb9d0f007f712bc6b0176ed5d010 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
@@ -10,6 +10,7 @@
#include <utility>
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -124,7 +125,7 @@ void DispatchOnCommitted(events::HistogramValue histogram_value,
ui::PAGE_TRANSITION_AUTO_TOPLEVEL))
transition_type_string = "start_page";
dict->SetString(keys::kTransitionTypeKey, transition_type_string);
- base::ListValue* qualifiers = new base::ListValue();
+ auto qualifiers = base::MakeUnique<base::ListValue>();
if (transition_type & ui::PAGE_TRANSITION_CLIENT_REDIRECT)
qualifiers->AppendString("client_redirect");
if (transition_type & ui::PAGE_TRANSITION_SERVER_REDIRECT)
@@ -133,7 +134,7 @@ void DispatchOnCommitted(events::HistogramValue histogram_value,
qualifiers->AppendString("forward_back");
if (transition_type & ui::PAGE_TRANSITION_FROM_ADDRESS_BAR)
qualifiers->AppendString("from_address_bar");
- dict->Set(keys::kTransitionQualifiersKey, qualifiers);
+ dict->Set(keys::kTransitionQualifiersKey, std::move(qualifiers));
dict->SetDouble(keys::kTimeStampKey, MilliSecondsFromTime(base::Time::Now()));
args->Append(std::move(dict));
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_event_router.cc ('k') | chrome/browser/extensions/convert_user_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698