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

Unified Diff: chrome/browser/importer/profile_writer.cc

Issue 2290503003: Remove use of stl_util in search_engines. (Closed)
Patch Set: fix broken test Created 4 years, 3 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/importer/profile_writer.cc
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index 0a5db61724eaf72888a9507f993a9b255f027fda..fa475fe77435307c01152efa1ccc18b6c64ff8ca 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -10,6 +10,7 @@
#include <set>
#include <string>
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -326,7 +327,7 @@ void ProfileWriter::AddKeywords(ScopedVector<TemplateURL> template_urls,
i != template_urls.end(); ++i) {
// TemplateURLService requires keywords to be unique. If there is already a
// TemplateURL with this keyword, don't import it again.
- if (model->GetTemplateURLForKeyword((*i)->keyword()) != NULL)
+ if (model->GetTemplateURLForKeyword((*i)->keyword()) != nullptr)
continue;
// For search engines if there is already a keyword with the same
@@ -341,8 +342,8 @@ void ProfileWriter::AddKeywords(ScopedVector<TemplateURL> template_urls,
// Only add valid TemplateURLs to the model.
if ((*i)->url_ref().IsValid(model->search_terms_data())) {
- model->Add(*i); // Takes ownership.
- *i = NULL; // Prevent the vector from deleting *i later.
+ model->Add(base::WrapUnique(*i));
+ *i = nullptr; // Prevent the vector from deleting *i later.
}
}
}

Powered by Google App Engine
This is Rietveld 408576698