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 #ifndef NET_TOOLS_DUMP_CACHE_SIMPLE_CACHE_DUMPER_H_ | 5 #ifndef NET_TOOLS_DUMP_CACHE_SIMPLE_CACHE_DUMPER_H_ |
6 #define NET_TOOLS_DUMP_CACHE_SIMPLE_CACHE_DUMPER_H_ | 6 #define NET_TOOLS_DUMP_CACHE_SIMPLE_CACHE_DUMPER_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
12 #include "net/disk_cache/disk_cache.h" | |
13 | 12 |
14 class DiskDumper; | 13 class DiskDumper; |
15 | 14 |
| 15 namespace disk_cache { |
| 16 class Backend; |
| 17 class Entry; |
| 18 } // namespace disk_cache |
| 19 |
16 namespace net { | 20 namespace net { |
17 | 21 |
18 class IOBufferWithSize; | 22 class IOBufferWithSize; |
19 | 23 |
20 // A class for dumping the contents of a disk cache to a series of text | 24 // A class for dumping the contents of a disk cache to a series of text |
21 // files. The files will contain the response headers, followed by the | 25 // files. The files will contain the response headers, followed by the |
22 // response body, as if the HTTP response were written directly to disk. | 26 // response body, as if the HTTP response were written directly to disk. |
23 class SimpleCacheDumper { | 27 class SimpleCacheDumper { |
24 public: | 28 public: |
25 SimpleCacheDumper(base::FilePath input_path, base::FilePath output_path); | 29 SimpleCacheDumper(base::FilePath input_path, base::FilePath output_path); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 int DoDone(); | 72 int DoDone(); |
69 | 73 |
70 void OnIOComplete(int rv); | 74 void OnIOComplete(int rv); |
71 | 75 |
72 State state_; | 76 State state_; |
73 base::FilePath input_path_; | 77 base::FilePath input_path_; |
74 base::FilePath output_path_; | 78 base::FilePath output_path_; |
75 scoped_ptr<disk_cache::Backend> cache_; | 79 scoped_ptr<disk_cache::Backend> cache_; |
76 scoped_ptr<DiskDumper> writer_; | 80 scoped_ptr<DiskDumper> writer_; |
77 base::Thread* cache_thread_; | 81 base::Thread* cache_thread_; |
78 scoped_ptr<disk_cache::Backend::Iterator> iter_; | 82 void* iter_; |
79 disk_cache::Entry* src_entry_; | 83 disk_cache::Entry* src_entry_; |
80 disk_cache::Entry* dst_entry_; | 84 disk_cache::Entry* dst_entry_; |
81 CompletionCallback io_callback_; | 85 CompletionCallback io_callback_; |
82 scoped_refptr<IOBufferWithSize> buf_; | 86 scoped_refptr<IOBufferWithSize> buf_; |
83 int rv_; | 87 int rv_; |
84 | 88 |
85 DISALLOW_COPY_AND_ASSIGN(SimpleCacheDumper); | 89 DISALLOW_COPY_AND_ASSIGN(SimpleCacheDumper); |
86 }; | 90 }; |
87 | 91 |
88 } // namespace net | 92 } // namespace net |
89 | 93 |
90 #endif // NET_TOOLS_DUMP_CACHE_SIMPLE_CACHE_DUMPER_H_ | 94 #endif // NET_TOOLS_DUMP_CACHE_SIMPLE_CACHE_DUMPER_H_ |
OLD | NEW |