OLD | NEW |
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 ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class GURL; | 23 class GURL; |
24 class PrefService; | 24 class PrefService; |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class PermissionManager; | 27 class PermissionManager; |
28 class ResourceContext; | 28 class ResourceContext; |
29 class SSLHostStateDelegate; | 29 class SSLHostStateDelegate; |
30 class WebContents; | 30 class WebContents; |
31 } | 31 } |
32 | 32 |
33 namespace data_reduction_proxy { | |
34 class DataReductionProxyConfigurator; | |
35 class DataReductionProxyIOData; | |
36 class DataReductionProxyService; | |
37 class DataReductionProxySettings; | |
38 } | |
39 | |
40 namespace policy { | 33 namespace policy { |
41 class URLBlacklistManager; | 34 class URLBlacklistManager; |
42 class BrowserPolicyConnectorBase; | 35 class BrowserPolicyConnectorBase; |
43 } | 36 } |
44 | 37 |
45 namespace visitedlink { | 38 namespace visitedlink { |
46 class VisitedLinkMaster; | 39 class VisitedLinkMaster; |
47 } | 40 } |
48 | 41 |
49 namespace android_webview { | 42 namespace android_webview { |
(...skipping 20 matching lines...) Expand all Loading... |
70 ~AwBrowserContext() override; | 63 ~AwBrowserContext() override; |
71 | 64 |
72 // Currently only one instance per process is supported. | 65 // Currently only one instance per process is supported. |
73 static AwBrowserContext* GetDefault(); | 66 static AwBrowserContext* GetDefault(); |
74 | 67 |
75 // Convenience method to returns the AwBrowserContext corresponding to the | 68 // Convenience method to returns the AwBrowserContext corresponding to the |
76 // given WebContents. | 69 // given WebContents. |
77 static AwBrowserContext* FromWebContents( | 70 static AwBrowserContext* FromWebContents( |
78 content::WebContents* web_contents); | 71 content::WebContents* web_contents); |
79 | 72 |
80 static void SetDataReductionProxyEnabled(bool enabled); | |
81 static void SetLegacyCacheRemovalDelayForTest(int delay_ms); | 73 static void SetLegacyCacheRemovalDelayForTest(int delay_ms); |
82 | 74 |
83 // Maps to BrowserMainParts::PreMainMessageLoopRun. | 75 // Maps to BrowserMainParts::PreMainMessageLoopRun. |
84 void PreMainMessageLoopRun(); | 76 void PreMainMessageLoopRun(); |
85 | 77 |
86 // These methods map to Add methods in visitedlink::VisitedLinkMaster. | 78 // These methods map to Add methods in visitedlink::VisitedLinkMaster. |
87 void AddVisitedURLs(const std::vector<GURL>& urls); | 79 void AddVisitedURLs(const std::vector<GURL>& urls); |
88 | 80 |
89 AwQuotaManagerBridge* GetQuotaManagerBridge(); | 81 AwQuotaManagerBridge* GetQuotaManagerBridge(); |
90 AwFormDatabaseService* GetFormDatabaseService(); | 82 AwFormDatabaseService* GetFormDatabaseService(); |
91 data_reduction_proxy::DataReductionProxySettings* | |
92 GetDataReductionProxySettings(); | |
93 data_reduction_proxy::DataReductionProxyIOData* | |
94 GetDataReductionProxyIOData(); | |
95 AwURLRequestContextGetter* GetAwURLRequestContext(); | 83 AwURLRequestContextGetter* GetAwURLRequestContext(); |
96 AwMessagePortService* GetMessagePortService(); | 84 AwMessagePortService* GetMessagePortService(); |
97 | 85 |
98 policy::URLBlacklistManager* GetURLBlacklistManager(); | 86 policy::URLBlacklistManager* GetURLBlacklistManager(); |
99 | 87 |
100 // content::BrowserContext implementation. | 88 // content::BrowserContext implementation. |
101 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate( | 89 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate( |
102 const base::FilePath& partition_path) override; | 90 const base::FilePath& partition_path) override; |
103 base::FilePath GetPath() const override; | 91 base::FilePath GetPath() const override; |
104 bool IsOffTheRecord() const override; | 92 bool IsOffTheRecord() const override; |
(...skipping 16 matching lines...) Expand all Loading... |
121 net::URLRequestContextGetter* CreateMediaRequestContext() override; | 109 net::URLRequestContextGetter* CreateMediaRequestContext() override; |
122 net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition( | 110 net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition( |
123 const base::FilePath& partition_path, | 111 const base::FilePath& partition_path, |
124 bool in_memory) override; | 112 bool in_memory) override; |
125 | 113 |
126 // visitedlink::VisitedLinkDelegate implementation. | 114 // visitedlink::VisitedLinkDelegate implementation. |
127 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override; | 115 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override; |
128 | 116 |
129 private: | 117 private: |
130 void InitUserPrefService(); | 118 void InitUserPrefService(); |
131 void CreateDataReductionProxyStatisticsIfNecessary(); | |
132 static bool data_reduction_proxy_enabled_; | |
133 | 119 |
134 // Delay, in milliseconds, before removing the legacy cache dir. | 120 // Delay, in milliseconds, before removing the legacy cache dir. |
135 // This is non-const for testing purposes. | 121 // This is non-const for testing purposes. |
136 static int legacy_cache_removal_delay_ms_; | 122 static int legacy_cache_removal_delay_ms_; |
137 | 123 |
138 // The file path where data for this context is persisted. | 124 // The file path where data for this context is persisted. |
139 base::FilePath context_storage_path_; | 125 base::FilePath context_storage_path_; |
140 | 126 |
141 JniDependencyFactory* native_factory_; | 127 JniDependencyFactory* native_factory_; |
142 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; | 128 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; |
143 scoped_refptr<AwQuotaManagerBridge> quota_manager_bridge_; | 129 scoped_refptr<AwQuotaManagerBridge> quota_manager_bridge_; |
144 std::unique_ptr<AwFormDatabaseService> form_database_service_; | 130 std::unique_ptr<AwFormDatabaseService> form_database_service_; |
145 std::unique_ptr<AwMessagePortService> message_port_service_; | 131 std::unique_ptr<AwMessagePortService> message_port_service_; |
146 | 132 |
147 AwDownloadManagerDelegate download_manager_delegate_; | 133 AwDownloadManagerDelegate download_manager_delegate_; |
148 | 134 |
149 std::unique_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; | 135 std::unique_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; |
150 std::unique_ptr<content::ResourceContext> resource_context_; | 136 std::unique_ptr<content::ResourceContext> resource_context_; |
151 | 137 |
152 std::unique_ptr<PrefService> user_pref_service_; | 138 std::unique_ptr<PrefService> user_pref_service_; |
153 std::unique_ptr<policy::BrowserPolicyConnectorBase> browser_policy_connector_; | 139 std::unique_ptr<policy::BrowserPolicyConnectorBase> browser_policy_connector_; |
154 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_; | 140 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_; |
155 | 141 |
156 std::unique_ptr<data_reduction_proxy::DataReductionProxySettings> | |
157 data_reduction_proxy_settings_; | |
158 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_; | 142 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_; |
159 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> | |
160 data_reduction_proxy_io_data_; | |
161 std::unique_ptr<data_reduction_proxy::DataReductionProxyService> | |
162 data_reduction_proxy_service_; | |
163 std::unique_ptr<content::PermissionManager> permission_manager_; | 143 std::unique_ptr<content::PermissionManager> permission_manager_; |
164 | 144 |
165 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); | 145 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); |
166 }; | 146 }; |
167 | 147 |
168 } // namespace android_webview | 148 } // namespace android_webview |
169 | 149 |
170 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 150 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
OLD | NEW |