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

Side by Side Diff: net/disk_cache/simple/simple_index.cc

Issue 1884453002: Revert of Convert //net and //chromecast to std::unordered_* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « net/disk_cache/simple/simple_index.h ('k') | net/disk_cache/simple/simple_index_file.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 (*it)->second.SetEntrySize(entry_size); 394 (*it)->second.SetEntrySize(entry_size);
395 } 395 }
396 396
397 void SimpleIndex::MergeInitializingSet( 397 void SimpleIndex::MergeInitializingSet(
398 scoped_ptr<SimpleIndexLoadResult> load_result) { 398 scoped_ptr<SimpleIndexLoadResult> load_result) {
399 DCHECK(io_thread_checker_.CalledOnValidThread()); 399 DCHECK(io_thread_checker_.CalledOnValidThread());
400 DCHECK(load_result->did_load); 400 DCHECK(load_result->did_load);
401 401
402 EntrySet* index_file_entries = &load_result->entries; 402 EntrySet* index_file_entries = &load_result->entries;
403 403
404 for (std::unordered_set<uint64_t>::const_iterator it = 404 for (base::hash_set<uint64_t>::const_iterator it = removed_entries_.begin();
405 removed_entries_.begin();
406 it != removed_entries_.end(); ++it) { 405 it != removed_entries_.end(); ++it) {
407 index_file_entries->erase(*it); 406 index_file_entries->erase(*it);
408 } 407 }
409 removed_entries_.clear(); 408 removed_entries_.clear();
410 409
411 for (EntrySet::const_iterator it = entries_set_.begin(); 410 for (EntrySet::const_iterator it = entries_set_.begin();
412 it != entries_set_.end(); ++it) { 411 it != entries_set_.end(); ++it) {
413 const uint64_t entry_hash = it->first; 412 const uint64_t entry_hash = it->first;
414 std::pair<EntrySet::iterator, bool> insert_result = 413 std::pair<EntrySet::iterator, bool> insert_result =
415 index_file_entries->insert(EntrySet::value_type(entry_hash, 414 index_file_entries->insert(EntrySet::value_type(entry_hash,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 start - last_write_to_disk_); 479 start - last_write_to_disk_);
481 } 480 }
482 } 481 }
483 last_write_to_disk_ = start; 482 last_write_to_disk_ = start;
484 483
485 index_file_->WriteToDisk(entries_set_, cache_size_, 484 index_file_->WriteToDisk(entries_set_, cache_size_,
486 start, app_on_background_, base::Closure()); 485 start, app_on_background_, base::Closure());
487 } 486 }
488 487
489 } // namespace disk_cache 488 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_index.h ('k') | net/disk_cache/simple/simple_index_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698