| OLD | NEW |
| 1 // Copyright (c) 2009 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/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 "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 11 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 // 6.9.6 The application cache selection algorithm | 111 // 6.9.6 The application cache selection algorithm |
| 112 // Check for new 'master' entries. | 112 // Check for new 'master' entries. |
| 113 if (document_response_.appCacheID() == kNoCacheId) { | 113 if (document_response_.appCacheID() == kNoCacheId) { |
| 114 if (is_scheme_supported_ && is_get_method_ && | 114 if (is_scheme_supported_ && is_get_method_ && |
| 115 (manifest_gurl.GetOrigin() == document_url_.GetOrigin())) { | 115 (manifest_gurl.GetOrigin() == document_url_.GetOrigin())) { |
| 116 is_new_master_entry_ = YES; | 116 is_new_master_entry_ = YES; |
| 117 } else { | 117 } else { |
| 118 is_new_master_entry_ = NO; | 118 is_new_master_entry_ = NO; |
| 119 manifest_gurl = GURL::EmptyGURL(); | 119 manifest_gurl = GURL(); |
| 120 } | 120 } |
| 121 backend_->SelectCache(host_id_, document_url_, | 121 backend_->SelectCache(host_id_, document_url_, |
| 122 kNoCacheId, manifest_gurl); | 122 kNoCacheId, manifest_gurl); |
| 123 return true; | 123 return true; |
| 124 } | 124 } |
| 125 | 125 |
| 126 DCHECK(is_new_master_entry_ = NO); | 126 DCHECK(is_new_master_entry_ = NO); |
| 127 | 127 |
| 128 // 6.9.6 The application cache selection algorithm | 128 // 6.9.6 The application cache selection algorithm |
| 129 // Check for 'foreign' entries. | 129 // Check for 'foreign' entries. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 bool WebApplicationCacheHostImpl::swapCache() { | 204 bool WebApplicationCacheHostImpl::swapCache() { |
| 205 // Cache status will change when cache is swapped. Clear out any saved idea | 205 // Cache status will change when cache is swapped. Clear out any saved idea |
| 206 // of status so that backend will be queried for actual status. | 206 // of status so that backend will be queried for actual status. |
| 207 has_status_ = false; | 207 has_status_ = false; |
| 208 has_cached_status_ = false; | 208 has_cached_status_ = false; |
| 209 return backend_->SwapCache(host_id_); | 209 return backend_->SwapCache(host_id_); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // appcache namespace | 212 } // appcache namespace |
| OLD | NEW |