| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_HOST_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_HOST_H_ |
| 6 #define WEBKIT_APPCACHE_APPCACHE_HOST_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_HOST_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // (see AppCacheUpdateJob). | 116 // (see AppCacheUpdateJob). |
| 117 void AssociateCompleteCache(AppCache* cache); | 117 void AssociateCompleteCache(AppCache* cache); |
| 118 | 118 |
| 119 // Adds a reference to the newest complete cache in a group, unless it's the | 119 // Adds a reference to the newest complete cache in a group, unless it's the |
| 120 // same as the cache that is currently associated with the host. | 120 // same as the cache that is currently associated with the host. |
| 121 void SetSwappableCache(AppCacheGroup* group); | 121 void SetSwappableCache(AppCacheGroup* group); |
| 122 | 122 |
| 123 // Used to ensure that a loaded appcache survives a frame navigation. | 123 // Used to ensure that a loaded appcache survives a frame navigation. |
| 124 void LoadMainResourceCache(int64 cache_id); | 124 void LoadMainResourceCache(int64 cache_id); |
| 125 | 125 |
| 126 // Used to notify the host that a fallback resource is being delivered as | 126 // Used to notify the host that a namespace resource is being delivered as |
| 127 // the main resource of the page and to provide its url. | 127 // the main resource of the page and to provide its url. |
| 128 void NotifyMainResourceFallback(const GURL& fallback_url); | 128 void NotifyMainResourceIsNamespaceEntry(const GURL& namespace_entry_url); |
| 129 | 129 |
| 130 // Used to notify the host that the main resource was blocked by a policy. To | 130 // Used to notify the host that the main resource was blocked by a policy. To |
| 131 // work properly, this method needs to by invoked prior to cache selection. | 131 // work properly, this method needs to by invoked prior to cache selection. |
| 132 void NotifyMainResourceBlocked(const GURL& manifest_url); | 132 void NotifyMainResourceBlocked(const GURL& manifest_url); |
| 133 | 133 |
| 134 // Used by the update job to keep track of which hosts are associated | 134 // Used by the update job to keep track of which hosts are associated |
| 135 // with which pending master entries. | 135 // with which pending master entries. |
| 136 const GURL& pending_master_entry_url() const { | 136 const GURL& pending_master_entry_url() const { |
| 137 return new_master_entry_url_; | 137 return new_master_entry_url_; |
| 138 } | 138 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 // Since these are synchronous scriptable API calls in the client, there can | 239 // Since these are synchronous scriptable API calls in the client, there can |
| 240 // only be one type of callback pending. Also, we have to wait until we have a | 240 // only be one type of callback pending. Also, we have to wait until we have a |
| 241 // cache selection prior to responding to these calls, as cache selection | 241 // cache selection prior to responding to these calls, as cache selection |
| 242 // involves async loading of a cache or a group from storage. | 242 // involves async loading of a cache or a group from storage. |
| 243 GetStatusCallback pending_get_status_callback_; | 243 GetStatusCallback pending_get_status_callback_; |
| 244 StartUpdateCallback pending_start_update_callback_; | 244 StartUpdateCallback pending_start_update_callback_; |
| 245 SwapCacheCallback pending_swap_cache_callback_; | 245 SwapCacheCallback pending_swap_cache_callback_; |
| 246 void* pending_callback_param_; | 246 void* pending_callback_param_; |
| 247 | 247 |
| 248 // True if a fallback resource was delivered as the main resource. | 248 // True if an intercept or fallback namespace resource was |
| 249 bool main_resource_was_fallback_; | 249 // delivered as the main resource. |
| 250 GURL fallback_url_; | 250 bool main_resource_was_namespace_entry_; |
| 251 GURL namespace_entry_url_; |
| 251 | 252 |
| 252 // True if requests for this host were blocked by a policy. | 253 // True if requests for this host were blocked by a policy. |
| 253 bool main_resource_blocked_; | 254 bool main_resource_blocked_; |
| 254 GURL blocked_manifest_url_; | 255 GURL blocked_manifest_url_; |
| 255 | 256 |
| 256 // Tells if info about associated cache is pending. Info is pending | 257 // Tells if info about associated cache is pending. Info is pending |
| 257 // when update job has not returned success yet. | 258 // when update job has not returned success yet. |
| 258 bool associated_cache_info_pending_; | 259 bool associated_cache_info_pending_; |
| 259 | 260 |
| 260 // List of objects observing us. | 261 // List of objects observing us. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 280 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheAllowed); | 281 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheAllowed); |
| 281 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheBlocked); | 282 FRIEND_TEST_ALL_PREFIXES(AppCacheHostTest, SelectCacheBlocked); |
| 282 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); | 283 FRIEND_TEST_ALL_PREFIXES(AppCacheGroupTest, QueueUpdate); |
| 283 | 284 |
| 284 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); | 285 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 } // namespace appcache | 288 } // namespace appcache |
| 288 | 289 |
| 289 #endif // WEBKIT_APPCACHE_APPCACHE_HOST_H_ | 290 #endif // WEBKIT_APPCACHE_APPCACHE_HOST_H_ |
| OLD | NEW |