| 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_UPDATE_JOB_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void ReadResponseData(); | 151 void ReadResponseData(); |
| 152 bool ConsumeResponseData(int bytes_read); | 152 bool ConsumeResponseData(int bytes_read); |
| 153 void OnResponseCompleted(); | 153 void OnResponseCompleted(); |
| 154 bool MaybeRetryRequest(); | 154 bool MaybeRetryRequest(); |
| 155 | 155 |
| 156 GURL url_; | 156 GURL url_; |
| 157 AppCacheUpdateJob* job_; | 157 AppCacheUpdateJob* job_; |
| 158 FetchType fetch_type_; | 158 FetchType fetch_type_; |
| 159 int retry_503_attempts_; | 159 int retry_503_attempts_; |
| 160 scoped_refptr<net::IOBuffer> buffer_; | 160 scoped_refptr<net::IOBuffer> buffer_; |
| 161 scoped_ptr<net::URLRequest> request_; | 161 std::unique_ptr<net::URLRequest> request_; |
| 162 AppCacheEntry existing_entry_; | 162 AppCacheEntry existing_entry_; |
| 163 scoped_refptr<net::HttpResponseHeaders> existing_response_headers_; | 163 scoped_refptr<net::HttpResponseHeaders> existing_response_headers_; |
| 164 std::string manifest_data_; | 164 std::string manifest_data_; |
| 165 ResultType result_; | 165 ResultType result_; |
| 166 int redirect_response_code_; | 166 int redirect_response_code_; |
| 167 scoped_ptr<AppCacheResponseWriter> response_writer_; | 167 std::unique_ptr<AppCacheResponseWriter> response_writer_; |
| 168 }; // class URLFetcher | 168 }; // class URLFetcher |
| 169 | 169 |
| 170 AppCacheResponseWriter* CreateResponseWriter(); | 170 AppCacheResponseWriter* CreateResponseWriter(); |
| 171 | 171 |
| 172 // Methods for AppCacheStorage::Delegate. | 172 // Methods for AppCacheStorage::Delegate. |
| 173 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, | 173 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, |
| 174 int64_t response_id) override; | 174 int64_t response_id) override; |
| 175 void OnGroupAndNewestCacheStored(AppCacheGroup* group, | 175 void OnGroupAndNewestCacheStored(AppCacheGroup* group, |
| 176 AppCache* newest_cache, | 176 AppCache* newest_cache, |
| 177 bool success, | 177 bool success, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // Helper container to track which urls are being loaded from response | 310 // Helper container to track which urls are being loaded from response |
| 311 // storage. | 311 // storage. |
| 312 LoadingResponses loading_responses_; | 312 LoadingResponses loading_responses_; |
| 313 | 313 |
| 314 // Keep track of pending URL requests so we can cancel them if necessary. | 314 // Keep track of pending URL requests so we can cancel them if necessary. |
| 315 URLFetcher* manifest_fetcher_; | 315 URLFetcher* manifest_fetcher_; |
| 316 PendingUrlFetches pending_url_fetches_; | 316 PendingUrlFetches pending_url_fetches_; |
| 317 | 317 |
| 318 // Temporary storage of manifest response data for parsing and comparison. | 318 // Temporary storage of manifest response data for parsing and comparison. |
| 319 std::string manifest_data_; | 319 std::string manifest_data_; |
| 320 scoped_ptr<net::HttpResponseInfo> manifest_response_info_; | 320 std::unique_ptr<net::HttpResponseInfo> manifest_response_info_; |
| 321 scoped_ptr<AppCacheResponseWriter> manifest_response_writer_; | 321 std::unique_ptr<AppCacheResponseWriter> manifest_response_writer_; |
| 322 scoped_refptr<net::IOBuffer> read_manifest_buffer_; | 322 scoped_refptr<net::IOBuffer> read_manifest_buffer_; |
| 323 std::string loaded_manifest_data_; | 323 std::string loaded_manifest_data_; |
| 324 scoped_ptr<AppCacheResponseReader> manifest_response_reader_; | 324 std::unique_ptr<AppCacheResponseReader> manifest_response_reader_; |
| 325 bool manifest_has_valid_mime_type_; | 325 bool manifest_has_valid_mime_type_; |
| 326 | 326 |
| 327 // New master entries added to the cache by this job, used to cleanup | 327 // New master entries added to the cache by this job, used to cleanup |
| 328 // in error conditions. | 328 // in error conditions. |
| 329 std::vector<GURL> added_master_entries_; | 329 std::vector<GURL> added_master_entries_; |
| 330 | 330 |
| 331 // Response ids stored by this update job, used to cleanup in | 331 // Response ids stored by this update job, used to cleanup in |
| 332 // error conditions. | 332 // error conditions. |
| 333 std::vector<int64_t> stored_response_ids_; | 333 std::vector<int64_t> stored_response_ids_; |
| 334 | 334 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 346 base::WeakPtrFactory<AppCacheUpdateJob> weak_factory_; | 346 base::WeakPtrFactory<AppCacheUpdateJob> weak_factory_; |
| 347 | 347 |
| 348 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate); | 348 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate); |
| 349 | 349 |
| 350 DISALLOW_COPY_AND_ASSIGN(AppCacheUpdateJob); | 350 DISALLOW_COPY_AND_ASSIGN(AppCacheUpdateJob); |
| 351 }; | 351 }; |
| 352 | 352 |
| 353 } // namespace content | 353 } // namespace content |
| 354 | 354 |
| 355 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ | 355 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ |
| OLD | NEW |