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

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

Issue 667923003: Standardize usage of virtual/override/final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/mapped_file_unittest.cc ('k') | net/disk_cache/entry_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/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 // This class deletes the children of a sparse entry. 51 // This class deletes the children of a sparse entry.
52 class ChildrenDeleter 52 class ChildrenDeleter
53 : public base::RefCounted<ChildrenDeleter>, 53 : public base::RefCounted<ChildrenDeleter>,
54 public disk_cache::FileIOCallback { 54 public disk_cache::FileIOCallback {
55 public: 55 public:
56 ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name) 56 ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name)
57 : backend_(backend->GetWeakPtr()), name_(name), signature_(0) {} 57 : backend_(backend->GetWeakPtr()), name_(name), signature_(0) {}
58 58
59 virtual void OnFileIOComplete(int bytes_copied) override; 59 void OnFileIOComplete(int bytes_copied) override;
60 60
61 // Two ways of deleting the children: if we have the children map, use Start() 61 // Two ways of deleting the children: if we have the children map, use Start()
62 // directly, otherwise pass the data address to ReadData(). 62 // directly, otherwise pass the data address to ReadData().
63 void Start(char* buffer, int len); 63 void Start(char* buffer, int len);
64 void ReadData(disk_cache::Addr address, int len); 64 void ReadData(disk_cache::Addr address, int len);
65 65
66 private: 66 private:
67 friend class base::RefCounted<ChildrenDeleter>; 67 friend class base::RefCounted<ChildrenDeleter>;
68 virtual ~ChildrenDeleter() {} 68 ~ChildrenDeleter() override {}
69 69
70 void DeleteChildren(); 70 void DeleteChildren();
71 71
72 base::WeakPtr<disk_cache::BackendImpl> backend_; 72 base::WeakPtr<disk_cache::BackendImpl> backend_;
73 std::string name_; 73 std::string name_;
74 disk_cache::Bitmap children_map_; 74 disk_cache::Bitmap children_map_;
75 int64 signature_; 75 int64 signature_;
76 scoped_ptr<char[]> buffer_; 76 scoped_ptr<char[]> buffer_;
77 DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter); 77 DISALLOW_COPY_AND_ASSIGN(ChildrenDeleter);
78 }; 78 };
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 CompletionCallback cb = abort_callbacks_[i]; 877 CompletionCallback cb = abort_callbacks_[i];
878 if (i == abort_callbacks_.size() - 1) 878 if (i == abort_callbacks_.size() - 1)
879 abort_callbacks_.clear(); 879 abort_callbacks_.clear();
880 880
881 entry_->Release(); // Don't touch object after this line. 881 entry_->Release(); // Don't touch object after this line.
882 cb.Run(net::OK); 882 cb.Run(net::OK);
883 } 883 }
884 } 884 }
885 885
886 } // namespace disk_cache 886 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/mapped_file_unittest.cc ('k') | net/disk_cache/entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698