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_STATE_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BLACKLIST_STATE_FETCHER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_BLACKLIST_STATE_FETCHER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BLACKLIST_STATE_FETCHER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <set> | 9 #include <set> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" | 15 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" |
16 #include "extensions/browser/blacklist_state.h" | 16 #include "extensions/browser/blacklist_state.h" |
17 #include "net/url_request/url_fetcher.h" | 17 #include "net/url_request/url_fetcher.h" |
18 #include "net/url_request/url_fetcher_delegate.h" | 18 #include "net/url_request/url_fetcher_delegate.h" |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
22 } | 22 } |
23 | 23 |
(...skipping 22 matching lines...) Expand all Loading... |
46 private: | 46 private: |
47 typedef std::multimap<std::string, RequestCallback> CallbackMultiMap; | 47 typedef std::multimap<std::string, RequestCallback> CallbackMultiMap; |
48 | 48 |
49 GURL RequestUrl() const; | 49 GURL RequestUrl() const; |
50 | 50 |
51 void SendRequest(const std::string& id); | 51 void SendRequest(const std::string& id); |
52 | 52 |
53 // ID for URLFetchers for testing. | 53 // ID for URLFetchers for testing. |
54 int url_fetcher_id_; | 54 int url_fetcher_id_; |
55 | 55 |
56 scoped_ptr<safe_browsing::SafeBrowsingProtocolConfig> safe_browsing_config_; | 56 std::unique_ptr<safe_browsing::SafeBrowsingProtocolConfig> |
| 57 safe_browsing_config_; |
57 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 58 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
58 scoped_refptr<net::URLRequestContextGetter> parent_request_context_for_test_; | 59 scoped_refptr<net::URLRequestContextGetter> parent_request_context_for_test_; |
59 | 60 |
60 // Extension id by URLFetcher. | 61 // Extension id by URLFetcher. |
61 std::map<const net::URLFetcher*, std::string> requests_; | 62 std::map<const net::URLFetcher*, std::string> requests_; |
62 | 63 |
63 // Callbacks by extension ID. | 64 // Callbacks by extension ID. |
64 CallbackMultiMap callbacks_; | 65 CallbackMultiMap callbacks_; |
65 | 66 |
66 base::WeakPtrFactory<BlacklistStateFetcher> weak_ptr_factory_; | 67 base::WeakPtrFactory<BlacklistStateFetcher> weak_ptr_factory_; |
67 | 68 |
68 DISALLOW_COPY_AND_ASSIGN(BlacklistStateFetcher); | 69 DISALLOW_COPY_AND_ASSIGN(BlacklistStateFetcher); |
69 }; | 70 }; |
70 | 71 |
71 } // namespace extensions | 72 } // namespace extensions |
72 | 73 |
73 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_STATE_FETCHER_H_ | 74 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_STATE_FETCHER_H_ |
OLD | NEW |