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 #ifndef WEBKIT_APPCACHE_APPCACHE_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_H_ |
6 #define WEBKIT_APPCACHE_APPCACHE_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const AppCacheGroup* group, | 99 const AppCacheGroup* group, |
100 AppCacheDatabase::CacheRecord* cache_record, | 100 AppCacheDatabase::CacheRecord* cache_record, |
101 std::vector<AppCacheDatabase::EntryRecord>* entries, | 101 std::vector<AppCacheDatabase::EntryRecord>* entries, |
102 std::vector<AppCacheDatabase::FallbackNameSpaceRecord>* fallbacks, | 102 std::vector<AppCacheDatabase::FallbackNameSpaceRecord>* fallbacks, |
103 std::vector<AppCacheDatabase::OnlineWhiteListRecord>* whitelists); | 103 std::vector<AppCacheDatabase::OnlineWhiteListRecord>* whitelists); |
104 | 104 |
105 bool FindResponseForRequest(const GURL& url, | 105 bool FindResponseForRequest(const GURL& url, |
106 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, | 106 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, |
107 GURL* found_fallback_namespace, bool* found_network_namespace); | 107 GURL* found_fallback_namespace, bool* found_network_namespace); |
108 | 108 |
| 109 static bool IsInNetworkNamespace( |
| 110 const GURL& url, |
| 111 const std::vector<GURL> &namespaces); |
| 112 |
109 private: | 113 private: |
110 friend class AppCacheGroup; | 114 friend class AppCacheGroup; |
111 friend class AppCacheHost; | 115 friend class AppCacheHost; |
112 friend class AppCacheStorageImplTest; | 116 friend class AppCacheStorageImplTest; |
113 friend class AppCacheUpdateJobTest; | 117 friend class AppCacheUpdateJobTest; |
114 friend class base::RefCounted<AppCache>; | 118 friend class base::RefCounted<AppCache>; |
115 | 119 |
116 ~AppCache(); | 120 ~AppCache(); |
117 | 121 |
118 // Use AppCacheGroup::Add/RemoveCache() to manipulate owning group. | 122 // Use AppCacheGroup::Add/RemoveCache() to manipulate owning group. |
119 void set_owning_group(AppCacheGroup* group) { owning_group_ = group; } | 123 void set_owning_group(AppCacheGroup* group) { owning_group_ = group; } |
120 | 124 |
121 // FindResponseForRequest helpers | 125 // FindResponseForRequest helpers |
122 FallbackNamespace* FindFallbackNamespace(const GURL& url); | 126 FallbackNamespace* FindFallbackNamespace(const GURL& url); |
123 bool IsInNetworkNamespace(const GURL& url); | |
124 | 127 |
125 // Use AppCacheHost::AssociateCache() to manipulate host association. | 128 // Use AppCacheHost::AssociateCache() to manipulate host association. |
126 void AssociateHost(AppCacheHost* host) { | 129 void AssociateHost(AppCacheHost* host) { |
127 associated_hosts_.insert(host); | 130 associated_hosts_.insert(host); |
128 } | 131 } |
129 void UnassociateHost(AppCacheHost* host); | 132 void UnassociateHost(AppCacheHost* host); |
130 | 133 |
131 const int64 cache_id_; | 134 const int64 cache_id_; |
132 scoped_refptr<AppCacheGroup> owning_group_; | 135 scoped_refptr<AppCacheGroup> owning_group_; |
133 AppCacheHosts associated_hosts_; | 136 AppCacheHosts associated_hosts_; |
(...skipping 15 matching lines...) Expand all Loading... |
149 AppCacheService* service_; | 152 AppCacheService* service_; |
150 | 153 |
151 FRIEND_TEST_ALL_PREFIXES(AppCacheTest, InitializeWithManifest); | 154 FRIEND_TEST_ALL_PREFIXES(AppCacheTest, InitializeWithManifest); |
152 | 155 |
153 DISALLOW_COPY_AND_ASSIGN(AppCache); | 156 DISALLOW_COPY_AND_ASSIGN(AppCache); |
154 }; | 157 }; |
155 | 158 |
156 } // namespace appcache | 159 } // namespace appcache |
157 | 160 |
158 #endif // WEBKIT_APPCACHE_APPCACHE_H_ | 161 #endif // WEBKIT_APPCACHE_APPCACHE_H_ |
OLD | NEW |