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

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

Issue 9419033: Move creation of BrowserContext objects that live in content to content, instead of depending on th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix memory leaks in tests Created 8 years, 10 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 | « chrome/test/base/testing_profile.cc ('k') | content/browser/appcache/chrome_appcache_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/chrome_appcache_service.h
===================================================================
--- content/browser/appcache/chrome_appcache_service.h (revision 122721)
+++ content/browser/appcache/chrome_appcache_service.h (working copy)
@@ -23,6 +23,8 @@
class ResourceContext;
}
+struct ChromeAppCacheServiceDeleter;
+
// An AppCacheService subclass used by the chrome. There is an instance
// associated with each BrowserContext. This derivation adds refcounting
// semantics since a browser context has multiple URLRequestContexts which refer
@@ -36,12 +38,13 @@
// to worry about clients calling AppCacheService methods.
class CONTENT_EXPORT ChromeAppCacheService
: public base::RefCountedThreadSafe<
- ChromeAppCacheService, content::BrowserThread::DeleteOnIOThread>,
+ ChromeAppCacheService, ChromeAppCacheServiceDeleter>,
NON_EXPORTED_BASE(public appcache::AppCacheService),
NON_EXPORTED_BASE(public appcache::AppCachePolicy),
public content::NotificationObserver {
public:
explicit ChromeAppCacheService(quota::QuotaManagerProxy* proxy);
+ virtual ~ChromeAppCacheService();
void InitializeOnIOThread(
const FilePath& cache_path, // may be empty to use in-memory structures
@@ -49,13 +52,9 @@
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy);
private:
- friend class base::RefCountedThreadSafe<
- ChromeAppCacheService,
- content::BrowserThread::DeleteOnIOThread>;
- friend class content::BrowserThread;
- friend class base::DeleteHelper<ChromeAppCacheService>;
+ friend struct ChromeAppCacheServiceDeleter;
- virtual ~ChromeAppCacheService();
+ void DeleteOnCorrectThread() const;
// AppCachePolicy overrides
virtual bool CanLoadAppCache(const GURL& manifest_url,
@@ -75,4 +74,10 @@
DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService);
};
+struct ChromeAppCacheServiceDeleter {
+ static void Destruct(const ChromeAppCacheService* service) {
+ service->DeleteOnCorrectThread();
+ }
+};
+
#endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | content/browser/appcache/chrome_appcache_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698