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 CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/prefs/pref_member.h" | 16 #include "base/prefs/pref_member.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
19 #include "chrome/browser/io_thread.h" | 19 #include "chrome/browser/io_thread.h" |
20 #include "chrome/browser/net/chrome_url_request_context.h" | 20 #include "chrome/browser/net/chrome_url_request_context.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 22 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
23 #include "chrome/common/content_settings_types.h" | 23 #include "chrome/common/content_settings_types.h" |
24 #include "content/public/browser/content_browser_client.h" | 24 #include "content/public/browser/content_browser_client.h" |
25 #include "content/public/browser/resource_context.h" | 25 #include "content/public/browser/resource_context.h" |
26 #include "net/cookies/cookie_monster.h" | 26 #include "net/cookies/cookie_monster.h" |
| 27 #include "net/http/http_cache.h" |
27 #include "net/http/http_network_session.h" | 28 #include "net/http/http_network_session.h" |
28 #include "net/url_request/url_request_job_factory.h" | 29 #include "net/url_request/url_request_job_factory.h" |
29 | 30 |
30 class ChromeHttpUserAgentSettings; | 31 class ChromeHttpUserAgentSettings; |
31 class ChromeNetworkDelegate; | 32 class ChromeNetworkDelegate; |
32 class CookieSettings; | 33 class CookieSettings; |
| 34 class DevToolsNetworkController; |
33 class HostContentSettingsMap; | 35 class HostContentSettingsMap; |
34 class ManagedModeURLFilter; | 36 class ManagedModeURLFilter; |
35 class MediaDeviceIDSalt; | 37 class MediaDeviceIDSalt; |
36 class ProtocolHandlerRegistry; | 38 class ProtocolHandlerRegistry; |
37 class SigninNamesOnIOThread; | 39 class SigninNamesOnIOThread; |
38 | 40 |
39 namespace extensions { | 41 namespace extensions { |
40 class InfoMap; | 42 class InfoMap; |
41 } | 43 } |
42 | 44 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 BooleanPrefMember* network_prediction_enabled() const { | 178 BooleanPrefMember* network_prediction_enabled() const { |
177 return &network_prediction_enabled_; | 179 return &network_prediction_enabled_; |
178 } | 180 } |
179 | 181 |
180 content::ResourceContext::SaltCallback GetMediaDeviceIDSalt() const; | 182 content::ResourceContext::SaltCallback GetMediaDeviceIDSalt() const; |
181 | 183 |
182 net::TransportSecurityState* transport_security_state() const { | 184 net::TransportSecurityState* transport_security_state() const { |
183 return transport_security_state_.get(); | 185 return transport_security_state_.get(); |
184 } | 186 } |
185 | 187 |
| 188 DevToolsNetworkController* network_controller() const { |
| 189 return network_controller_.get(); |
| 190 } |
| 191 |
186 #if defined(OS_CHROMEOS) | 192 #if defined(OS_CHROMEOS) |
187 std::string username_hash() const { | 193 std::string username_hash() const { |
188 return username_hash_; | 194 return username_hash_; |
189 } | 195 } |
190 #endif | 196 #endif |
191 | 197 |
192 Profile::ProfileType profile_type() const { | 198 Profile::ProfileType profile_type() const { |
193 return profile_type_; | 199 return profile_type_; |
194 } | 200 } |
195 | 201 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 350 |
345 bool initialized() const { | 351 bool initialized() const { |
346 return initialized_; | 352 return initialized_; |
347 } | 353 } |
348 | 354 |
349 // Destroys the ResourceContext first, to cancel any URLRequests that are | 355 // Destroys the ResourceContext first, to cancel any URLRequests that are |
350 // using it still, before we destroy the member variables that those | 356 // using it still, before we destroy the member variables that those |
351 // URLRequests may be accessing. | 357 // URLRequests may be accessing. |
352 void DestroyResourceContext(); | 358 void DestroyResourceContext(); |
353 | 359 |
354 // Fills in fields of params using values from main_request_context_ and the | 360 // Creates network session and main network transaction factory. |
355 // IOThread associated with profile_params. | 361 scoped_ptr<net::HttpCache> CreateMainHttpFactory( |
356 void PopulateNetworkSessionParams( | |
357 const ProfileParams* profile_params, | 362 const ProfileParams* profile_params, |
358 net::HttpNetworkSession::Params* params) const; | 363 net::HttpCache::BackendFactory* main_backend) const; |
| 364 |
| 365 // Creates network transaction factory. |
| 366 scoped_ptr<net::HttpCache> CreateHttpFactory( |
| 367 net::HttpNetworkSession* shared_session, |
| 368 net::HttpCache::BackendFactory* backend) const; |
359 | 369 |
360 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); | 370 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); |
361 | 371 |
362 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); | 372 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); |
363 | 373 |
364 private: | 374 private: |
365 class ResourceContext : public content::ResourceContext { | 375 class ResourceContext : public content::ResourceContext { |
366 public: | 376 public: |
367 explicit ResourceContext(ProfileIOData* io_data); | 377 explicit ResourceContext(ProfileIOData* io_data); |
368 virtual ~ResourceContext(); | 378 virtual ~ResourceContext(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 | 555 |
546 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 556 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
547 | 557 |
548 mutable scoped_ptr<ChromeHttpUserAgentSettings> | 558 mutable scoped_ptr<ChromeHttpUserAgentSettings> |
549 chrome_http_user_agent_settings_; | 559 chrome_http_user_agent_settings_; |
550 | 560 |
551 #if defined(ENABLE_MANAGED_USERS) | 561 #if defined(ENABLE_MANAGED_USERS) |
552 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; | 562 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; |
553 #endif | 563 #endif |
554 | 564 |
| 565 mutable scoped_ptr<DevToolsNetworkController> network_controller_; |
| 566 |
555 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 567 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
556 bool initialized_on_UI_thread_; | 568 bool initialized_on_UI_thread_; |
557 | 569 |
558 const Profile::ProfileType profile_type_; | 570 const Profile::ProfileType profile_type_; |
559 | 571 |
560 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 572 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
561 }; | 573 }; |
562 | 574 |
563 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 575 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |