| OLD | NEW |
| 1 // Copyright (c) 2010 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_url_request_job.h" | 10 #include "webkit/appcache/appcache_url_request_job.h" |
| 11 | 11 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return job_; | 114 return job_; |
| 115 } | 115 } |
| 116 | 116 |
| 117 AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( | 117 AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( |
| 118 net::URLRequest* request) { | 118 net::URLRequest* request) { |
| 119 if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) | 119 if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) |
| 120 return NULL; | 120 return NULL; |
| 121 if (!found_fallback_entry_.has_response_id()) | 121 if (!found_fallback_entry_.has_response_id()) |
| 122 return NULL; | 122 return NULL; |
| 123 | 123 |
| 124 if (request->status().status() == URLRequestStatus::CANCELED || | 124 if (request->status().status() == net::URLRequestStatus::CANCELED || |
| 125 request->status().status() == URLRequestStatus::HANDLED_EXTERNALLY) { | 125 request->status().status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { |
| 126 // 6.9.6, step 4: But not if the user canceled the download. | 126 // 6.9.6, step 4: But not if the user canceled the download. |
| 127 return NULL; | 127 return NULL; |
| 128 } | 128 } |
| 129 | 129 |
| 130 // We don't fallback for responses that we delivered. | 130 // We don't fallback for responses that we delivered. |
| 131 if (job_) { | 131 if (job_) { |
| 132 DCHECK(!job_->is_delivering_network_response()); | 132 DCHECK(!job_->is_delivering_network_response()); |
| 133 return NULL; | 133 return NULL; |
| 134 } | 134 } |
| 135 | 135 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 if (!host_->associated_cache() || | 325 if (!host_->associated_cache() || |
| 326 !host_->associated_cache()->is_complete()) { | 326 !host_->associated_cache()->is_complete()) { |
| 327 DeliverNetworkResponse(); | 327 DeliverNetworkResponse(); |
| 328 return; | 328 return; |
| 329 } | 329 } |
| 330 | 330 |
| 331 ContinueMaybeLoadSubResource(); | 331 ContinueMaybeLoadSubResource(); |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace appcache | 334 } // namespace appcache |
| OLD | NEW |