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_URL_REQUEST_VIEW_CACHE_HELPER_H_ | 5 #ifndef NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ |
6 #define NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ | 6 #define NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
12 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
14 #include "net/disk_cache/disk_cache.h" | 14 |
| 15 namespace disk_cache { |
| 16 class Backend; |
| 17 class Entry; |
| 18 } // namespace disk_cache |
15 | 19 |
16 namespace net { | 20 namespace net { |
17 | 21 |
18 class URLRequestContext; | 22 class URLRequestContext; |
19 | 23 |
20 class NET_EXPORT ViewCacheHelper { | 24 class NET_EXPORT ViewCacheHelper { |
21 public: | 25 public: |
22 ViewCacheHelper(); | 26 ViewCacheHelper(); |
23 ~ViewCacheHelper(); | 27 ~ViewCacheHelper(); |
24 | 28 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 int DoReadResponseComplete(int result); | 95 int DoReadResponseComplete(int result); |
92 int DoReadData(); | 96 int DoReadData(); |
93 int DoReadDataComplete(int result); | 97 int DoReadDataComplete(int result); |
94 | 98 |
95 // Called to signal completion of asynchronous IO. | 99 // Called to signal completion of asynchronous IO. |
96 void OnIOComplete(int result); | 100 void OnIOComplete(int result); |
97 | 101 |
98 const URLRequestContext* context_; | 102 const URLRequestContext* context_; |
99 disk_cache::Backend* disk_cache_; | 103 disk_cache::Backend* disk_cache_; |
100 disk_cache::Entry* entry_; | 104 disk_cache::Entry* entry_; |
101 scoped_ptr<disk_cache::Backend::Iterator> iter_; | 105 void* iter_; |
102 scoped_refptr<IOBuffer> buf_; | 106 scoped_refptr<IOBuffer> buf_; |
103 int buf_len_; | 107 int buf_len_; |
104 int index_; | 108 int index_; |
105 | 109 |
106 std::string key_; | 110 std::string key_; |
107 std::string url_prefix_; | 111 std::string url_prefix_; |
108 std::string* data_; | 112 std::string* data_; |
109 CompletionCallback callback_; | 113 CompletionCallback callback_; |
110 | 114 |
111 State next_state_; | 115 State next_state_; |
112 | 116 |
113 base::WeakPtrFactory<ViewCacheHelper> weak_factory_; | 117 base::WeakPtrFactory<ViewCacheHelper> weak_factory_; |
114 | 118 |
115 DISALLOW_COPY_AND_ASSIGN(ViewCacheHelper); | 119 DISALLOW_COPY_AND_ASSIGN(ViewCacheHelper); |
116 }; | 120 }; |
117 | 121 |
118 } // namespace net. | 122 } // namespace net. |
119 | 123 |
120 #endif // NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ | 124 #endif // NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ |
OLD | NEW |