| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_BLACKLIST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> |
| 10 #include <set> | 11 #include <set> |
| 11 #include <string> | 12 #include <string> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include "base/callback.h" | 15 #include "base/callback.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "components/keyed_service/core/keyed_service.h" | 19 #include "components/keyed_service/core/keyed_service.h" |
| 20 #include "components/safe_browsing_db/database_manager.h" | 20 #include "components/safe_browsing_db/database_manager.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 23 #include "extensions/browser/blacklist_state.h" | 23 #include "extensions/browser/blacklist_state.h" |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 class BrowserContext; | 26 class BrowserContext; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 void ReturnBlacklistStateMap(const GetBlacklistedIDsCallback& callback, | 139 void ReturnBlacklistStateMap(const GetBlacklistedIDsCallback& callback, |
| 140 const std::set<std::string>& blacklisted_ids); | 140 const std::set<std::string>& blacklisted_ids); |
| 141 | 141 |
| 142 base::ObserverList<Observer> observers_; | 142 base::ObserverList<Observer> observers_; |
| 143 | 143 |
| 144 content::NotificationRegistrar registrar_; | 144 content::NotificationRegistrar registrar_; |
| 145 | 145 |
| 146 // The cached BlacklistState's, received from BlacklistStateFetcher. | 146 // The cached BlacklistState's, received from BlacklistStateFetcher. |
| 147 BlacklistStateMap blacklist_state_cache_; | 147 BlacklistStateMap blacklist_state_cache_; |
| 148 | 148 |
| 149 scoped_ptr<BlacklistStateFetcher> state_fetcher_; | 149 std::unique_ptr<BlacklistStateFetcher> state_fetcher_; |
| 150 | 150 |
| 151 typedef std::list<std::pair<std::vector<std::string>, | 151 typedef std::list<std::pair<std::vector<std::string>, |
| 152 base::Callback<void()> > > | 152 base::Callback<void()> > > |
| 153 StateRequestsList; | 153 StateRequestsList; |
| 154 | 154 |
| 155 // The list of ongoing requests for blacklist states that couldn't be | 155 // The list of ongoing requests for blacklist states that couldn't be |
| 156 // served directly from the cache. A new request is created in | 156 // served directly from the cache. A new request is created in |
| 157 // GetBlacklistedIDs and deleted when the callback is called from | 157 // GetBlacklistedIDs and deleted when the callback is called from |
| 158 // OnBlacklistStateReceived. | 158 // OnBlacklistStateReceived. |
| 159 StateRequestsList state_requests_; | 159 StateRequestsList state_requests_; |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(Blacklist); | 161 DISALLOW_COPY_AND_ASSIGN(Blacklist); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 } // namespace extensions | 164 } // namespace extensions |
| 165 | 165 |
| 166 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ | 166 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ |
| OLD | NEW |