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

Unified Diff: chrome/browser/ui/search_engines/template_url_table_model.cc

Issue 2290503003: Remove use of stl_util in search_engines. (Closed)
Patch Set: ios for reals Created 4 years, 4 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/ui/search_engines/template_url_table_model.cc
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc
index e08544404a5234fcca4e41c57beb047a1bb35897..e26af00af77ff5f3088e4d14f3b73da5afc5a6b4 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.cc
+++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/i18n/rtl.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/grit/generated_resources.h"
#include "components/favicon/core/favicon_service.h"
@@ -266,8 +267,9 @@ void TemplateURLTableModel::Add(int index,
data.SetShortName(short_name);
data.SetKeyword(keyword);
data.SetURL(url);
- TemplateURL* turl = new TemplateURL(data);
- template_url_service_->Add(turl);
+ std::unique_ptr<TemplateURL> turl_ptr = base::MakeUnique<TemplateURL>(data);
+ TemplateURL* turl = turl_ptr.get();
+ template_url_service_->Add(std::move(turl_ptr));
Peter Kasting 2016/08/31 04:12:56 Nit: Just use the old code and add a WrapUnique()
Avi (use Gerrit) 2016/09/01 00:34:26 fixed
std::unique_ptr<ModelEntry> entry(new ModelEntry(this, turl));
template_url_service_->AddObserver(this);
AddEntry(index, std::move(entry));

Powered by Google App Engine
This is Rietveld 408576698