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

Side by Side Diff: content/browser/appcache/chrome_appcache_service.h

Issue 10068037: RefCounted types should not have public destructors, content/browser part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation ordering Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_CHROME_APPCACHE_SERVICE_H_ 5 #ifndef CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
6 #define CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 6 #define CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 23 matching lines...) Expand all
34 // 34 //
35 // TODO(dpranke): Fix dependencies on AppCacheService so that we don't have 35 // TODO(dpranke): Fix dependencies on AppCacheService so that we don't have
36 // to worry about clients calling AppCacheService methods. 36 // to worry about clients calling AppCacheService methods.
37 class CONTENT_EXPORT ChromeAppCacheService 37 class CONTENT_EXPORT ChromeAppCacheService
38 : public base::RefCountedThreadSafe< 38 : public base::RefCountedThreadSafe<
39 ChromeAppCacheService, ChromeAppCacheServiceDeleter>, 39 ChromeAppCacheService, ChromeAppCacheServiceDeleter>,
40 NON_EXPORTED_BASE(public appcache::AppCacheService), 40 NON_EXPORTED_BASE(public appcache::AppCacheService),
41 NON_EXPORTED_BASE(public appcache::AppCachePolicy) { 41 NON_EXPORTED_BASE(public appcache::AppCachePolicy) {
42 public: 42 public:
43 explicit ChromeAppCacheService(quota::QuotaManagerProxy* proxy); 43 explicit ChromeAppCacheService(quota::QuotaManagerProxy* proxy);
44 virtual ~ChromeAppCacheService();
45 44
46 void InitializeOnIOThread( 45 void InitializeOnIOThread(
47 const FilePath& cache_path, // may be empty to use in-memory structures 46 const FilePath& cache_path, // may be empty to use in-memory structures
48 content::ResourceContext* resource_context, 47 content::ResourceContext* resource_context,
49 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); 48 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy);
50 49
51 private:
52 friend struct ChromeAppCacheServiceDeleter;
53
54 void DeleteOnCorrectThread() const;
55
56 // AppCachePolicy overrides 50 // AppCachePolicy overrides
57 virtual bool CanLoadAppCache(const GURL& manifest_url, 51 virtual bool CanLoadAppCache(const GURL& manifest_url,
58 const GURL& first_party) OVERRIDE; 52 const GURL& first_party) OVERRIDE;
59 virtual bool CanCreateAppCache(const GURL& manifest_url, 53 virtual bool CanCreateAppCache(const GURL& manifest_url,
60 const GURL& first_party) OVERRIDE; 54 const GURL& first_party) OVERRIDE;
61 55
56 protected:
57 virtual ~ChromeAppCacheService();
58
59 private:
60 friend class base::DeleteHelper<ChromeAppCacheService>;
61 friend struct ChromeAppCacheServiceDeleter;
62
63 void DeleteOnCorrectThread() const;
64
62 content::ResourceContext* resource_context_; 65 content::ResourceContext* resource_context_;
63 FilePath cache_path_; 66 FilePath cache_path_;
64 67
65 DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService); 68 DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService);
66 }; 69 };
67 70
68 struct ChromeAppCacheServiceDeleter { 71 struct ChromeAppCacheServiceDeleter {
69 static void Destruct(const ChromeAppCacheService* service) { 72 static void Destruct(const ChromeAppCacheService* service) {
70 service->DeleteOnCorrectThread(); 73 service->DeleteOnCorrectThread();
71 } 74 }
72 }; 75 };
73 76
74 #endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 77 #endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698