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 CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "content/browser/appcache/appcache_entry.h" | 13 #include "content/browser/appcache/appcache_entry.h" |
14 #include "content/browser/appcache/appcache_executable_handler.h" | 14 #include "content/browser/appcache/appcache_executable_handler.h" |
15 #include "content/browser/appcache/appcache_job.h" | 15 #include "content/browser/appcache/appcache_job.h" |
16 #include "content/browser/appcache/appcache_response.h" | |
17 #include "content/browser/appcache/appcache_storage.h" | 16 #include "content/browser/appcache/appcache_storage.h" |
18 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
19 #include "net/http/http_byte_range.h" | |
20 #include "net/url_request/url_request_job.h" | 18 #include "net/url_request/url_request_job.h" |
21 | 19 |
22 namespace net { | 20 namespace net { |
23 class GrowableIOBuffer; | 21 class GrowableIOBuffer; |
24 }; | 22 }; |
25 | 23 |
26 namespace content { | 24 namespace content { |
27 class AppCacheHost; | 25 class AppCacheHost; |
28 class AppCacheRequestHandlerTest; | 26 class AppCacheRequestHandlerTest; |
29 class AppCacheURLRequestJobTest; | 27 class AppCacheURLRequestJobTest; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void OnExecutableResponseCallback( | 89 void OnExecutableResponseCallback( |
92 const AppCacheExecutableHandler::Response& response); | 90 const AppCacheExecutableHandler::Response& response); |
93 void BeginErrorDelivery(const char* message); | 91 void BeginErrorDelivery(const char* message); |
94 | 92 |
95 // AppCacheStorage::Delegate methods | 93 // AppCacheStorage::Delegate methods |
96 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, | 94 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, |
97 int64_t response_id) override; | 95 int64_t response_id) override; |
98 void OnCacheLoaded(AppCache* cache, int64_t cache_id) override; | 96 void OnCacheLoaded(AppCache* cache, int64_t cache_id) override; |
99 | 97 |
100 const net::HttpResponseInfo* http_info() const; | 98 const net::HttpResponseInfo* http_info() const; |
101 bool is_range_request() const { return range_requested_.IsValid(); } | |
102 void SetupRangeResponse(); | |
103 | 99 |
104 // AppCacheResponseReader completion callback | 100 // AppCacheResponseReader completion callback |
105 void OnReadComplete(int result); | 101 void OnReadComplete(int result); |
106 | 102 |
107 // net::URLRequestJob methods, see url_request_job.h for doc comments | 103 // net::URLRequestJob methods, see url_request_job.h for doc comments |
108 void Start() override; | 104 void Start() override; |
109 net::LoadState GetLoadState() const override; | 105 net::LoadState GetLoadState() const override; |
110 bool GetCharset(std::string* charset) override; | 106 bool GetCharset(std::string* charset) override; |
111 void GetResponseInfo(net::HttpResponseInfo* info) override; | 107 void GetResponseInfo(net::HttpResponseInfo* info) override; |
112 int ReadRawData(net::IOBuffer* buf, int buf_size) override; | 108 int ReadRawData(net::IOBuffer* buf, int buf_size) override; |
(...skipping 13 matching lines...) Expand all Loading... |
126 AppCacheHost* host_; | 122 AppCacheHost* host_; |
127 AppCacheStorage* storage_; | 123 AppCacheStorage* storage_; |
128 base::TimeTicks start_time_tick_; | 124 base::TimeTicks start_time_tick_; |
129 bool has_been_started_; | 125 bool has_been_started_; |
130 bool has_been_killed_; | 126 bool has_been_killed_; |
131 GURL manifest_url_; | 127 GURL manifest_url_; |
132 int64_t cache_id_; | 128 int64_t cache_id_; |
133 AppCacheEntry entry_; | 129 AppCacheEntry entry_; |
134 bool is_fallback_; | 130 bool is_fallback_; |
135 bool is_main_resource_; // Used for histogram logging. | 131 bool is_main_resource_; // Used for histogram logging. |
136 scoped_refptr<AppCacheResponseInfo> info_; | |
137 scoped_refptr<net::GrowableIOBuffer> handler_source_buffer_; | 132 scoped_refptr<net::GrowableIOBuffer> handler_source_buffer_; |
138 std::unique_ptr<AppCacheResponseReader> handler_source_reader_; | 133 std::unique_ptr<AppCacheResponseReader> handler_source_reader_; |
139 net::HttpByteRange range_requested_; | |
140 std::unique_ptr<net::HttpResponseInfo> range_response_info_; | |
141 std::unique_ptr<AppCacheResponseReader> reader_; | 134 std::unique_ptr<AppCacheResponseReader> reader_; |
142 scoped_refptr<AppCache> cache_; | 135 scoped_refptr<AppCache> cache_; |
143 scoped_refptr<AppCacheGroup> group_; | 136 scoped_refptr<AppCacheGroup> group_; |
144 const OnPrepareToRestartCallback on_prepare_to_restart_callback_; | 137 const OnPrepareToRestartCallback on_prepare_to_restart_callback_; |
145 }; | 138 }; |
146 | 139 |
147 } // namespace content | 140 } // namespace content |
148 | 141 |
149 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ | 142 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ |
OLD | NEW |