OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 : backend_(backend), name_(name) {} | 53 : backend_(backend), name_(name) {} |
54 | 54 |
55 virtual void OnFileIOComplete(int bytes_copied); | 55 virtual void OnFileIOComplete(int bytes_copied); |
56 | 56 |
57 // Two ways of deleting the children: if we have the children map, use Start() | 57 // Two ways of deleting the children: if we have the children map, use Start() |
58 // directly, otherwise pass the data address to ReadData(). | 58 // directly, otherwise pass the data address to ReadData(). |
59 void Start(char* buffer, int len); | 59 void Start(char* buffer, int len); |
60 void ReadData(disk_cache::Addr address, int len); | 60 void ReadData(disk_cache::Addr address, int len); |
61 | 61 |
62 private: | 62 private: |
| 63 friend class base::RefCounted<ChildrenDeleter>; |
| 64 ~ChildrenDeleter() {} |
| 65 |
63 void DeleteChildren(); | 66 void DeleteChildren(); |
64 | 67 |
65 disk_cache::BackendImpl* backend_; | 68 disk_cache::BackendImpl* backend_; |
66 std::string name_; | 69 std::string name_; |
67 disk_cache::Bitmap children_map_; | 70 disk_cache::Bitmap children_map_; |
68 int64 signature_; | 71 int64 signature_; |
69 scoped_array<char> buffer_; | 72 scoped_array<char> buffer_; |
70 DISALLOW_EVIL_CONSTRUCTORS(ChildrenDeleter); | 73 DISALLOW_EVIL_CONSTRUCTORS(ChildrenDeleter); |
71 }; | 74 }; |
72 | 75 |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 net::CompletionCallback* c = abort_callbacks_[i]; | 734 net::CompletionCallback* c = abort_callbacks_[i]; |
732 if (i == abort_callbacks_.size() - 1) | 735 if (i == abort_callbacks_.size() - 1) |
733 abort_callbacks_.clear(); | 736 abort_callbacks_.clear(); |
734 | 737 |
735 entry_->Release(); // Don't touch object after this line. | 738 entry_->Release(); // Don't touch object after this line. |
736 c->Run(net::OK); | 739 c->Run(net::OK); |
737 } | 740 } |
738 } | 741 } |
739 | 742 |
740 } // namespace disk_cache | 743 } // namespace disk_cache |
OLD | NEW |