| 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 CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ | 6 #define CONTENT_BROWSER_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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // with which pending master entries. | 156 // with which pending master entries. |
| 157 const GURL& pending_master_entry_url() const { | 157 const GURL& pending_master_entry_url() const { |
| 158 return new_master_entry_url_; | 158 return new_master_entry_url_; |
| 159 } | 159 } |
| 160 | 160 |
| 161 int host_id() const { return host_id_; } | 161 int host_id() const { return host_id_; } |
| 162 AppCacheServiceImpl* service() const { return service_; } | 162 AppCacheServiceImpl* service() const { return service_; } |
| 163 AppCacheStorage* storage() const { return storage_; } | 163 AppCacheStorage* storage() const { return storage_; } |
| 164 AppCacheFrontend* frontend() const { return frontend_; } | 164 AppCacheFrontend* frontend() const { return frontend_; } |
| 165 AppCache* associated_cache() const { return associated_cache_.get(); } | 165 AppCache* associated_cache() const { return associated_cache_.get(); } |
| 166 bool was_select_cache_called() const { return was_select_cache_called_; } |
| 166 | 167 |
| 167 void enable_cache_selection(bool enable) { | 168 void enable_cache_selection(bool enable) { |
| 168 is_cache_selection_enabled_ = enable; | 169 is_cache_selection_enabled_ = enable; |
| 169 } | 170 } |
| 170 | 171 |
| 171 bool is_selection_pending() const { | 172 bool is_selection_pending() const { |
| 172 return pending_selected_cache_id_ != kAppCacheNoCacheId || | 173 return pending_selected_cache_id_ != kAppCacheNoCacheId || |
| 173 !pending_selected_manifest_url_.is_empty(); | 174 !pending_selected_manifest_url_.is_empty(); |
| 174 } | 175 } |
| 175 | 176 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // navigations. | 263 // navigations. |
| 263 scoped_refptr<AppCache> main_resource_cache_; | 264 scoped_refptr<AppCache> main_resource_cache_; |
| 264 int64 pending_main_resource_cache_id_; | 265 int64 pending_main_resource_cache_id_; |
| 265 | 266 |
| 266 // Cache loading is async, if we're loading a specific cache or group | 267 // Cache loading is async, if we're loading a specific cache or group |
| 267 // for the purposes of cache selection, one or the other of these will | 268 // for the purposes of cache selection, one or the other of these will |
| 268 // indicate which cache or group is being loaded. | 269 // indicate which cache or group is being loaded. |
| 269 int64 pending_selected_cache_id_; | 270 int64 pending_selected_cache_id_; |
| 270 GURL pending_selected_manifest_url_; | 271 GURL pending_selected_manifest_url_; |
| 271 | 272 |
| 273 // Used to defend against bad IPC messages. |
| 274 bool was_select_cache_called_; |
| 275 |
| 272 // Used to avoid stepping on pages controlled by ServiceWorkers. | 276 // Used to avoid stepping on pages controlled by ServiceWorkers. |
| 273 bool is_cache_selection_enabled_; | 277 bool is_cache_selection_enabled_; |
| 274 | 278 |
| 275 // A new master entry to be added to the cache, may be empty. | 279 // A new master entry to be added to the cache, may be empty. |
| 276 GURL new_master_entry_url_; | 280 GURL new_master_entry_url_; |
| 277 | 281 |
| 278 // The frontend proxy to deliver notifications to the child process. | 282 // The frontend proxy to deliver notifications to the child process. |
| 279 AppCacheFrontend* frontend_; | 283 AppCacheFrontend* frontend_; |
| 280 | 284 |
| 281 // Our central service object. | 285 // Our central service object. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheAllowed); | 337 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheAllowed); |
| 334 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheBlocked); | 338 FRIEND_TEST_ALL_PREFIXES(content::AppCacheHostTest, SelectCacheBlocked); |
| 335 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, CleanupUnusedCache); | 339 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, CleanupUnusedCache); |
| 336 | 340 |
| 337 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); | 341 DISALLOW_COPY_AND_ASSIGN(AppCacheHost); |
| 338 }; | 342 }; |
| 339 | 343 |
| 340 } // namespace content | 344 } // namespace content |
| 341 | 345 |
| 342 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ | 346 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ |
| OLD | NEW |