OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSING_DATA_APPCACHE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 #include "webkit/appcache/appcache_service.h" | 12 #include "webkit/appcache/appcache_service.h" |
13 | 13 |
14 class Profile; | 14 class Profile; |
15 | 15 |
16 namespace content { | 16 namespace appcache { |
17 class ResourceContext; | 17 class AppCacheService; |
18 } | 18 } |
19 | 19 |
20 // This class fetches appcache information on behalf of a caller | 20 // This class fetches appcache information on behalf of a caller |
21 // on the UI thread. | 21 // on the UI thread. |
22 class BrowsingDataAppCacheHelper | 22 class BrowsingDataAppCacheHelper |
23 : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> { | 23 : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> { |
24 public: | 24 public: |
25 typedef std::map<GURL, appcache::AppCacheInfoVector> OriginAppCacheInfoMap; | 25 typedef std::map<GURL, appcache::AppCacheInfoVector> OriginAppCacheInfoMap; |
26 | 26 |
27 explicit BrowsingDataAppCacheHelper(Profile* profile); | 27 explicit BrowsingDataAppCacheHelper(Profile* profile); |
(...skipping 10 matching lines...) Expand all Loading... |
38 friend class base::RefCountedThreadSafe<BrowsingDataAppCacheHelper>; | 38 friend class base::RefCountedThreadSafe<BrowsingDataAppCacheHelper>; |
39 virtual ~BrowsingDataAppCacheHelper(); | 39 virtual ~BrowsingDataAppCacheHelper(); |
40 | 40 |
41 base::Closure completion_callback_; | 41 base::Closure completion_callback_; |
42 scoped_refptr<appcache::AppCacheInfoCollection> info_collection_; | 42 scoped_refptr<appcache::AppCacheInfoCollection> info_collection_; |
43 | 43 |
44 private: | 44 private: |
45 void OnFetchComplete(int rv); | 45 void OnFetchComplete(int rv); |
46 | 46 |
47 bool is_fetching_; | 47 bool is_fetching_; |
48 content::ResourceContext* resource_context_; | 48 appcache::AppCacheService* appcache_service_; |
49 net::CancelableCompletionCallback appcache_info_callback_; | 49 net::CancelableCompletionCallback appcache_info_callback_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); | 51 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); |
52 }; | 52 }; |
53 | 53 |
54 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not | 54 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not |
55 // fetch its information from the appcache service, but gets them passed as | 55 // fetch its information from the appcache service, but gets them passed as |
56 // a parameter during construction. | 56 // a parameter during construction. |
57 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { | 57 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { |
58 public: | 58 public: |
(...skipping 25 matching lines...) Expand all Loading... |
84 | 84 |
85 private: | 85 private: |
86 virtual ~CannedBrowsingDataAppCacheHelper(); | 86 virtual ~CannedBrowsingDataAppCacheHelper(); |
87 | 87 |
88 Profile* profile_; | 88 Profile* profile_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); | 90 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); |
91 }; | 91 }; |
92 | 92 |
93 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ | 93 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ |
OLD | NEW |