OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "webkit/appcache/appcache_request_handler.h" | 5 #include "webkit/appcache/appcache_request_handler.h" |
6 | 6 |
7 #include "net/url_request/url_request.h" | 7 #include "net/url_request/url_request.h" |
8 #include "net/url_request/url_request_job.h" | 8 #include "net/url_request/url_request_job.h" |
9 #include "webkit/appcache/appcache.h" | 9 #include "webkit/appcache/appcache.h" |
10 #include "webkit/appcache/appcache_policy.h" | 10 #include "webkit/appcache/appcache_policy.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 return job_; | 117 return job_; |
118 } | 118 } |
119 | 119 |
120 AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( | 120 AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( |
121 net::URLRequest* request) { | 121 net::URLRequest* request) { |
122 if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) | 122 if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) |
123 return NULL; | 123 return NULL; |
124 if (!found_fallback_entry_.has_response_id()) | 124 if (!found_fallback_entry_.has_response_id()) |
125 return NULL; | 125 return NULL; |
126 | 126 |
127 if (request->status().status() == net::URLRequestStatus::CANCELED || | 127 if (request->status().status() == net::URLRequestStatus::CANCELED) { |
128 request->status().status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { | |
129 // 6.9.6, step 4: But not if the user canceled the download. | 128 // 6.9.6, step 4: But not if the user canceled the download. |
130 return NULL; | 129 return NULL; |
131 } | 130 } |
132 | 131 |
133 // We don't fallback for responses that we delivered. | 132 // We don't fallback for responses that we delivered. |
134 if (job_) { | 133 if (job_) { |
135 DCHECK(!job_->is_delivering_network_response()); | 134 DCHECK(!job_->is_delivering_network_response()); |
136 return NULL; | 135 return NULL; |
137 } | 136 } |
138 | 137 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 if (!host_->associated_cache() || | 358 if (!host_->associated_cache() || |
360 !host_->associated_cache()->is_complete()) { | 359 !host_->associated_cache()->is_complete()) { |
361 DeliverNetworkResponse(); | 360 DeliverNetworkResponse(); |
362 return; | 361 return; |
363 } | 362 } |
364 | 363 |
365 ContinueMaybeLoadSubResource(); | 364 ContinueMaybeLoadSubResource(); |
366 } | 365 } |
367 | 366 |
368 } // namespace appcache | 367 } // namespace appcache |
OLD | NEW |