chrome/browser/download/download_path_reservation_tracker.cc
// Returns true if the given path is in use by a path reservation.
Returns true if the given path is in use by a path reservation.
Returns true if the given path is in use by a path reservation .
bool IsPathReserved(const FilePath& path) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
  if (g_reservation_map == NULL)
    return false;
  for (ReservationMap::const_iterator iter = g_reservation_map->begin();
       iter != g_reservation_map->end(); ++iter) {
    if (iter->second == path)
      return true;
  }
  return false;
}
bool IsPathReserved ( const FilePath & path ) { DCHECK ( BrowserThread :: CurrentlyOn ( BrowserThread :: FILE ) ) ; if ( g_reservation_map == NULL ) return false ; for ( ReservationMap :: const_iterator iter = g_reservation_map -> begin ( ) ; iter != g_reservation_map -> end ( ) ; ++ iter ) { if ( iter -> second == path ) return true ; } return false ; }
Returns true if the given path is in use by a path reservation.
Returns true if the given path is in use by a path reservation .
// No reservation map => no reservations. // Unfortunately path normalization doesn't work reliably for non-existant // files. So given a FilePath, we can't derive a normalized key that we can // use for lookups. We only expect a small number of concurrent downloads at // any given time, so going through all of them shouldn't be too slow.