OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |