| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return NULL; | 46 return NULL; |
| 47 | 47 |
| 48 // This method can get called multiple times over the life | 48 // This method can get called multiple times over the life |
| 49 // of a request. The case we detect here is having scheduled | 49 // of a request. The case we detect here is having scheduled |
| 50 // delivery of a "network response" using a job setup on an | 50 // delivery of a "network response" using a job setup on an |
| 51 // earlier call thru this method. To send the request thru | 51 // earlier call thru this method. To send the request thru |
| 52 // to the network involves restarting the request altogether, | 52 // to the network involves restarting the request altogether, |
| 53 // which will call thru to our interception layer again. | 53 // which will call thru to our interception layer again. |
| 54 // This time thru, we return NULL so the request hits the wire. | 54 // This time thru, we return NULL so the request hits the wire. |
| 55 if (job_) { | 55 if (job_) { |
| 56 DCHECK(job_->is_delivering_network_response()); | 56 DCHECK(job_->is_delivering_network_response() || |
| 57 job_->cache_entry_not_found()); |
| 57 job_ = NULL; | 58 job_ = NULL; |
| 58 return NULL; | 59 return NULL; |
| 59 } | 60 } |
| 60 | 61 |
| 61 // Clear out our 'found' fields since we're starting a request for a | 62 // Clear out our 'found' fields since we're starting a request for a |
| 62 // new resource, any values in those fields are no longer valid. | 63 // new resource, any values in those fields are no longer valid. |
| 63 found_entry_ = AppCacheEntry(); | 64 found_entry_ = AppCacheEntry(); |
| 64 found_fallback_entry_ = AppCacheEntry(); | 65 found_fallback_entry_ = AppCacheEntry(); |
| 65 found_cache_id_ = kNoCacheId; | 66 found_cache_id_ = kNoCacheId; |
| 66 found_manifest_url_ = GURL(); | 67 found_manifest_url_ = GURL(); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 if (!host_->associated_cache() || | 312 if (!host_->associated_cache() || |
| 312 !host_->associated_cache()->is_complete()) { | 313 !host_->associated_cache()->is_complete()) { |
| 313 DeliverNetworkResponse(); | 314 DeliverNetworkResponse(); |
| 314 return; | 315 return; |
| 315 } | 316 } |
| 316 | 317 |
| 317 ContinueMaybeLoadSubResource(); | 318 ContinueMaybeLoadSubResource(); |
| 318 } | 319 } |
| 319 | 320 |
| 320 } // namespace appcache | 321 } // namespace appcache |
| OLD | NEW |