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