Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Side by Side Diff: net/disk_cache/blockfile/sparse_control.cc

Issue 1894733002: Change scoped_ptr to std::unique_ptr in //net/disk_cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/blockfile/rankings.cc ('k') | net/disk_cache/blockfile/sparse_control_v3.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/rankings.cc ('k') | net/disk_cache/blockfile/sparse_control_v3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698