OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "net/disk_cache/simple/simple_index.h" | 5 #include "net/disk_cache/simple/simple_index.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 (*it)->second.SetEntrySize(entry_size); | 395 (*it)->second.SetEntrySize(entry_size); |
396 } | 396 } |
397 | 397 |
398 void SimpleIndex::MergeInitializingSet( | 398 void SimpleIndex::MergeInitializingSet( |
399 std::unique_ptr<SimpleIndexLoadResult> load_result) { | 399 std::unique_ptr<SimpleIndexLoadResult> load_result) { |
400 DCHECK(io_thread_checker_.CalledOnValidThread()); | 400 DCHECK(io_thread_checker_.CalledOnValidThread()); |
401 DCHECK(load_result->did_load); | 401 DCHECK(load_result->did_load); |
402 | 402 |
403 EntrySet* index_file_entries = &load_result->entries; | 403 EntrySet* index_file_entries = &load_result->entries; |
404 | 404 |
405 for (base::hash_set<uint64_t>::const_iterator it = removed_entries_.begin(); | 405 for (std::unordered_set<uint64_t>::const_iterator it = |
| 406 removed_entries_.begin(); |
406 it != removed_entries_.end(); ++it) { | 407 it != removed_entries_.end(); ++it) { |
407 index_file_entries->erase(*it); | 408 index_file_entries->erase(*it); |
408 } | 409 } |
409 removed_entries_.clear(); | 410 removed_entries_.clear(); |
410 | 411 |
411 for (EntrySet::const_iterator it = entries_set_.begin(); | 412 for (EntrySet::const_iterator it = entries_set_.begin(); |
412 it != entries_set_.end(); ++it) { | 413 it != entries_set_.end(); ++it) { |
413 const uint64_t entry_hash = it->first; | 414 const uint64_t entry_hash = it->first; |
414 std::pair<EntrySet::iterator, bool> insert_result = | 415 std::pair<EntrySet::iterator, bool> insert_result = |
415 index_file_entries->insert(EntrySet::value_type(entry_hash, | 416 index_file_entries->insert(EntrySet::value_type(entry_hash, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 start - last_write_to_disk_); | 481 start - last_write_to_disk_); |
481 } | 482 } |
482 } | 483 } |
483 last_write_to_disk_ = start; | 484 last_write_to_disk_ = start; |
484 | 485 |
485 index_file_->WriteToDisk(entries_set_, cache_size_, | 486 index_file_->WriteToDisk(entries_set_, cache_size_, |
486 start, app_on_background_, base::Closure()); | 487 start, app_on_background_, base::Closure()); |
487 } | 488 } |
488 | 489 |
489 } // namespace disk_cache | 490 } // namespace disk_cache |
OLD | NEW |