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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 existing_entry_ = entry; | 136 existing_entry_ = entry; |
137 } | 137 } |
138 ResultType result() const { return result_; } | 138 ResultType result() const { return result_; } |
139 int redirect_response_code() const { return redirect_response_code_; } | 139 int redirect_response_code() const { return redirect_response_code_; } |
140 | 140 |
141 private: | 141 private: |
142 // URLRequest::Delegate overrides | 142 // URLRequest::Delegate overrides |
143 void OnReceivedRedirect(net::URLRequest* request, | 143 void OnReceivedRedirect(net::URLRequest* request, |
144 const net::RedirectInfo& redirect_info, | 144 const net::RedirectInfo& redirect_info, |
145 bool* defer_redirect) override; | 145 bool* defer_redirect) override; |
146 void OnResponseStarted(net::URLRequest* request) override; | 146 void OnResponseStarted(net::URLRequest* request, int net_error) override; |
147 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; | 147 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; |
148 | 148 |
149 void AddConditionalHeaders(const net::HttpResponseHeaders* headers); | 149 void AddConditionalHeaders(const net::HttpResponseHeaders* headers); |
150 void OnWriteComplete(int result); | 150 void OnWriteComplete(int result); |
151 void ReadResponseData(); | 151 void ReadResponseData(); |
152 bool ConsumeResponseData(int bytes_read); | 152 bool ConsumeResponseData(int bytes_read); |
153 void OnResponseCompleted(); | 153 void OnResponseCompleted(int net_error); |
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 std::unique_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_; |
(...skipping 21 matching lines...) Expand all Loading... |
185 void OnDestructionImminent(AppCacheHost* host) override; | 185 void OnDestructionImminent(AppCacheHost* host) override; |
186 | 186 |
187 // Methods for AppCacheServiceImpl::Observer. | 187 // Methods for AppCacheServiceImpl::Observer. |
188 void OnServiceReinitialized(AppCacheStorageReference* old_storage) override; | 188 void OnServiceReinitialized(AppCacheStorageReference* old_storage) override; |
189 | 189 |
190 void HandleCacheFailure(const AppCacheErrorDetails& details, | 190 void HandleCacheFailure(const AppCacheErrorDetails& details, |
191 ResultType result, | 191 ResultType result, |
192 const GURL& failed_resource_url); | 192 const GURL& failed_resource_url); |
193 | 193 |
194 void FetchManifest(bool is_first_fetch); | 194 void FetchManifest(bool is_first_fetch); |
195 void HandleManifestFetchCompleted(URLFetcher* fetcher); | 195 void HandleManifestFetchCompleted(URLFetcher* fetcher, int net_error); |
196 void ContinueHandleManifestFetchCompleted(bool changed); | 196 void ContinueHandleManifestFetchCompleted(bool changed); |
197 | 197 |
198 void HandleUrlFetchCompleted(URLFetcher* fetcher); | 198 void HandleUrlFetchCompleted(URLFetcher* fetcher, int net_error); |
199 void HandleMasterEntryFetchCompleted(URLFetcher* fetcher); | 199 void HandleMasterEntryFetchCompleted(URLFetcher* fetcher, int net_error); |
200 | 200 |
201 void HandleManifestRefetchCompleted(URLFetcher* fetcher); | 201 void HandleManifestRefetchCompleted(URLFetcher* fetcher, int net_error); |
202 void OnManifestInfoWriteComplete(int result); | 202 void OnManifestInfoWriteComplete(int result); |
203 void OnManifestDataWriteComplete(int result); | 203 void OnManifestDataWriteComplete(int result); |
204 | 204 |
205 void StoreGroupAndCache(); | 205 void StoreGroupAndCache(); |
206 | 206 |
207 void NotifySingleHost(AppCacheHost* host, AppCacheEventID event_id); | 207 void NotifySingleHost(AppCacheHost* host, AppCacheEventID event_id); |
208 void NotifyAllAssociatedHosts(AppCacheEventID event_id); | 208 void NotifyAllAssociatedHosts(AppCacheEventID event_id); |
209 void NotifyAllProgress(const GURL& url); | 209 void NotifyAllProgress(const GURL& url); |
210 void NotifyAllFinalProgress(); | 210 void NotifyAllFinalProgress(); |
211 void NotifyAllError(const AppCacheErrorDetails& detals); | 211 void NotifyAllError(const AppCacheErrorDetails& detals); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |