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

Side by Side Diff: net/disk_cache/blockfile/sparse_control_v3.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/sparse_control.cc ('k') | net/disk_cache/blockfile/stats_unittest.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 "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
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
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
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/sparse_control.cc ('k') | net/disk_cache/blockfile/stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698