| 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 "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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 private: | 68 private: |
| 69 friend class base::RefCounted<ChildrenDeleter>; | 69 friend class base::RefCounted<ChildrenDeleter>; |
| 70 ~ChildrenDeleter() override {} | 70 ~ChildrenDeleter() override {} |
| 71 | 71 |
| 72 void DeleteChildren(); | 72 void DeleteChildren(); |
| 73 | 73 |
| 74 base::WeakPtr<disk_cache::BackendImpl> backend_; | 74 base::WeakPtr<disk_cache::BackendImpl> backend_; |
| 75 std::string name_; | 75 std::string name_; |
| 76 disk_cache::Bitmap children_map_; | 76 disk_cache::Bitmap children_map_; |
| 77 int64_t signature_; | 77 int64_t signature_; |
| 78 scoped_ptr<char[]> buffer_; | 78 std::unique_ptr<char[]> buffer_; |
| 79 DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter); | 79 DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // This is the callback of the file operation. | 82 // This is the callback of the file operation. |
| 83 void ChildrenDeleter::OnFileIOComplete(int bytes_copied) { | 83 void ChildrenDeleter::OnFileIOComplete(int bytes_copied) { |
| 84 char* buffer = buffer_.release(); | 84 char* buffer = buffer_.release(); |
| 85 Start(buffer, bytes_copied); | 85 Start(buffer, bytes_copied); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ChildrenDeleter::Start(char* buffer, int len) { | 88 void ChildrenDeleter::Start(char* buffer, int len) { |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 DoAbortCallbacks(); | 864 DoAbortCallbacks(); |
| 865 return; | 865 return; |
| 866 } | 866 } |
| 867 | 867 |
| 868 // We are running a callback from the message loop. It's time to restart what | 868 // We are running a callback from the message loop. It's time to restart what |
| 869 // we were doing before. | 869 // we were doing before. |
| 870 DoChildrenIO(); | 870 DoChildrenIO(); |
| 871 } | 871 } |
| 872 | 872 |
| 873 } // namespace disk_cache | 873 } // namespace disk_cache |
| OLD | NEW |