OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_SAFE_BROWSING_BROWSER_SAFE_BROWSING_URL_REQUEST_CONTEXT_GETTE
R_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_BROWSER_SAFE_BROWSING_URL_REQUEST_CONTEXT_GETTE
R_H_ |
| 7 |
| 8 #include "base/files/file_path.h" |
| 9 #include "net/url_request/url_request_context_getter.h" |
| 10 |
| 11 namespace base { |
| 12 class SingleThreadTaskRunner; |
| 13 } |
| 14 |
| 15 namespace net { |
| 16 class ChannelIDService; |
| 17 class CookieStore; |
| 18 class HttpNetworkSession; |
| 19 class HttpTransactionFactory; |
| 20 class URLRequestContext; |
| 21 } |
| 22 |
| 23 namespace safe_browsing { |
| 24 |
| 25 class SafeBrowsingURLRequestContextGetter |
| 26 : public net::URLRequestContextGetter { |
| 27 public: |
| 28 explicit SafeBrowsingURLRequestContextGetter( |
| 29 scoped_refptr<net::URLRequestContextGetter> system_context_getter, |
| 30 const base::FilePath& user_data_dir); |
| 31 |
| 32 // Implementation for net::UrlRequestContextGetter. |
| 33 net::URLRequestContext* GetURLRequestContext() override; |
| 34 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
| 35 const override; |
| 36 |
| 37 // Shuts down any pending requests using the getter, and sets |shut_down_| to |
| 38 // true. |
| 39 void ServiceShuttingDown(); |
| 40 |
| 41 // Disables QUIC. This should not be necessary anymore when |
| 42 // http://crbug.com/678653 is implemented. |
| 43 void DisableQuicOnIOThread(); |
| 44 |
| 45 protected: |
| 46 ~SafeBrowsingURLRequestContextGetter() override; |
| 47 |
| 48 private: |
| 49 base::FilePath GetBaseFilename(); |
| 50 base::FilePath CookieFilePath(); |
| 51 base::FilePath ChannelIDFilePath(); |
| 52 |
| 53 bool shut_down_; |
| 54 base::FilePath user_data_dir_; |
| 55 |
| 56 scoped_refptr<net::URLRequestContextGetter> system_context_getter_; |
| 57 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 58 std::unique_ptr<net::URLRequestContext> safe_browsing_request_context_; |
| 59 std::unique_ptr<net::CookieStore> safe_browsing_cookie_store_; |
| 60 std::unique_ptr<net::ChannelIDService> channel_id_service_; |
| 61 std::unique_ptr<net::HttpNetworkSession> http_network_session_; |
| 62 std::unique_ptr<net::HttpTransactionFactory> http_transaction_factory_; |
| 63 }; |
| 64 |
| 65 } // namespace safe_browsing |
| 66 |
| 67 #endif // COMPONENTS_SAFE_BROWSING_BROWSER_SAFE_BROWSING_URL_REQUEST_CONTEXT_GE
TTER_H_ |
OLD | NEW |