Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: chrome/browser/profiles/profile_io_data.h

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 BooleanPrefMember* signin_allowed() const { 174 BooleanPrefMember* signin_allowed() const {
173 return &signin_allowed_; 175 return &signin_allowed_;
174 } 176 }
175 177
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
184 void SetNetworkState(const std::string& client_id, bool offline) const;
185
182 net::TransportSecurityState* transport_security_state() const { 186 net::TransportSecurityState* transport_security_state() const {
183 return transport_security_state_.get(); 187 return transport_security_state_.get();
184 } 188 }
185 189
186 #if defined(OS_CHROMEOS) 190 #if defined(OS_CHROMEOS)
187 std::string username_hash() const { 191 std::string username_hash() const {
188 return username_hash_; 192 return username_hash_;
189 } 193 }
190 #endif 194 #endif
191 195
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 348
345 bool initialized() const { 349 bool initialized() const {
346 return initialized_; 350 return initialized_;
347 } 351 }
348 352
349 // Destroys the ResourceContext first, to cancel any URLRequests that are 353 // Destroys the ResourceContext first, to cancel any URLRequests that are
350 // using it still, before we destroy the member variables that those 354 // using it still, before we destroy the member variables that those
351 // URLRequests may be accessing. 355 // URLRequests may be accessing.
352 void DestroyResourceContext(); 356 void DestroyResourceContext();
353 357
354 // Fills in fields of params using values from main_request_context_ and the 358 // Creates network session and main network transaction factory.
355 // IOThread associated with profile_params. 359 scoped_ptr<net::HttpCache> CreateMainHttpFactory(
356 void PopulateNetworkSessionParams(
357 const ProfileParams* profile_params, 360 const ProfileParams* profile_params,
358 net::HttpNetworkSession::Params* params) const; 361 net::HttpCache::BackendFactory* main_backend) const;
362
363 // Creates network transaction factory.
364 scoped_ptr<net::HttpCache> CreateHttpFactory(
365 net::HttpNetworkSession* shared_session,
366 net::HttpCache::BackendFactory* backend) const;
359 367
360 void SetCookieSettingsForTesting(CookieSettings* cookie_settings); 368 void SetCookieSettingsForTesting(CookieSettings* cookie_settings);
361 369
362 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names); 370 void set_signin_names_for_testing(SigninNamesOnIOThread* signin_names);
363 371
364 private: 372 private:
365 class ResourceContext : public content::ResourceContext { 373 class ResourceContext : public content::ResourceContext {
366 public: 374 public:
367 explicit ResourceContext(ProfileIOData* io_data); 375 explicit ResourceContext(ProfileIOData* io_data);
368 virtual ~ResourceContext(); 376 virtual ~ResourceContext();
369 377
370 // ResourceContext implementation: 378 // ResourceContext implementation:
371 virtual net::HostResolver* GetHostResolver() OVERRIDE; 379 virtual net::HostResolver* GetHostResolver() OVERRIDE;
372 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; 380 virtual net::URLRequestContext* GetRequestContext() OVERRIDE;
373 virtual scoped_ptr<net::ClientCertStore> CreateClientCertStore() OVERRIDE; 381 virtual scoped_ptr<net::ClientCertStore> CreateClientCertStore() OVERRIDE;
374 virtual void CreateKeygenHandler( 382 virtual void CreateKeygenHandler(
375 uint32 key_size_in_bits, 383 uint32 key_size_in_bits,
376 const std::string& challenge_string, 384 const std::string& challenge_string,
377 const GURL& url, 385 const GURL& url,
378 const base::Callback<void(scoped_ptr<net::KeygenHandler>)>& callback) 386 const base::Callback<void(scoped_ptr<net::KeygenHandler>)>& callback)
379 OVERRIDE; 387 OVERRIDE;
380 virtual bool AllowMicAccess(const GURL& origin) OVERRIDE; 388 virtual bool AllowMicAccess(const GURL& origin) OVERRIDE;
381 virtual bool AllowCameraAccess(const GURL& origin) OVERRIDE; 389 virtual bool AllowCameraAccess(const GURL& origin) OVERRIDE;
382 virtual SaltCallback GetMediaDeviceIDSalt() OVERRIDE; 390 virtual SaltCallback GetMediaDeviceIDSalt() OVERRIDE;
391 virtual void SetNetworkState(
392 const std::string& client_id,
393 bool offline) OVERRIDE;
383 394
384 private: 395 private:
385 friend class ProfileIOData; 396 friend class ProfileIOData;
386 397
387 // Helper method that returns true if |type| is allowed for |origin|, false 398 // Helper method that returns true if |type| is allowed for |origin|, false
388 // otherwise. 399 // otherwise.
389 bool AllowContentAccess(const GURL& origin, ContentSettingsType type); 400 bool AllowContentAccess(const GURL& origin, ContentSettingsType type);
390 401
391 ProfileIOData* const io_data_; 402 ProfileIOData* const io_data_;
392 403
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 556
546 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; 557 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
547 558
548 mutable scoped_ptr<ChromeHttpUserAgentSettings> 559 mutable scoped_ptr<ChromeHttpUserAgentSettings>
549 chrome_http_user_agent_settings_; 560 chrome_http_user_agent_settings_;
550 561
551 #if defined(ENABLE_MANAGED_USERS) 562 #if defined(ENABLE_MANAGED_USERS)
552 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_; 563 mutable scoped_refptr<const ManagedModeURLFilter> managed_mode_url_filter_;
553 #endif 564 #endif
554 565
566 mutable scoped_ptr<DevToolsNetworkController> network_controller_;
567
555 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 568 // TODO(jhawkins): Remove once crbug.com/102004 is fixed.
556 bool initialized_on_UI_thread_; 569 bool initialized_on_UI_thread_;
557 570
558 const Profile::ProfileType profile_type_; 571 const Profile::ProfileType profile_type_;
559 572
560 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 573 DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
561 }; 574 };
562 575
563 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 576 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698