OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 friend class base::RefCounted<ChildrenDeleter>; | 64 friend class base::RefCounted<ChildrenDeleter>; |
65 ~ChildrenDeleter() {} | 65 ~ChildrenDeleter() {} |
66 | 66 |
67 void DeleteChildren(); | 67 void DeleteChildren(); |
68 | 68 |
69 disk_cache::BackendImpl* backend_; | 69 disk_cache::BackendImpl* backend_; |
70 std::string name_; | 70 std::string name_; |
71 disk_cache::Bitmap children_map_; | 71 disk_cache::Bitmap children_map_; |
72 int64 signature_; | 72 int64 signature_; |
73 scoped_array<char> buffer_; | 73 scoped_array<char> buffer_; |
74 DISALLOW_EVIL_CONSTRUCTORS(ChildrenDeleter); | 74 DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter); |
75 }; | 75 }; |
76 | 76 |
77 // This is the callback of the file operation. | 77 // This is the callback of the file operation. |
78 void ChildrenDeleter::OnFileIOComplete(int bytes_copied) { | 78 void ChildrenDeleter::OnFileIOComplete(int bytes_copied) { |
79 char* buffer = buffer_.release(); | 79 char* buffer = buffer_.release(); |
80 Start(buffer, bytes_copied); | 80 Start(buffer, bytes_copied); |
81 } | 81 } |
82 | 82 |
83 void ChildrenDeleter::Start(char* buffer, int len) { | 83 void ChildrenDeleter::Start(char* buffer, int len) { |
84 buffer_.reset(buffer); | 84 buffer_.reset(buffer); |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 net::CompletionCallback* c = abort_callbacks_[i]; | 735 net::CompletionCallback* c = abort_callbacks_[i]; |
736 if (i == abort_callbacks_.size() - 1) | 736 if (i == abort_callbacks_.size() - 1) |
737 abort_callbacks_.clear(); | 737 abort_callbacks_.clear(); |
738 | 738 |
739 entry_->Release(); // Don't touch object after this line. | 739 entry_->Release(); // Don't touch object after this line. |
740 c->Run(net::OK); | 740 c->Run(net::OK); |
741 } | 741 } |
742 } | 742 } |
743 | 743 |
744 } // namespace disk_cache | 744 } // namespace disk_cache |
OLD | NEW |