[email protected] | 43fe9f5 | 2012-01-03 18:52:10 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | d5b2fdf | 2013-06-05 09:36:55 | [diff] [blame] | 5 | #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ |
| 6 | #define WEBKIT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 7 | |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 8 | #include "base/compiler_specific.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 9 | #include "base/memory/ref_counted.h" |
| 10 | #include "base/memory/scoped_ptr.h" |
[email protected] | e29f933 | 2011-10-28 22:44:57 | [diff] [blame] | 11 | #include "base/memory/weak_ptr.h" |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 12 | #include "net/base/completion_callback.h" |
| 13 | #include "net/http/http_response_info.h" |
[email protected] | ad67777 | 2013-06-29 14:18:38 | [diff] [blame] | 14 | #include "url/gurl.h" |
[email protected] | e5bf2fd | 2013-06-13 02:59:18 | [diff] [blame] | 15 | #include "webkit/browser/webkit_storage_browser_export.h" |
[email protected] | d5b2fdf | 2013-06-05 09:36:55 | [diff] [blame] | 16 | #include "webkit/common/appcache/appcache_interfaces.h" |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 17 | |
| 18 | namespace net { |
| 19 | class IOBuffer; |
| 20 | } |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 21 | |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 22 | namespace appcache { |
| 23 | |
[email protected] | 9f67dd0 | 2013-10-22 23:08:20 | [diff] [blame^] | 24 | class AppCacheStorage; |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 25 | |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 26 | static const int kUnkownResponseDataSize = -1; |
| 27 | |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 28 | // Response info for a particular response id. Instances are tracked in |
| 29 | // the working set. |
[email protected] | e5bf2fd | 2013-06-13 02:59:18 | [diff] [blame] | 30 | class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseInfo |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 31 | : public base::RefCounted<AppCacheResponseInfo> { |
[email protected] | d144b05 | 2009-10-13 01:45:09 | [diff] [blame] | 32 | public: |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 33 | // AppCacheResponseInfo takes ownership of the http_info. |
[email protected] | 9f67dd0 | 2013-10-22 23:08:20 | [diff] [blame^] | 34 | AppCacheResponseInfo(AppCacheStorage* storage, const GURL& manifest_url, |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 35 | int64 response_id, net::HttpResponseInfo* http_info, |
| 36 | int64 response_data_size); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 37 | |
[email protected] | 3367fc1d | 2009-11-09 00:09:21 | [diff] [blame] | 38 | const GURL& manifest_url() const { return manifest_url_; } |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 39 | int64 response_id() const { return response_id_; } |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 40 | const net::HttpResponseInfo* http_response_info() const { |
| 41 | return http_response_info_.get(); |
| 42 | } |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 43 | int64 response_data_size() const { return response_data_size_; } |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 44 | |
| 45 | private: |
[email protected] | 122331d5 | 2009-11-05 23:40:45 | [diff] [blame] | 46 | friend class base::RefCounted<AppCacheResponseInfo>; |
[email protected] | 20f0487a | 2010-09-30 20:06:30 | [diff] [blame] | 47 | virtual ~AppCacheResponseInfo(); |
[email protected] | 122331d5 | 2009-11-05 23:40:45 | [diff] [blame] | 48 | |
[email protected] | 3367fc1d | 2009-11-09 00:09:21 | [diff] [blame] | 49 | const GURL manifest_url_; |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 50 | const int64 response_id_; |
| 51 | const scoped_ptr<net::HttpResponseInfo> http_response_info_; |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 52 | const int64 response_data_size_; |
[email protected] | 9f67dd0 | 2013-10-22 23:08:20 | [diff] [blame^] | 53 | AppCacheStorage* storage_; |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 54 | }; |
| 55 | |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 56 | // A refcounted wrapper for HttpResponseInfo so we can apply the |
| 57 | // refcounting semantics used with IOBuffer with these structures too. |
[email protected] | e5bf2fd | 2013-06-13 02:59:18 | [diff] [blame] | 58 | struct WEBKIT_STORAGE_BROWSER_EXPORT HttpResponseInfoIOBuffer |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 59 | : public base::RefCountedThreadSafe<HttpResponseInfoIOBuffer> { |
| 60 | scoped_ptr<net::HttpResponseInfo> http_info; |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 61 | int response_data_size; |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 62 | |
[email protected] | 20f0487a | 2010-09-30 20:06:30 | [diff] [blame] | 63 | HttpResponseInfoIOBuffer(); |
| 64 | explicit HttpResponseInfoIOBuffer(net::HttpResponseInfo* info); |
[email protected] | 122331d5 | 2009-11-05 23:40:45 | [diff] [blame] | 65 | |
| 66 | private: |
| 67 | friend class base::RefCountedThreadSafe<HttpResponseInfoIOBuffer>; |
[email protected] | 20f0487a | 2010-09-30 20:06:30 | [diff] [blame] | 68 | virtual ~HttpResponseInfoIOBuffer(); |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 69 | }; |
| 70 | |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 71 | // Low level storage API used by the response reader and writer. |
[email protected] | e5bf2fd | 2013-06-13 02:59:18 | [diff] [blame] | 72 | class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDiskCacheInterface { |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 73 | public: |
| 74 | class Entry { |
| 75 | public: |
| 76 | virtual int Read(int index, int64 offset, net::IOBuffer* buf, int buf_len, |
[email protected] | 2a65aceb8 | 2011-12-19 20:59:27 | [diff] [blame] | 77 | const net::CompletionCallback& callback) = 0; |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 78 | virtual int Write(int index, int64 offset, net::IOBuffer* buf, int buf_len, |
[email protected] | 2a65aceb8 | 2011-12-19 20:59:27 | [diff] [blame] | 79 | const net::CompletionCallback& callback) = 0; |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 80 | virtual int64 GetSize(int index) = 0; |
| 81 | virtual void Close() = 0; |
| 82 | protected: |
| 83 | virtual ~Entry() {} |
| 84 | }; |
| 85 | |
| 86 | virtual int CreateEntry(int64 key, Entry** entry, |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 87 | const net::CompletionCallback& callback) = 0; |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 88 | virtual int OpenEntry(int64 key, Entry** entry, |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 89 | const net::CompletionCallback& callback) = 0; |
| 90 | virtual int DoomEntry(int64 key, const net::CompletionCallback& callback) = 0; |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 91 | |
| 92 | protected: |
| 93 | friend class base::RefCounted<AppCacheDiskCacheInterface>; |
| 94 | virtual ~AppCacheDiskCacheInterface() {} |
| 95 | }; |
| 96 | |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 97 | // Common base class for response reader and writer. |
[email protected] | e5bf2fd | 2013-06-13 02:59:18 | [diff] [blame] | 98 | class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseIO { |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 99 | public: |
| 100 | virtual ~AppCacheResponseIO(); |
| 101 | int64 response_id() const { return response_id_; } |
| 102 | |
| 103 | protected: |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 104 | AppCacheResponseIO(int64 response_id, |
[email protected] | 4252f60 | 2011-10-21 19:18:36 | [diff] [blame] | 105 | int64 group_id, |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 106 | AppCacheDiskCacheInterface* disk_cache); |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 107 | |
| 108 | virtual void OnIOComplete(int result) = 0; |
| 109 | |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 110 | bool IsIOPending() { return !callback_.is_null(); } |
[email protected] | 72a3ce5 | 2011-12-22 05:10:24 | [diff] [blame] | 111 | void ScheduleIOCompletionCallback(int result); |
| 112 | void InvokeUserCompletionCallback(int result); |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 113 | void ReadRaw(int index, int offset, net::IOBuffer* buf, int buf_len); |
| 114 | void WriteRaw(int index, int offset, net::IOBuffer* buf, int buf_len); |
| 115 | |
| 116 | const int64 response_id_; |
[email protected] | 4252f60 | 2011-10-21 19:18:36 | [diff] [blame] | 117 | const int64 group_id_; |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 118 | AppCacheDiskCacheInterface* disk_cache_; |
| 119 | AppCacheDiskCacheInterface::Entry* entry_; |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 120 | scoped_refptr<HttpResponseInfoIOBuffer> info_buffer_; |
| 121 | scoped_refptr<net::IOBuffer> buffer_; |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 122 | int buffer_len_; |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 123 | net::CompletionCallback callback_; |
[email protected] | e29f933 | 2011-10-28 22:44:57 | [diff] [blame] | 124 | base::WeakPtrFactory<AppCacheResponseIO> weak_factory_; |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 125 | |
| 126 | private: |
| 127 | void OnRawIOComplete(int result); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 128 | }; |
| 129 | |
| 130 | // Reads existing response data from storage. If the object is deleted |
| 131 | // and there is a read in progress, the implementation will return |
| 132 | // immediately but will take care of any side effect of cancelling the |
| 133 | // operation. In other words, instances are safe to delete at will. |
[email protected] | e5bf2fd | 2013-06-13 02:59:18 | [diff] [blame] | 134 | class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseReader |
| 135 | : public AppCacheResponseIO { |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 136 | public: |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 137 | virtual ~AppCacheResponseReader(); |
| 138 | |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 139 | // Reads http info from storage. Always returns the result of the read |
| 140 | // asynchronously through the 'callback'. Returns the number of bytes read |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 141 | // or a net:: error code. Guaranteed to not perform partial reads of |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 142 | // the info data. The reader acquires a reference to the 'info_buf' until |
| 143 | // completion at which time the callback is invoked with either a negative |
| 144 | // error code or the number of bytes read. The 'info_buf' argument should |
| 145 | // contain a NULL http_info when ReadInfo is called. The 'callback' is a |
| 146 | // required parameter. |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 147 | // Should only be called where there is no Read operation in progress. |
[email protected] | 20d06f6 | 2011-07-22 23:57:35 | [diff] [blame] | 148 | // (virtual for testing) |
| 149 | virtual void ReadInfo(HttpResponseInfoIOBuffer* info_buf, |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 150 | const net::CompletionCallback& callback); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 151 | |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 152 | // Reads data from storage. Always returns the result of the read |
| 153 | // asynchronously through the 'callback'. Returns the number of bytes read |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 154 | // or a net:: error code. EOF is indicated with a return value of zero. |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 155 | // The reader acquires a reference to the provided 'buf' until completion |
| 156 | // at which time the callback is invoked with either a negative error code |
| 157 | // or the number of bytes read. The 'callback' is a required parameter. |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 158 | // Should only be called where there is no Read operation in progress. |
[email protected] | 20d06f6 | 2011-07-22 23:57:35 | [diff] [blame] | 159 | // (virtual for testing) |
| 160 | virtual void ReadData(net::IOBuffer* buf, int buf_len, |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 161 | const net::CompletionCallback& callback); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 162 | |
| 163 | // Returns true if there is a read operation, for data or info, pending. |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 164 | bool IsReadPending() { return IsIOPending(); } |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 165 | |
| 166 | // Used to support range requests. If not called, the reader will |
| 167 | // read the entire response body. If called, this must be called prior |
| 168 | // to the first call to the ReadData method. |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 169 | void SetReadRange(int offset, int length); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 170 | |
[email protected] | 20d06f6 | 2011-07-22 23:57:35 | [diff] [blame] | 171 | protected: |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 172 | friend class AppCacheStorageImpl; |
| 173 | friend class MockAppCacheStorage; |
| 174 | |
| 175 | // Should only be constructed by the storage class. |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 176 | AppCacheResponseReader(int64 response_id, |
[email protected] | 4252f60 | 2011-10-21 19:18:36 | [diff] [blame] | 177 | int64 group_id, |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 178 | AppCacheDiskCacheInterface* disk_cache); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 179 | |
[email protected] | 0da6b445 | 2011-11-16 21:36:16 | [diff] [blame] | 180 | virtual void OnIOComplete(int result) OVERRIDE; |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 181 | void ContinueReadInfo(); |
| 182 | void ContinueReadData(); |
| 183 | void OpenEntryIfNeededAndContinue(); |
[email protected] | 43fe9f5 | 2012-01-03 18:52:10 | [diff] [blame] | 184 | void OnOpenEntryComplete(AppCacheDiskCacheInterface::Entry** entry, int rv); |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 185 | |
| 186 | int range_offset_; |
| 187 | int range_length_; |
| 188 | int read_position_; |
[email protected] | 43fe9f5 | 2012-01-03 18:52:10 | [diff] [blame] | 189 | net::CompletionCallback open_callback_; |
| 190 | base::WeakPtrFactory<AppCacheResponseReader> weak_factory_; |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 191 | }; |
| 192 | |
| 193 | // Writes new response data to storage. If the object is deleted |
| 194 | // and there is a write in progress, the implementation will return |
| 195 | // immediately but will take care of any side effect of cancelling the |
| 196 | // operation. In other words, instances are safe to delete at will. |
[email protected] | e5bf2fd | 2013-06-13 02:59:18 | [diff] [blame] | 197 | class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseWriter |
| 198 | : public AppCacheResponseIO { |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 199 | public: |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 200 | virtual ~AppCacheResponseWriter(); |
| 201 | |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 202 | // Writes the http info to storage. Always returns the result of the write |
| 203 | // asynchronously through the 'callback'. Returns the number of bytes written |
| 204 | // or a net:: error code. The writer acquires a reference to the 'info_buf' |
| 205 | // until completion at which time the callback is invoked with either a |
| 206 | // negative error code or the number of bytes written. The 'callback' is a |
| 207 | // required parameter. The contents of 'info_buf' are not modified. |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 208 | // Should only be called where there is no Write operation in progress. |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 209 | void WriteInfo(HttpResponseInfoIOBuffer* info_buf, |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 210 | const net::CompletionCallback& callback); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 211 | |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 212 | // Writes data to storage. Always returns the result of the write |
| 213 | // asynchronously through the 'callback'. Returns the number of bytes written |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 214 | // or a net:: error code. Guaranteed to not perform partial writes. |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 215 | // The writer acquires a reference to the provided 'buf' until completion at |
| 216 | // which time the callback is invoked with either a negative error code or |
| 217 | // the number of bytes written. The 'callback' is a required parameter. |
| 218 | // The contents of 'buf' are not modified. |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 219 | // Should only be called where there is no Write operation in progress. |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 220 | void WriteData(net::IOBuffer* buf, int buf_len, |
[email protected] | 5030416 | 2011-12-21 17:51:30 | [diff] [blame] | 221 | const net::CompletionCallback& callback); |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 222 | |
| 223 | // Returns true if there is a write pending. |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 224 | bool IsWritePending() { return IsIOPending(); } |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 225 | |
[email protected] | 0dfeec3 | 2010-01-06 22:25:33 | [diff] [blame] | 226 | // Returns the amount written, info and data. |
| 227 | int64 amount_written() { return info_size_ + write_position_; } |
| 228 | |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 229 | private: |
| 230 | friend class AppCacheStorageImpl; |
| 231 | friend class MockAppCacheStorage; |
| 232 | |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 233 | enum CreationPhase { |
| 234 | NO_ATTEMPT, |
| 235 | INITIAL_ATTEMPT, |
| 236 | DOOM_EXISTING, |
| 237 | SECOND_ATTEMPT |
| 238 | }; |
| 239 | |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 240 | // Should only be constructed by the storage class. |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 241 | AppCacheResponseWriter(int64 response_id, |
[email protected] | 4252f60 | 2011-10-21 19:18:36 | [diff] [blame] | 242 | int64 group_id, |
[email protected] | f5a73e07 | 2011-09-19 19:34:17 | [diff] [blame] | 243 | AppCacheDiskCacheInterface* disk_cache); |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 244 | |
[email protected] | 0da6b445 | 2011-11-16 21:36:16 | [diff] [blame] | 245 | virtual void OnIOComplete(int result) OVERRIDE; |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 246 | void ContinueWriteInfo(); |
| 247 | void ContinueWriteData(); |
| 248 | void CreateEntryIfNeededAndContinue(); |
[email protected] | 43fe9f5 | 2012-01-03 18:52:10 | [diff] [blame] | 249 | void OnCreateEntryComplete(AppCacheDiskCacheInterface::Entry** entry, int rv); |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 250 | |
[email protected] | 0dfeec3 | 2010-01-06 22:25:33 | [diff] [blame] | 251 | int info_size_; |
[email protected] | 073aabe | 2009-10-21 18:09:33 | [diff] [blame] | 252 | int write_position_; |
| 253 | int write_amount_; |
[email protected] | fd2885a | 2010-03-17 22:02:28 | [diff] [blame] | 254 | CreationPhase creation_phase_; |
[email protected] | 43fe9f5 | 2012-01-03 18:52:10 | [diff] [blame] | 255 | net::CompletionCallback create_callback_; |
| 256 | base::WeakPtrFactory<AppCacheResponseWriter> weak_factory_; |
[email protected] | e7dff7ba | 2009-10-09 03:25:51 | [diff] [blame] | 257 | }; |
| 258 | |
| 259 | } // namespace appcache |
| 260 | |
[email protected] | d5b2fdf | 2013-06-05 09:36:55 | [diff] [blame] | 261 | #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ |