OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/web_application_cache_host_impl.h" | 5 #include "webkit/appcache/web_application_cache_host_impl.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "webkit/api/public/WebURL.h" | 9 #include "webkit/api/public/WebURL.h" |
10 #include "webkit/api/public/WebURLRequest.h" | 10 #include "webkit/api/public/WebURLRequest.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 97 } |
98 | 98 |
99 // Check for new 'master' entries. | 99 // Check for new 'master' entries. |
100 if (main_response_.appCacheID() == kNoCacheId) { | 100 if (main_response_.appCacheID() == kNoCacheId) { |
101 should_capture_main_response_ = is_in_http_family_ ? YES : NO; | 101 should_capture_main_response_ = is_in_http_family_ ? YES : NO; |
102 backend_->SelectCache(host_id_, main_response_url_, | 102 backend_->SelectCache(host_id_, main_response_url_, |
103 kNoCacheId, manifest_gurl); | 103 kNoCacheId, manifest_gurl); |
104 return true; | 104 return true; |
105 } | 105 } |
106 | 106 |
| 107 DCHECK(should_capture_main_response_ == NO); |
| 108 |
107 // Check for 'foreign' entries. | 109 // Check for 'foreign' entries. |
108 GURL main_response_manifest_gurl(main_response_.appCacheManifestURL()); | 110 GURL main_response_manifest_gurl(main_response_.appCacheManifestURL()); |
109 if (main_response_manifest_gurl != manifest_gurl) { | 111 if (main_response_manifest_gurl != manifest_gurl) { |
110 backend_->MarkAsForeignEntry(host_id_, main_response_url_, | 112 backend_->MarkAsForeignEntry(host_id_, main_response_url_, |
111 main_response_.appCacheID()); | 113 main_response_.appCacheID()); |
112 selectCacheWithoutManifest(); | 114 has_cached_status_ = true; |
| 115 cached_status_ = UNCACHED; |
113 return false; // the navigation will be restarted | 116 return false; // the navigation will be restarted |
114 } | 117 } |
115 | 118 |
116 // Its a 'master' entry thats already in the cache. | 119 // Its a 'master' entry thats already in the cache. |
117 backend_->SelectCache(host_id_, main_response_url_, | 120 backend_->SelectCache(host_id_, main_response_url_, |
118 main_response_.appCacheID(), | 121 main_response_.appCacheID(), |
119 manifest_gurl); | 122 manifest_gurl); |
120 return true; | 123 return true; |
121 } | 124 } |
122 | 125 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 174 |
172 bool WebApplicationCacheHostImpl::startUpdate() { | 175 bool WebApplicationCacheHostImpl::startUpdate() { |
173 return backend_->StartUpdate(host_id_); | 176 return backend_->StartUpdate(host_id_); |
174 } | 177 } |
175 | 178 |
176 bool WebApplicationCacheHostImpl::swapCache() { | 179 bool WebApplicationCacheHostImpl::swapCache() { |
177 return backend_->SwapCache(host_id_); | 180 return backend_->SwapCache(host_id_); |
178 } | 181 } |
179 | 182 |
180 } // appcache namespace | 183 } // appcache namespace |
OLD | NEW |