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)); |