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

Side by Side Diff: chrome/browser/extensions/blacklist.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "chrome/browser/extensions/blacklist.h" 5 #include "chrome/browser/extensions/blacklist.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // Go through the opened requests and call the callbacks for those requests 297 // Go through the opened requests and call the callbacks for those requests
298 // for which we already got all the required blacklist states. 298 // for which we already got all the required blacklist states.
299 StateRequestsList::iterator requests_it = state_requests_.begin(); 299 StateRequestsList::iterator requests_it = state_requests_.begin();
300 while (requests_it != state_requests_.end()) { 300 while (requests_it != state_requests_.end()) {
301 const std::vector<std::string>& ids = requests_it->first; 301 const std::vector<std::string>& ids = requests_it->first;
302 302
303 bool have_all_in_cache = true; 303 bool have_all_in_cache = true;
304 for (std::vector<std::string>::const_iterator ids_it = ids.begin(); 304 for (std::vector<std::string>::const_iterator ids_it = ids.begin();
305 ids_it != ids.end(); 305 ids_it != ids.end();
306 ++ids_it) { 306 ++ids_it) {
307 if (!ContainsKey(blacklist_state_cache_, *ids_it)) { 307 if (!base::ContainsKey(blacklist_state_cache_, *ids_it)) {
308 have_all_in_cache = false; 308 have_all_in_cache = false;
309 break; 309 break;
310 } 310 }
311 } 311 }
312 312
313 if (have_all_in_cache) { 313 if (have_all_in_cache) {
314 requests_it->second.Run(); 314 requests_it->second.Run();
315 requests_it = state_requests_.erase(requests_it); // returns next element 315 requests_it = state_requests_.erase(requests_it); // returns next element
316 } else { 316 } else {
317 ++requests_it; 317 ++requests_it;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 351
352 void Blacklist::Observe(int type, 352 void Blacklist::Observe(int type,
353 const content::NotificationSource& source, 353 const content::NotificationSource& source,
354 const content::NotificationDetails& details) { 354 const content::NotificationDetails& details) {
355 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); 355 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type);
356 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); 356 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated());
357 } 357 }
358 358
359 } // namespace extensions 359 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api_unittest.cc ('k') | chrome/browser/extensions/blacklist_state_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698