OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/sparse_control.h" | 5 #include "net/disk_cache/sparse_control.h" |
6 | 6 |
7 #include "base/format_macros.h" | |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "base/string_util.h" | 10 #include "base/string_util.h" |
10 #include "base/time.h" | 11 #include "base/time.h" |
11 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
12 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
13 #include "net/disk_cache/backend_impl.h" | 14 #include "net/disk_cache/backend_impl.h" |
14 #include "net/disk_cache/entry_impl.h" | 15 #include "net/disk_cache/entry_impl.h" |
15 #include "net/disk_cache/file.h" | 16 #include "net/disk_cache/file.h" |
16 | 17 |
(...skipping 16 matching lines...) Expand all Loading... | |
33 // The size of each data block (tracked by the child allocation bitmap). | 34 // The size of each data block (tracked by the child allocation bitmap). |
34 const int kBlockSize = 1024; | 35 const int kBlockSize = 1024; |
35 | 36 |
36 // Returns the name of of a child entry given the base_name and signature of the | 37 // Returns the name of of a child entry given the base_name and signature of the |
37 // parent and the child_id. | 38 // parent and the child_id. |
38 // If the entry is called entry_name, child entries will be named something | 39 // If the entry is called entry_name, child entries will be named something |
39 // like Range_entry_name:XXX:YYY where XXX is the entry signature and YYY is the | 40 // like Range_entry_name:XXX:YYY where XXX is the entry signature and YYY is the |
40 // number of the particular child. | 41 // number of the particular child. |
41 std::string GenerateChildName(const std::string& base_name, int64 signature, | 42 std::string GenerateChildName(const std::string& base_name, int64 signature, |
42 int64 child_id) { | 43 int64 child_id) { |
43 return StringPrintf("Range_%s:%llx:%llx", base_name.c_str(), signature, | 44 return StringPrintf("Range_%s:%"PRIx64":%"PRIx64, base_name.c_str(), |
Mark Mentovai
2009/11/18 20:55:27
Spaces around the macro.
| |
44 child_id); | 45 signature, child_id); |
45 } | 46 } |
46 | 47 |
47 // This class deletes the children of a sparse entry. | 48 // This class deletes the children of a sparse entry. |
48 class ChildrenDeleter | 49 class ChildrenDeleter |
49 : public base::RefCounted<ChildrenDeleter>, | 50 : public base::RefCounted<ChildrenDeleter>, |
50 public disk_cache::FileIOCallback { | 51 public disk_cache::FileIOCallback { |
51 public: | 52 public: |
52 ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name) | 53 ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name) |
53 : backend_(backend), name_(name) {} | 54 : backend_(backend), name_(name) {} |
54 | 55 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
734 net::CompletionCallback* c = abort_callbacks_[i]; | 735 net::CompletionCallback* c = abort_callbacks_[i]; |
735 if (i == abort_callbacks_.size() - 1) | 736 if (i == abort_callbacks_.size() - 1) |
736 abort_callbacks_.clear(); | 737 abort_callbacks_.clear(); |
737 | 738 |
738 entry_->Release(); // Don't touch object after this line. | 739 entry_->Release(); // Don't touch object after this line. |
739 c->Run(net::OK); | 740 c->Run(net::OK); |
740 } | 741 } |
741 } | 742 } |
742 | 743 |
743 } // namespace disk_cache | 744 } // namespace disk_cache |
OLD | NEW |