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/blockfile/sparse_control.h" | 5 #include "net/disk_cache/blockfile/sparse_control.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 private: | 72 private: |
73 friend class base::RefCounted<ChildrenDeleter>; | 73 friend class base::RefCounted<ChildrenDeleter>; |
74 ~ChildrenDeleter() override {} | 74 ~ChildrenDeleter() override {} |
75 | 75 |
76 void DeleteChildren(); | 76 void DeleteChildren(); |
77 | 77 |
78 base::WeakPtr<disk_cache::BackendImpl> backend_; | 78 base::WeakPtr<disk_cache::BackendImpl> backend_; |
79 std::string name_; | 79 std::string name_; |
80 disk_cache::Bitmap children_map_; | 80 disk_cache::Bitmap children_map_; |
81 int64_t signature_; | 81 int64_t signature_; |
82 scoped_ptr<char[]> buffer_; | 82 std::unique_ptr<char[]> buffer_; |
83 DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter); | 83 DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter); |
84 }; | 84 }; |
85 | 85 |
86 // This is the callback of the file operation. | 86 // This is the callback of the file operation. |
87 void ChildrenDeleter::OnFileIOComplete(int bytes_copied) { | 87 void ChildrenDeleter::OnFileIOComplete(int bytes_copied) { |
88 char* buffer = buffer_.release(); | 88 char* buffer = buffer_.release(); |
89 Start(buffer, bytes_copied); | 89 Start(buffer, bytes_copied); |
90 } | 90 } |
91 | 91 |
92 void ChildrenDeleter::Start(char* buffer, int len) { | 92 void ChildrenDeleter::Start(char* buffer, int len) { |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 CompletionCallback cb = abort_callbacks_[i]; | 901 CompletionCallback cb = abort_callbacks_[i]; |
902 if (i == abort_callbacks_.size() - 1) | 902 if (i == abort_callbacks_.size() - 1) |
903 abort_callbacks_.clear(); | 903 abort_callbacks_.clear(); |
904 | 904 |
905 entry_->Release(); // Don't touch object after this line. | 905 entry_->Release(); // Don't touch object after this line. |
906 cb.Run(net::OK); | 906 cb.Run(net::OK); |
907 } | 907 } |
908 } | 908 } |
909 | 909 |
910 } // namespace disk_cache | 910 } // namespace disk_cache |
OLD | NEW |