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 IOS_WEB_PUBLIC_BROWSER_STATE_H_ | 5 #ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_ |
6 #define IOS_WEB_PUBLIC_BROWSER_STATE_H_ | 6 #define IOS_WEB_PUBLIC_BROWSER_STATE_H_ |
7 | 7 |
8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 class FilePath; | 11 class FilePath; |
12 } | 12 } |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 class URLRequestContextGetter; | 15 class URLRequestContextGetter; |
16 } | 16 } |
17 | 17 |
18 namespace web { | 18 namespace web { |
19 class CertificatePolicyCache; | 19 class CertificatePolicyCache; |
| 20 class URLDataManagerIOS; |
| 21 class URLDataManagerIOSBackend; |
| 22 class URLRequestChromeJob; |
20 | 23 |
21 // This class holds the context needed for a browsing session. | 24 // This class holds the context needed for a browsing session. |
22 // It lives on the UI thread. All these methods must only be called on the UI | 25 // It lives on the UI thread. All these methods must only be called on the UI |
23 // thread. | 26 // thread. |
24 class BrowserState : public base::SupportsUserData { | 27 class BrowserState : public base::SupportsUserData { |
25 public: | 28 public: |
26 ~BrowserState() override; | 29 ~BrowserState() override; |
27 | 30 |
28 // static | 31 // static |
29 static scoped_refptr<CertificatePolicyCache> GetCertificatePolicyCache( | 32 static scoped_refptr<CertificatePolicyCache> GetCertificatePolicyCache( |
(...skipping 11 matching lines...) Expand all Loading... |
41 // BrowserState. | 44 // BrowserState. |
42 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 45 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
43 | 46 |
44 // Safely cast a base::SupportsUserData to a BrowserState. Returns nullptr | 47 // Safely cast a base::SupportsUserData to a BrowserState. Returns nullptr |
45 // if |supports_user_data| is not a BrowserState. | 48 // if |supports_user_data| is not a BrowserState. |
46 static BrowserState* FromSupportsUserData( | 49 static BrowserState* FromSupportsUserData( |
47 base::SupportsUserData* supports_user_data); | 50 base::SupportsUserData* supports_user_data); |
48 | 51 |
49 protected: | 52 protected: |
50 BrowserState(); | 53 BrowserState(); |
| 54 |
| 55 private: |
| 56 friend class URLDataManagerIOS; |
| 57 friend class URLRequestChromeJob; |
| 58 |
| 59 // Returns the URLDataManagerIOSBackend instance associated with this |
| 60 // BrowserState, creating it if necessary. Should only be called on the IO |
| 61 // thread. |
| 62 // Not intended for usage outside of //web. |
| 63 URLDataManagerIOSBackend* GetURLDataManagerIOSBackendOnIOThread(); |
| 64 |
| 65 // The URLDataManagerIOSBackend instance associated with this BrowserState. |
| 66 // Created and destroyed on the IO thread, and should be accessed only from |
| 67 // the IO thread. |
| 68 URLDataManagerIOSBackend* url_data_manager_ios_backend_; |
51 }; | 69 }; |
52 | 70 |
53 } // namespace web | 71 } // namespace web |
54 | 72 |
55 #endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_ | 73 #endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_ |
OLD | NEW |