OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 extension_info_map_ = map; | 185 extension_info_map_ = map; |
186 } | 186 } |
187 void set_net_log(net::NetLog* net_log) { | 187 void set_net_log(net::NetLog* net_log) { |
188 net_log_ = net_log; | 188 net_log_ = net_log; |
189 } | 189 } |
190 void set_network_delegate( | 190 void set_network_delegate( |
191 net::HttpNetworkDelegate* network_delegate) { | 191 net::HttpNetworkDelegate* network_delegate) { |
192 network_delegate_ = network_delegate; | 192 network_delegate_ = network_delegate; |
193 } | 193 } |
194 | 194 |
195 void set_clear_local_state_on_exit(bool clear_local_state) { | |
196 clear_local_state_on_exit_ = clear_local_state; | |
197 } | |
198 | |
195 // Callback for when the accept language changes. | 199 // Callback for when the accept language changes. |
196 void OnAcceptLanguageChange(const std::string& accept_language); | 200 void OnAcceptLanguageChange(const std::string& accept_language); |
197 | 201 |
198 // Callback for when the default charset changes. | 202 // Callback for when the default charset changes. |
199 void OnDefaultCharsetChange(const std::string& default_charset); | 203 void OnDefaultCharsetChange(const std::string& default_charset); |
200 | 204 |
205 // Clears the persistent store if need. | |
jochen (gone - plz use gerrit)
2010/12/02 08:45:50
needed
pastarmovj
2010/12/02 14:54:36
Done.
| |
206 void ClearLocalState(); | |
207 | |
201 protected: | 208 protected: |
202 // Path to the directory user scripts are stored in. | 209 // Path to the directory user scripts are stored in. |
203 FilePath user_script_dir_path_; | 210 FilePath user_script_dir_path_; |
204 | 211 |
205 scoped_refptr<ChromeAppCacheService> appcache_service_; | 212 scoped_refptr<ChromeAppCacheService> appcache_service_; |
206 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 213 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
207 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; | 214 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; |
208 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 215 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
209 scoped_refptr<HostZoomMap> host_zoom_map_; | 216 scoped_refptr<HostZoomMap> host_zoom_map_; |
210 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 217 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
211 scoped_refptr<BrowserFileSystemContext> browser_file_system_context_; | 218 scoped_refptr<BrowserFileSystemContext> browser_file_system_context_; |
212 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 219 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
213 | 220 |
214 bool is_media_; | 221 bool is_media_; |
215 bool is_off_the_record_; | 222 bool is_off_the_record_; |
223 bool clear_local_state_on_exit_; | |
Randy Smith (Not in Mondays)
2010/12/01 20:39:50
It didn't look to me as if you were initializing t
pastarmovj
2010/12/02 14:54:36
Done.
| |
216 | 224 |
217 private: | 225 private: |
218 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); | 226 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); |
219 }; | 227 }; |
220 | 228 |
221 // A URLRequestContextGetter subclass used by the browser. This returns a | 229 // A URLRequestContextGetter subclass used by the browser. This returns a |
222 // subclass of URLRequestContext which can be used to store extra information | 230 // subclass of URLRequestContext which can be used to store extra information |
223 // about requests. | 231 // about requests. |
224 // | 232 // |
225 // Most methods are expected to be called on the UI thread, except for | 233 // Most methods are expected to be called on the UI thread, except for |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 // context. This helper method is called from CreateOriginalForMedia and | 311 // context. This helper method is called from CreateOriginalForMedia and |
304 // CreateOffTheRecordForMedia. | 312 // CreateOffTheRecordForMedia. |
305 static ChromeURLRequestContextGetter* CreateRequestContextForMedia( | 313 static ChromeURLRequestContextGetter* CreateRequestContextForMedia( |
306 Profile* profile, const FilePath& disk_cache_path, int cache_size, | 314 Profile* profile, const FilePath& disk_cache_path, int cache_size, |
307 bool off_the_record); | 315 bool off_the_record); |
308 | 316 |
309 // These methods simply forward to the corresponding method on | 317 // These methods simply forward to the corresponding method on |
310 // ChromeURLRequestContext. | 318 // ChromeURLRequestContext. |
311 void OnAcceptLanguageChange(const std::string& accept_language); | 319 void OnAcceptLanguageChange(const std::string& accept_language); |
312 void OnDefaultCharsetChange(const std::string& default_charset); | 320 void OnDefaultCharsetChange(const std::string& default_charset); |
321 void OnClearSiteDataOnExitChange(bool clear_site_data); | |
jochen (gone - plz use gerrit)
2010/12/02 08:45:50
why not ClearLocalState and clear_local_state?
pastarmovj
2010/12/02 14:54:36
To keep the naming convention of the other two fun
| |
313 | 322 |
314 // Saves the cookie store to |result| and signals |completion|. | 323 // Saves the cookie store to |result| and signals |completion|. |
315 void GetCookieStoreAsyncHelper(base::WaitableEvent* completion, | 324 void GetCookieStoreAsyncHelper(base::WaitableEvent* completion, |
316 net::CookieStore** result); | 325 net::CookieStore** result); |
317 | 326 |
318 PrefChangeRegistrar registrar_; | 327 PrefChangeRegistrar registrar_; |
319 | 328 |
320 // |io_thread_| is always valid during the lifetime of |this| since |this| is | 329 // |io_thread_| is always valid during the lifetime of |this| since |this| is |
321 // deleted on the IO thread. | 330 // deleted on the IO thread. |
322 IOThread* const io_thread_; | 331 IOThread* const io_thread_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 | 364 |
356 // Assigns this factory's properties to |context|. | 365 // Assigns this factory's properties to |context|. |
357 void ApplyProfileParametersToContext(ChromeURLRequestContext* context); | 366 void ApplyProfileParametersToContext(ChromeURLRequestContext* context); |
358 | 367 |
359 // Values extracted from the Profile. | 368 // Values extracted from the Profile. |
360 // | 369 // |
361 // NOTE: If you add any parameters here, keep it in sync with | 370 // NOTE: If you add any parameters here, keep it in sync with |
362 // ApplyProfileParametersToContext(). | 371 // ApplyProfileParametersToContext(). |
363 bool is_media_; | 372 bool is_media_; |
364 bool is_off_the_record_; | 373 bool is_off_the_record_; |
374 bool clear_local_state_on_exit_; | |
365 std::string accept_language_; | 375 std::string accept_language_; |
366 std::string accept_charset_; | 376 std::string accept_charset_; |
367 std::string referrer_charset_; | 377 std::string referrer_charset_; |
368 | 378 |
369 // TODO(aa): I think this can go away now as we no longer support standalone | 379 // TODO(aa): I think this can go away now as we no longer support standalone |
370 // user scripts. | 380 // user scripts. |
371 FilePath user_script_dir_path_; | 381 FilePath user_script_dir_path_; |
372 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 382 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
373 scoped_refptr<ChromeAppCacheService> appcache_service_; | 383 scoped_refptr<ChromeAppCacheService> appcache_service_; |
374 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 384 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
375 scoped_refptr<HostZoomMap> host_zoom_map_; | 385 scoped_refptr<HostZoomMap> host_zoom_map_; |
376 scoped_refptr<net::TransportSecurityState> transport_security_state_; | 386 scoped_refptr<net::TransportSecurityState> transport_security_state_; |
377 scoped_refptr<net::SSLConfigService> ssl_config_service_; | 387 scoped_refptr<net::SSLConfigService> ssl_config_service_; |
378 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; | 388 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; |
379 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 389 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
380 scoped_refptr<BrowserFileSystemContext> browser_file_system_context_; | 390 scoped_refptr<BrowserFileSystemContext> browser_file_system_context_; |
381 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 391 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
382 | 392 |
383 FilePath profile_dir_path_; | 393 FilePath profile_dir_path_; |
384 | 394 |
385 private: | 395 private: |
386 IOThread* const io_thread_; | 396 IOThread* const io_thread_; |
387 | 397 |
388 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); | 398 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); |
389 }; | 399 }; |
390 | 400 |
391 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 401 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |