| 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 (*it)->second.SetEntrySize(entry_size); | 393 (*it)->second.SetEntrySize(entry_size); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void SimpleIndex::MergeInitializingSet( | 396 void SimpleIndex::MergeInitializingSet( |
| 397 scoped_ptr<SimpleIndexLoadResult> load_result) { | 397 scoped_ptr<SimpleIndexLoadResult> load_result) { |
| 398 DCHECK(io_thread_checker_.CalledOnValidThread()); | 398 DCHECK(io_thread_checker_.CalledOnValidThread()); |
| 399 DCHECK(load_result->did_load); | 399 DCHECK(load_result->did_load); |
| 400 | 400 |
| 401 EntrySet* index_file_entries = &load_result->entries; | 401 EntrySet* index_file_entries = &load_result->entries; |
| 402 | 402 |
| 403 for (base::hash_set<uint64_t>::const_iterator it = removed_entries_.begin(); | 403 for (std::unordered_set<uint64_t>::const_iterator it = |
| 404 removed_entries_.begin(); |
| 404 it != removed_entries_.end(); ++it) { | 405 it != removed_entries_.end(); ++it) { |
| 405 index_file_entries->erase(*it); | 406 index_file_entries->erase(*it); |
| 406 } | 407 } |
| 407 removed_entries_.clear(); | 408 removed_entries_.clear(); |
| 408 | 409 |
| 409 for (EntrySet::const_iterator it = entries_set_.begin(); | 410 for (EntrySet::const_iterator it = entries_set_.begin(); |
| 410 it != entries_set_.end(); ++it) { | 411 it != entries_set_.end(); ++it) { |
| 411 const uint64_t entry_hash = it->first; | 412 const uint64_t entry_hash = it->first; |
| 412 std::pair<EntrySet::iterator, bool> insert_result = | 413 std::pair<EntrySet::iterator, bool> insert_result = |
| 413 index_file_entries->insert(EntrySet::value_type(entry_hash, | 414 index_file_entries->insert(EntrySet::value_type(entry_hash, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 start - last_write_to_disk_); | 478 start - last_write_to_disk_); |
| 478 } | 479 } |
| 479 } | 480 } |
| 480 last_write_to_disk_ = start; | 481 last_write_to_disk_ = start; |
| 481 | 482 |
| 482 index_file_->WriteToDisk(entries_set_, cache_size_, | 483 index_file_->WriteToDisk(entries_set_, cache_size_, |
| 483 start, app_on_background_, base::Closure()); | 484 start, app_on_background_, base::Closure()); |
| 484 } | 485 } |
| 485 | 486 |
| 486 } // namespace disk_cache | 487 } // namespace disk_cache |
| OLD | NEW |