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/devtools/devtools_network_controller.h" |
19 #include "chrome/browser/io_thread.h" | 20 #include "chrome/browser/io_thread.h" |
20 #include "chrome/browser/net/chrome_url_request_context.h" | 21 #include "chrome/browser/net/chrome_url_request_context.h" |
21 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 22 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
22 #include "chrome/common/content_settings_types.h" | 23 #include "chrome/common/content_settings_types.h" |
23 #include "content/public/browser/content_browser_client.h" | 24 #include "content/public/browser/content_browser_client.h" |
24 #include "content/public/browser/resource_context.h" | 25 #include "content/public/browser/resource_context.h" |
25 #include "net/cookies/cookie_monster.h" | 26 #include "net/cookies/cookie_monster.h" |
| 27 #include "net/http/http_cache.h" |
26 #include "net/http/http_network_session.h" | 28 #include "net/http/http_network_session.h" |
27 #include "net/url_request/url_request_job_factory.h" | 29 #include "net/url_request/url_request_job_factory.h" |
28 | 30 |
29 class ChromeHttpUserAgentSettings; | 31 class ChromeHttpUserAgentSettings; |
30 class ChromeNetworkDelegate; | 32 class ChromeNetworkDelegate; |
31 class CookieSettings; | 33 class CookieSettings; |
32 class HostContentSettingsMap; | 34 class HostContentSettingsMap; |
33 class ManagedModeURLFilter; | 35 class ManagedModeURLFilter; |
34 class MediaDeviceIDSalt; | 36 class MediaDeviceIDSalt; |
35 class Profile; | 37 class Profile; |
(...skipping 140 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* devtools_network_controller() const { |
| 189 return devtools_network_controller_; |
| 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 bool is_incognito() const { | 198 bool is_incognito() const { |
193 return is_incognito_; | 199 return is_incognito_; |
194 } | 200 } |
195 | 201 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 348 |
343 bool initialized() const { | 349 bool initialized() const { |
344 return initialized_; | 350 return initialized_; |
345 } | 351 } |
346 | 352 |
347 // Destroys the ResourceContext first, to cancel any URLRequests that are | 353 // Destroys the ResourceContext first, to cancel any URLRequests that are |
348 // using it still, before we destroy the member variables that those | 354 // using it still, before we destroy the member variables that those |
349 // URLRequests may be accessing. | 355 // URLRequests may be accessing. |
350 void DestroyResourceContext(); | 356 void DestroyResourceContext(); |
351 | 357 |
352 // Fills in fields of params using values from main_request_context_ and the | 358 // Creates network session and network transaction factory. |
353 // IOThread associated with profile_params. | 359 net::HttpCache* CreateMainHttpFactory( |
354 void PopulateNetworkSessionParams( | |
355 const ProfileParams* profile_params, | 360 const ProfileParams* profile_params, |
356 net::HttpNetworkSession::Params* params) const; | 361 net::HttpCache::BackendFactory* main_backend) const; |
357 | 362 |
358 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); | 363 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); |
359 | 364 |
360 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); | 365 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); |
361 | 366 |
362 private: | 367 private: |
363 class ResourceContext : public content::ResourceContext { | 368 class ResourceContext : public content::ResourceContext { |
364 public: | 369 public: |
365 explicit ResourceContext(ProfileIOData* io_data); | 370 explicit ResourceContext(ProfileIOData* io_data); |
366 virtual ~ResourceContext(); | 371 virtual ~ResourceContext(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 | 548 |
544 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 549 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
545 | 550 |
546 mutable scoped_ptr<ChromeHttpUserAgentSettings> | 551 mutable scoped_ptr<ChromeHttpUserAgentSettings> |
547 chrome_http_user_agent_settings_; | 552 chrome_http_user_agent_settings_; |
548 | 553 |
549 #if defined(ENABLE_MANAGED_USERS) | 554 #if defined(ENABLE_MANAGED_USERS) |
550 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; | 555 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; |
551 #endif | 556 #endif |
552 | 557 |
| 558 mutable DevToolsNetworkController* devtools_network_controller_; |
| 559 |
553 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 560 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
554 bool initialized_on_UI_thread_; | 561 bool initialized_on_UI_thread_; |
555 | 562 |
556 bool is_incognito_; | 563 bool is_incognito_; |
557 | 564 |
558 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 565 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
559 }; | 566 }; |
560 | 567 |
561 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 568 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |