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

Side by Side Diff: components/search_engines/util.cc

Issue 1440593004: Make operators on scoped_ptr match the ones defined for std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrequals: followupfix-after-rebase Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/search_engines/util.h" 5 #include "components/search_engines/util.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 DCHECK(prepopulated_urls); 195 DCHECK(prepopulated_urls);
196 DCHECK(template_urls); 196 DCHECK(template_urls);
197 197
198 ActionsFromPrepopulateData actions(CreateActionsFromCurrentPrepopulateData( 198 ActionsFromPrepopulateData actions(CreateActionsFromCurrentPrepopulateData(
199 prepopulated_urls, *template_urls, default_search_provider)); 199 prepopulated_urls, *template_urls, default_search_provider));
200 200
201 // Remove items. 201 // Remove items.
202 for (std::vector<TemplateURL*>::iterator i = actions.removed_engines.begin(); 202 for (std::vector<TemplateURL*>::iterator i = actions.removed_engines.begin();
203 i < actions.removed_engines.end(); ++i) { 203 i < actions.removed_engines.end(); ++i) {
204 scoped_ptr<TemplateURL> template_url(*i); 204 scoped_ptr<TemplateURL> template_url(*i);
205 TemplateURLService::TemplateURLVector::iterator j = 205 TemplateURLService::TemplateURLVector::iterator j = std::find(
206 std::find(template_urls->begin(), template_urls->end(), template_url); 206 template_urls->begin(), template_urls->end(), template_url.get());
207 DCHECK(j != template_urls->end()); 207 DCHECK(j != template_urls->end());
208 DCHECK(!default_search_provider || 208 DCHECK(!default_search_provider ||
209 (*j)->prepopulate_id() != default_search_provider->prepopulate_id()); 209 (*j)->prepopulate_id() != default_search_provider->prepopulate_id());
210 template_urls->erase(j); 210 template_urls->erase(j);
211 if (service) { 211 if (service) {
212 service->RemoveKeyword(template_url->id()); 212 service->RemoveKeyword(template_url->id());
213 if (removed_keyword_guids) 213 if (removed_keyword_guids)
214 removed_keyword_guids->insert(template_url->sync_guid()); 214 removed_keyword_guids->insert(template_url->sync_guid());
215 } 215 }
216 } 216 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 std::vector<std::string> deduped_encodings; 380 std::vector<std::string> deduped_encodings;
381 std::set<std::string> encoding_set; 381 std::set<std::string> encoding_set;
382 for (std::vector<std::string>::const_iterator i(encodings->begin()); 382 for (std::vector<std::string>::const_iterator i(encodings->begin());
383 i != encodings->end(); ++i) { 383 i != encodings->end(); ++i) {
384 if (encoding_set.insert(*i).second) 384 if (encoding_set.insert(*i).second)
385 deduped_encodings.push_back(*i); 385 deduped_encodings.push_back(*i);
386 } 386 }
387 encodings->swap(deduped_encodings); 387 encodings->swap(deduped_encodings);
388 return encodings->size() != deduped_encodings.size(); 388 return encodings->size() != deduped_encodings.size();
389 } 389 }
OLDNEW
« no previous file with comments | « components/invalidation/impl/ticl_invalidation_service.cc ('k') | components/sync_driver/profile_sync_auth_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698