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 CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/browser/appcache/chrome_appcache_service.h" | 11 #include "content/browser/appcache/chrome_appcache_service.h" |
| 12 #include "net/base/completion_callback.h" |
12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
13 | 14 |
14 class Profile; | 15 class Profile; |
15 | 16 |
16 // This class fetches appcache information on behalf of a caller | 17 // This class fetches appcache information on behalf of a caller |
17 // on the UI thread. | 18 // on the UI thread. |
18 class BrowsingDataAppCacheHelper | 19 class BrowsingDataAppCacheHelper |
19 : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> { | 20 : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> { |
20 public: | 21 public: |
21 explicit BrowsingDataAppCacheHelper(Profile* profile); | 22 explicit BrowsingDataAppCacheHelper(Profile* profile); |
(...skipping 12 matching lines...) Expand all Loading... |
34 virtual ~BrowsingDataAppCacheHelper(); | 35 virtual ~BrowsingDataAppCacheHelper(); |
35 | 36 |
36 base::Closure completion_callback_; | 37 base::Closure completion_callback_; |
37 scoped_refptr<appcache::AppCacheInfoCollection> info_collection_; | 38 scoped_refptr<appcache::AppCacheInfoCollection> info_collection_; |
38 | 39 |
39 private: | 40 private: |
40 void OnFetchComplete(int rv); | 41 void OnFetchComplete(int rv); |
41 | 42 |
42 bool is_fetching_; | 43 bool is_fetching_; |
43 scoped_refptr<ChromeAppCacheService> appcache_service_; | 44 scoped_refptr<ChromeAppCacheService> appcache_service_; |
44 scoped_refptr<net::CancelableOldCompletionCallback<BrowsingDataAppCacheHelper>
> | 45 net::CancelableCompletionCallback appcache_info_callback_; |
45 appcache_info_callback_; | |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); | 47 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); |
48 }; | 48 }; |
49 | 49 |
50 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not | 50 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not |
51 // fetch its information from the appcache service, but gets them passed as | 51 // fetch its information from the appcache service, but gets them passed as |
52 // a parameter during construction. | 52 // a parameter during construction. |
53 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { | 53 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { |
54 public: | 54 public: |
55 explicit CannedBrowsingDataAppCacheHelper(Profile* profile); | 55 explicit CannedBrowsingDataAppCacheHelper(Profile* profile); |
(...skipping 19 matching lines...) Expand all Loading... |
75 | 75 |
76 private: | 76 private: |
77 virtual ~CannedBrowsingDataAppCacheHelper(); | 77 virtual ~CannedBrowsingDataAppCacheHelper(); |
78 | 78 |
79 Profile* profile_; | 79 Profile* profile_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); | 81 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); |
82 }; | 82 }; |
83 | 83 |
84 #endif // CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ | 84 #endif // CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ |
OLD | NEW |