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

Side by Side Diff: chrome/browser/download/download_path_reservation_tracker.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/download/download_path_reservation_tracker.h" 5 #include "chrome/browser/download/download_path_reservation_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // call. Neither should happen. 282 // call. Neither should happen.
283 NOTREACHED(); 283 NOTREACHED();
284 } 284 }
285 } 285 }
286 286
287 // Called on the FILE thread to remove the path reservation associated with 287 // Called on the FILE thread to remove the path reservation associated with
288 // |key|. 288 // |key|.
289 void RevokeReservation(ReservationKey key) { 289 void RevokeReservation(ReservationKey key) {
290 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 290 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
291 DCHECK(g_reservation_map != NULL); 291 DCHECK(g_reservation_map != NULL);
292 DCHECK(ContainsKey(*g_reservation_map, key)); 292 DCHECK(base::ContainsKey(*g_reservation_map, key));
293 g_reservation_map->erase(key); 293 g_reservation_map->erase(key);
294 if (g_reservation_map->size() == 0) { 294 if (g_reservation_map->size() == 0) {
295 // No more reservations. Delete map. 295 // No more reservations. Delete map.
296 delete g_reservation_map; 296 delete g_reservation_map;
297 g_reservation_map = NULL; 297 g_reservation_map = NULL;
298 } 298 }
299 } 299 }
300 300
301 void RunGetReservedPathCallback( 301 void RunGetReservedPathCallback(
302 const DownloadPathReservationTracker::ReservedPathCallback& callback, 302 const DownloadPathReservationTracker::ReservedPathCallback& callback,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 base::Bind(&RunGetReservedPathCallback, 398 base::Bind(&RunGetReservedPathCallback,
399 callback, 399 callback,
400 base::Owned(reserved_path))); 400 base::Owned(reserved_path)));
401 } 401 }
402 402
403 // static 403 // static
404 bool DownloadPathReservationTracker::IsPathInUseForTesting( 404 bool DownloadPathReservationTracker::IsPathInUseForTesting(
405 const base::FilePath& path) { 405 const base::FilePath& path) {
406 return IsPathInUse(path); 406 return IsPathInUse(path);
407 } 407 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_history_unittest.cc ('k') | chrome/browser/download/download_query_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698