| 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 <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void set_existing_entry(const AppCacheEntry& entry) { | 129 void set_existing_entry(const AppCacheEntry& entry) { |
| 130 existing_entry_ = entry; | 130 existing_entry_ = entry; |
| 131 } | 131 } |
| 132 ResultType result() const { return result_; } | 132 ResultType result() const { return result_; } |
| 133 int redirect_response_code() const { return redirect_response_code_; } | 133 int redirect_response_code() const { return redirect_response_code_; } |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 // URLRequest::Delegate overrides | 136 // URLRequest::Delegate overrides |
| 137 virtual void OnReceivedRedirect(net::URLRequest* request, | 137 virtual void OnReceivedRedirect(net::URLRequest* request, |
| 138 const net::RedirectInfo& redirect_info, | 138 const net::RedirectInfo& redirect_info, |
| 139 bool* defer_redirect) OVERRIDE; | 139 bool* defer_redirect) override; |
| 140 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 140 virtual void OnResponseStarted(net::URLRequest* request) override; |
| 141 virtual void OnReadCompleted(net::URLRequest* request, | 141 virtual void OnReadCompleted(net::URLRequest* request, |
| 142 int bytes_read) OVERRIDE; | 142 int bytes_read) override; |
| 143 | 143 |
| 144 void AddConditionalHeaders(const net::HttpResponseHeaders* headers); | 144 void AddConditionalHeaders(const net::HttpResponseHeaders* headers); |
| 145 void OnWriteComplete(int result); | 145 void OnWriteComplete(int result); |
| 146 void ReadResponseData(); | 146 void ReadResponseData(); |
| 147 bool ConsumeResponseData(int bytes_read); | 147 bool ConsumeResponseData(int bytes_read); |
| 148 void OnResponseCompleted(); | 148 void OnResponseCompleted(); |
| 149 bool MaybeRetryRequest(); | 149 bool MaybeRetryRequest(); |
| 150 | 150 |
| 151 GURL url_; | 151 GURL url_; |
| 152 AppCacheUpdateJob* job_; | 152 AppCacheUpdateJob* job_; |
| 153 FetchType fetch_type_; | 153 FetchType fetch_type_; |
| 154 int retry_503_attempts_; | 154 int retry_503_attempts_; |
| 155 scoped_refptr<net::IOBuffer> buffer_; | 155 scoped_refptr<net::IOBuffer> buffer_; |
| 156 scoped_ptr<net::URLRequest> request_; | 156 scoped_ptr<net::URLRequest> request_; |
| 157 AppCacheEntry existing_entry_; | 157 AppCacheEntry existing_entry_; |
| 158 scoped_refptr<net::HttpResponseHeaders> existing_response_headers_; | 158 scoped_refptr<net::HttpResponseHeaders> existing_response_headers_; |
| 159 std::string manifest_data_; | 159 std::string manifest_data_; |
| 160 ResultType result_; | 160 ResultType result_; |
| 161 int redirect_response_code_; | 161 int redirect_response_code_; |
| 162 scoped_ptr<AppCacheResponseWriter> response_writer_; | 162 scoped_ptr<AppCacheResponseWriter> response_writer_; |
| 163 }; // class URLFetcher | 163 }; // class URLFetcher |
| 164 | 164 |
| 165 AppCacheResponseWriter* CreateResponseWriter(); | 165 AppCacheResponseWriter* CreateResponseWriter(); |
| 166 | 166 |
| 167 // Methods for AppCacheStorage::Delegate. | 167 // Methods for AppCacheStorage::Delegate. |
| 168 virtual void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, | 168 virtual void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, |
| 169 int64 response_id) OVERRIDE; | 169 int64 response_id) override; |
| 170 virtual void OnGroupAndNewestCacheStored(AppCacheGroup* group, | 170 virtual void OnGroupAndNewestCacheStored(AppCacheGroup* group, |
| 171 AppCache* newest_cache, | 171 AppCache* newest_cache, |
| 172 bool success, | 172 bool success, |
| 173 bool would_exceed_quota) OVERRIDE; | 173 bool would_exceed_quota) override; |
| 174 virtual void OnGroupMadeObsolete(AppCacheGroup* group, | 174 virtual void OnGroupMadeObsolete(AppCacheGroup* group, |
| 175 bool success, | 175 bool success, |
| 176 int response_code) OVERRIDE; | 176 int response_code) override; |
| 177 | 177 |
| 178 // Methods for AppCacheHost::Observer. | 178 // Methods for AppCacheHost::Observer. |
| 179 virtual void OnCacheSelectionComplete(AppCacheHost* host) OVERRIDE {} // N/A | 179 virtual void OnCacheSelectionComplete(AppCacheHost* host) override {} // N/A |
| 180 virtual void OnDestructionImminent(AppCacheHost* host) OVERRIDE; | 180 virtual void OnDestructionImminent(AppCacheHost* host) override; |
| 181 | 181 |
| 182 // Methods for AppCacheServiceImpl::Observer. | 182 // Methods for AppCacheServiceImpl::Observer. |
| 183 virtual void OnServiceReinitialized( | 183 virtual void OnServiceReinitialized( |
| 184 AppCacheStorageReference* old_storage) OVERRIDE; | 184 AppCacheStorageReference* old_storage) override; |
| 185 | 185 |
| 186 void HandleCacheFailure(const AppCacheErrorDetails& details, | 186 void HandleCacheFailure(const AppCacheErrorDetails& details, |
| 187 ResultType result, | 187 ResultType result, |
| 188 const GURL& failed_resource_url); | 188 const GURL& failed_resource_url); |
| 189 | 189 |
| 190 void FetchManifest(bool is_first_fetch); | 190 void FetchManifest(bool is_first_fetch); |
| 191 void HandleManifestFetchCompleted(URLFetcher* fetcher); | 191 void HandleManifestFetchCompleted(URLFetcher* fetcher); |
| 192 void ContinueHandleManifestFetchCompleted(bool changed); | 192 void ContinueHandleManifestFetchCompleted(bool changed); |
| 193 | 193 |
| 194 void HandleUrlFetchCompleted(URLFetcher* fetcher); | 194 void HandleUrlFetchCompleted(URLFetcher* fetcher); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 AppCacheStorage* storage_; | 339 AppCacheStorage* storage_; |
| 340 | 340 |
| 341 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate); | 341 FRIEND_TEST_ALL_PREFIXES(content::AppCacheGroupTest, QueueUpdate); |
| 342 | 342 |
| 343 DISALLOW_COPY_AND_ASSIGN(AppCacheUpdateJob); | 343 DISALLOW_COPY_AND_ASSIGN(AppCacheUpdateJob); |
| 344 }; | 344 }; |
| 345 | 345 |
| 346 } // namespace content | 346 } // namespace content |
| 347 | 347 |
| 348 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ | 348 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ |
| OLD | NEW |