Chromium Code Reviews| Index: chrome/browser/importer/profile_writer.cc |
| diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc |
| index 642bbf31567c2c7bcaf189d08041fd459c3a7396..9ce42533d3cc453d0af1b86da1d6821f2f5b88a7 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/strings/string_number_conversions.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/strings/utf_string_conversions.h" |
| @@ -318,7 +319,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 |
| @@ -333,8 +334,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)); // Takes ownership. |
|
Peter Kasting
2016/08/31 04:12:55
Nit: Comment is now redundant.
Avi (use Gerrit)
2016/09/01 00:34:25
Done.
|
| + *i = nullptr; // Prevent the vector from deleting *i later. |
| } |
| } |
| } |