Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Unified Diff: content/browser/appcache/appcache_storage.h

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Address review comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/appcache/appcache_request_handler.cc ('k') | content/browser/appcache/appcache_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/appcache_storage.h
diff --git a/content/browser/appcache/appcache_storage.h b/content/browser/appcache/appcache_storage.h
index d01de85163296453f29771396e2ddbf1c1b56122..10a3d4c6b9977566d230f6c3bb219534adc5ee02 100644
--- a/content/browser/appcache/appcache_storage.h
+++ b/content/browser/appcache/appcache_storage.h
@@ -15,6 +15,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "content/browser/appcache/appcache_working_set.h"
#include "content/common/content_export.h"
#include "net/base/completion_callback.h"
@@ -194,6 +195,9 @@ class CONTENT_EXPORT AppCacheStorage {
virtual void DeleteResponses(const GURL& manifest_url,
const std::vector<int64_t>& response_ids) = 0;
+ // Returns true if the AppCacheStorage instance is initialized.
+ virtual bool IsInitialized() = 0;
+
// Generates unique storage ids for different object types.
int64_t NewCacheId() { return ++last_cache_id_; }
int64_t NewGroupId() { return ++last_group_id_; }
@@ -207,6 +211,9 @@ class CONTENT_EXPORT AppCacheStorage {
// Simple ptr back to the service object that owns us.
AppCacheServiceImpl* service() { return service_; }
+ // Returns a weak pointer reference to the AppCacheStorage instance.
+ base::WeakPtr<AppCacheStorage> GetWeakPtr();
+
protected:
friend class content::AppCacheQuotaClientTest;
friend class content::AppCacheResponseTest;
@@ -326,6 +333,10 @@ class CONTENT_EXPORT AppCacheStorage {
FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, DelegateReferences);
FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, UsageMap);
+ // The WeakPtrFactory below must occur last in the class definition so they
+ // get destroyed last.
+ base::WeakPtrFactory<AppCacheStorage> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AppCacheStorage);
};
« no previous file with comments | « content/browser/appcache/appcache_request_handler.cc ('k') | content/browser/appcache/appcache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698