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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_appcache_helper.h

Issue 851553003: Remove bad use of CancelableCallback from BrowingDataAppCacheHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: inline Bind Created 5 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_appcache_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <map> 8 #include <map>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "content/public/browser/appcache_service.h" 12 #include "content/public/browser/appcache_service.h"
13 #include "net/base/completion_callback.h"
14 #include "url/gurl.h" 13 #include "url/gurl.h"
15 14
16 namespace content { 15 namespace content {
17 class BrowserContext; 16 class BrowserContext;
18 } 17 }
19 18
20 // This class fetches appcache information on behalf of a caller 19 // This class fetches appcache information on behalf of a caller
21 // on the UI thread. 20 // on the UI thread.
22 class BrowsingDataAppCacheHelper 21 class BrowsingDataAppCacheHelper
23 : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> { 22 : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> {
(...skipping 15 matching lines...) Expand all
39 virtual ~BrowsingDataAppCacheHelper(); 38 virtual ~BrowsingDataAppCacheHelper();
40 39
41 base::Closure completion_callback_; 40 base::Closure completion_callback_;
42 scoped_refptr<content::AppCacheInfoCollection> info_collection_; 41 scoped_refptr<content::AppCacheInfoCollection> info_collection_;
43 42
44 private: 43 private:
45 void OnFetchComplete(int rv); 44 void OnFetchComplete(int rv);
46 45
47 bool is_fetching_; 46 bool is_fetching_;
48 content::AppCacheService* appcache_service_; 47 content::AppCacheService* appcache_service_;
49 net::CancelableCompletionCallback appcache_info_callback_;
50 48
51 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); 49 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper);
52 }; 50 };
53 51
54 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not 52 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not
55 // fetch its information from the appcache service, but gets them passed as 53 // fetch its information from the appcache service, but gets them passed as
56 // a parameter during construction. 54 // a parameter during construction.
57 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { 55 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper {
58 public: 56 public:
59 explicit CannedBrowsingDataAppCacheHelper( 57 explicit CannedBrowsingDataAppCacheHelper(
(...skipping 19 matching lines...) Expand all
79 void StartFetching(const base::Closure& completion_callback) override; 77 void StartFetching(const base::Closure& completion_callback) override;
80 void DeleteAppCacheGroup(const GURL& manifest_url) override; 78 void DeleteAppCacheGroup(const GURL& manifest_url) override;
81 79
82 private: 80 private:
83 ~CannedBrowsingDataAppCacheHelper() override; 81 ~CannedBrowsingDataAppCacheHelper() override;
84 82
85 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); 83 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper);
86 }; 84 };
87 85
88 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ 86 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_appcache_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698