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

Side by Side Diff: net/disk_cache/sparse_control.cc

Issue 11649028: Add an IO thread index bitmap to disk cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediate Created 7 years, 10 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 | Annotate | Revision Log
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 "net/disk_cache/sparse_control.h" 5 #include "net/disk_cache/sparse_control.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 // We were not able to open this child; see what we can do. 524 // We were not able to open this child; see what we can do.
525 bool SparseControl::ContinueWithoutChild(const std::string& key) { 525 bool SparseControl::ContinueWithoutChild(const std::string& key) {
526 if (kReadOperation == operation_) 526 if (kReadOperation == operation_)
527 return false; 527 return false;
528 if (kGetRangeOperation == operation_) 528 if (kGetRangeOperation == operation_)
529 return true; 529 return true;
530 530
531 if (!entry_->backend_) 531 if (!entry_->backend_)
532 return false; 532 return false;
533 533
534 // This CreateEntry doesn't need to modify the index bitmap, because child
535 // entries are only ever created from the cache thread for use on the cache
536 // thread.
534 child_ = entry_->backend_->CreateEntryImpl(key); 537 child_ = entry_->backend_->CreateEntryImpl(key);
535 if (!child_) { 538 if (!child_) {
536 child_ = NULL; 539 child_ = NULL;
537 result_ = net::ERR_CACHE_READ_FAILURE; 540 result_ = net::ERR_CACHE_READ_FAILURE;
538 return false; 541 return false;
539 } 542 }
540 // Write signature. 543 // Write signature.
541 InitChildData(); 544 InitChildData();
542 return true; 545 return true;
543 } 546 }
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 CompletionCallback cb = abort_callbacks_[i]; 878 CompletionCallback cb = abort_callbacks_[i];
876 if (i == abort_callbacks_.size() - 1) 879 if (i == abort_callbacks_.size() - 1)
877 abort_callbacks_.clear(); 880 abort_callbacks_.clear();
878 881
879 entry_->Release(); // Don't touch object after this line. 882 entry_->Release(); // Don't touch object after this line.
880 cb.Run(net::OK); 883 cb.Run(net::OK);
881 } 884 }
882 } 885 }
883 886
884 } // namespace disk_cache 887 } // namespace disk_cache
OLDNEW
« net/disk_cache/entry_unittest.cc ('K') | « net/disk_cache/entry_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698