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" |
26 #include "net/http/http_network_session.h" | 27 #include "net/http/http_network_session.h" |
27 #include "net/url_request/url_request_job_factory.h" | 28 #include "net/url_request/url_request_job_factory.h" |
28 | 29 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 BooleanPrefMember* network_prediction_enabled() const { | 175 BooleanPrefMember* network_prediction_enabled() const { |
175 return &network_prediction_enabled_; | 176 return &network_prediction_enabled_; |
176 } | 177 } |
177 | 178 |
178 content::ResourceContext::SaltCallback GetMediaDeviceIDSalt() const; | 179 content::ResourceContext::SaltCallback GetMediaDeviceIDSalt() const; |
179 | 180 |
180 net::TransportSecurityState* transport_security_state() const { | 181 net::TransportSecurityState* transport_security_state() const { |
181 return transport_security_state_.get(); | 182 return transport_security_state_.get(); |
182 } | 183 } |
183 | 184 |
185 DevToolsNetworkController* devtools_network_controller() const { | |
186 return devtools_network_controller_.get(); | |
187 } | |
mmenke
2014/03/07 19:38:08
How's this going to be used?
eustas
2014/03/11 12:06:42
This will be used to communicate with controller f
| |
188 | |
184 #if defined(OS_CHROMEOS) | 189 #if defined(OS_CHROMEOS) |
185 std::string username_hash() const { | 190 std::string username_hash() const { |
186 return username_hash_; | 191 return username_hash_; |
187 } | 192 } |
188 #endif | 193 #endif |
189 | 194 |
190 bool is_incognito() const { | 195 bool is_incognito() const { |
191 return is_incognito_; | 196 return is_incognito_; |
192 } | 197 } |
193 | 198 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
339 | 344 |
340 bool initialized() const { | 345 bool initialized() const { |
341 return initialized_; | 346 return initialized_; |
342 } | 347 } |
343 | 348 |
344 // Destroys the ResourceContext first, to cancel any URLRequests that are | 349 // Destroys the ResourceContext first, to cancel any URLRequests that are |
345 // using it still, before we destroy the member variables that those | 350 // using it still, before we destroy the member variables that those |
346 // URLRequests may be accessing. | 351 // URLRequests may be accessing. |
347 void DestroyResourceContext(); | 352 void DestroyResourceContext(); |
348 | 353 |
349 // Fills in fields of params using values from main_request_context_ and the | 354 // Creates network session and network transaction factory. |
350 // IOThread associated with profile_params. | 355 void InitializeNetworkTransactionFactory( |
351 void PopulateNetworkSessionParams( | 356 const ProfileParams* profile_params) const; |
352 const ProfileParams* profile_params, | 357 |
353 net::HttpNetworkSession::Params* params) const; | 358 net::HttpTransactionFactory* network_transaction_factory() const { |
mmenke
2014/03/07 19:38:08
Who's going to need access to this?
eustas
2014/03/11 12:06:42
this is protected method, so it is used by profile
| |
359 return static_cast<net::HttpTransactionFactory*>( | |
360 devtools_network_controller_.get()); | |
mmenke
2014/03/07 19:38:08
static cast not needed, if DevtoolsNetworkControll
eustas
2014/03/11 12:06:42
This method was added to encapsulate the nature of
| |
361 } | |
354 | 362 |
355 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); | 363 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); |
356 | 364 |
357 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); | 365 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); |
358 | 366 |
359 private: | 367 private: |
360 class ResourceContext : public content::ResourceContext { | 368 class ResourceContext : public content::ResourceContext { |
361 public: | 369 public: |
362 explicit ResourceContext(ProfileIOData* io_data); | 370 explicit ResourceContext(ProfileIOData* io_data); |
363 virtual ~ResourceContext(); | 371 virtual ~ResourceContext(); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
538 | 546 |
539 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 547 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
540 | 548 |
541 mutable scoped_ptr<ChromeHttpUserAgentSettings> | 549 mutable scoped_ptr<ChromeHttpUserAgentSettings> |
542 chrome_http_user_agent_settings_; | 550 chrome_http_user_agent_settings_; |
543 | 551 |
544 #if defined(ENABLE_MANAGED_USERS) | 552 #if defined(ENABLE_MANAGED_USERS) |
545 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; | 553 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; |
546 #endif | 554 #endif |
547 | 555 |
556 mutable scoped_ptr<DevToolsNetworkController> devtools_network_controller_; | |
mmenke
2014/03/07 19:38:08
The HttpCache will take ownership of the HttpTrans
eustas
2014/03/11 12:06:42
Oops, didn't notice.
Fixed.
| |
557 | |
548 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 558 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
549 bool initialized_on_UI_thread_; | 559 bool initialized_on_UI_thread_; |
550 | 560 |
551 bool is_incognito_; | 561 bool is_incognito_; |
552 | 562 |
553 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 563 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
554 }; | 564 }; |
555 | 565 |
556 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 566 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |