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_storage_impl.h" | 5 #include "webkit/appcache/appcache_storage_impl.h" |
6 | 6 |
7 #include "app/sql/connection.h" | 7 #include "app/sql/connection.h" |
8 #include "app/sql/transaction.h" | 8 #include "app/sql/transaction.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 DelegateReferenceVector* delegates, const GURL& url, | 1034 DelegateReferenceVector* delegates, const GURL& url, |
1035 const AppCacheEntry& entry, const AppCacheEntry& fallback_entry, | 1035 const AppCacheEntry& entry, const AppCacheEntry& fallback_entry, |
1036 int64 cache_id, const GURL& manifest_url) { | 1036 int64 cache_id, const GURL& manifest_url) { |
1037 if (!manifest_url.is_empty()) { | 1037 if (!manifest_url.is_empty()) { |
1038 // Check the policy prior to returning a main resource from the appcache. | 1038 // Check the policy prior to returning a main resource from the appcache. |
1039 AppCachePolicy* policy = service()->appcache_policy(); | 1039 AppCachePolicy* policy = service()->appcache_policy(); |
1040 if (policy && !policy->CanLoadAppCache(manifest_url)) { | 1040 if (policy && !policy->CanLoadAppCache(manifest_url)) { |
1041 FOR_EACH_DELEGATE( | 1041 FOR_EACH_DELEGATE( |
1042 (*delegates), | 1042 (*delegates), |
1043 OnMainResponseFound(url, AppCacheEntry(), AppCacheEntry(), | 1043 OnMainResponseFound(url, AppCacheEntry(), AppCacheEntry(), |
1044 kNoCacheId, GURL())); | 1044 kNoCacheId, GURL(), true)); |
1045 return; | 1045 return; |
1046 } | 1046 } |
1047 } | 1047 } |
1048 | 1048 |
1049 FOR_EACH_DELEGATE( | 1049 FOR_EACH_DELEGATE( |
1050 (*delegates), | 1050 (*delegates), |
1051 OnMainResponseFound(url, entry, fallback_entry, | 1051 OnMainResponseFound(url, entry, fallback_entry, |
1052 cache_id, manifest_url)); | 1052 cache_id, manifest_url, false)); |
1053 } | 1053 } |
1054 | 1054 |
1055 void AppCacheStorageImpl::FindResponseForSubRequest( | 1055 void AppCacheStorageImpl::FindResponseForSubRequest( |
1056 AppCache* cache, const GURL& url, | 1056 AppCache* cache, const GURL& url, |
1057 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, | 1057 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, |
1058 bool* found_network_namespace) { | 1058 bool* found_network_namespace) { |
1059 DCHECK(cache && cache->is_complete()); | 1059 DCHECK(cache && cache->is_complete()); |
1060 | 1060 |
1061 // When a group is forcibly deleted, all subresource loads for pages | 1061 // When a group is forcibly deleted, all subresource loads for pages |
1062 // using caches in the group will result in a synthesized network errors. | 1062 // using caches in the group will result in a synthesized network errors. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 Disable(); | 1293 Disable(); |
1294 if (!is_incognito_) { | 1294 if (!is_incognito_) { |
1295 LOG(INFO) << "Deleting existing appcache data and starting over."; | 1295 LOG(INFO) << "Deleting existing appcache data and starting over."; |
1296 AppCacheThread::PostTask(AppCacheThread::db(), FROM_HERE, | 1296 AppCacheThread::PostTask(AppCacheThread::db(), FROM_HERE, |
1297 NewRunnableFunction(DeleteDirectory, cache_directory_)); | 1297 NewRunnableFunction(DeleteDirectory, cache_directory_)); |
1298 } | 1298 } |
1299 } | 1299 } |
1300 } | 1300 } |
1301 | 1301 |
1302 } // namespace appcache | 1302 } // namespace appcache |
OLD | NEW |