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

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

Issue 2934153002: Add virtual ProfileIOData methods related to URLRequestContext creation. (Closed)
Patch Set: . Created 3 years, 6 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
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 namespace extensions { 70 namespace extensions {
71 class ExtensionThrottleManager; 71 class ExtensionThrottleManager;
72 class InfoMap; 72 class InfoMap;
73 } 73 }
74 74
75 namespace net { 75 namespace net {
76 class CertVerifier; 76 class CertVerifier;
77 class ChannelIDService; 77 class ChannelIDService;
78 class ClientCertStore; 78 class ClientCertStore;
79 class CookieStore; 79 class CookieStore;
80 class HttpServerProperties;
80 class HttpTransactionFactory; 81 class HttpTransactionFactory;
81 class ProxyConfigService; 82 class ProxyConfigService;
82 class ReportingService; 83 class ReportingService;
83 class ReportSender; 84 class ReportSender;
84 class SSLConfigService; 85 class SSLConfigService;
85 class TransportSecurityPersister; 86 class TransportSecurityPersister;
86 class URLRequestContextStorage; 87 class URLRequestContextStorage;
87 class URLRequestJobFactoryImpl; 88 class URLRequestJobFactoryImpl;
88 } // namespace net 89 } // namespace net
89 90
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 404
404 // Creates network transaction factory. The created factory will share 405 // Creates network transaction factory. The created factory will share
405 // HttpNetworkSession with |main_http_factory|. 406 // HttpNetworkSession with |main_http_factory|.
406 std::unique_ptr<net::HttpCache> CreateHttpFactory( 407 std::unique_ptr<net::HttpCache> CreateHttpFactory(
407 net::HttpTransactionFactory* main_http_factory, 408 net::HttpTransactionFactory* main_http_factory,
408 std::unique_ptr<net::HttpCache::BackendFactory> backend) const; 409 std::unique_ptr<net::HttpCache::BackendFactory> backend) const;
409 410
410 void SetCookieSettingsForTesting( 411 void SetCookieSettingsForTesting(
411 content_settings::CookieSettings* cookie_settings); 412 content_settings::CookieSettings* cookie_settings);
412 413
414 protected:
415 // May only be called during construction of the main URLRequestContext. Once
416 // InitializeInternal() has been called, may no longer be called.
417 ProfileParams* profile_params() const { return profile_params_.get(); }
418
413 private: 419 private:
414 class ResourceContext : public content::ResourceContext { 420 class ResourceContext : public content::ResourceContext {
415 public: 421 public:
416 explicit ResourceContext(ProfileIOData* io_data); 422 explicit ResourceContext(ProfileIOData* io_data);
417 ~ResourceContext() override; 423 ~ResourceContext() override;
418 424
419 // ResourceContext implementation: 425 // ResourceContext implementation:
420 net::HostResolver* GetHostResolver() override; 426 net::HostResolver* GetHostResolver() override;
421 net::URLRequestContext* GetRequestContext() override; 427 net::URLRequestContext* GetRequestContext() override;
422 428
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 std::unique_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 490 std::unique_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
485 protocol_handler_interceptor, 491 protocol_handler_interceptor,
486 content::ProtocolHandlerMap* protocol_handlers, 492 content::ProtocolHandlerMap* protocol_handlers,
487 content::URLRequestInterceptorScopedVector request_interceptors) 493 content::URLRequestInterceptorScopedVector request_interceptors)
488 const = 0; 494 const = 0;
489 virtual net::URLRequestContext* 495 virtual net::URLRequestContext*
490 AcquireIsolatedMediaRequestContext( 496 AcquireIsolatedMediaRequestContext(
491 net::URLRequestContext* app_context, 497 net::URLRequestContext* app_context,
492 const StoragePartitionDescriptor& partition_descriptor) const = 0; 498 const StoragePartitionDescriptor& partition_descriptor) const = 0;
493 499
500 // Methods used to allow subclasses to manage certain components of the main
501 // URLRequestContext.
502
503 // By default, returns an in-memory HttpServicerProperties object.
504 virtual std::unique_ptr<net::HttpServerProperties> GetHttpServerProperties()
505 const;
506
507 // Gets the cookie store and channel ID service. One method is used to get
508 // them both because they're closely intertwined, and a pair of them must
509 // always be used together. By default, creates two in-memory stores. The
510 // caller will invoke SetChannelIDServiceID on the CookieStore, so implemented
511 // don't need to do that.
512 virtual void GetCookieAndChannelIDStores(
513 std::unique_ptr<net::CookieStore>* cookie_store,
514 std::unique_ptr<net::ChannelIDService>* channel_id_service) const;
515
516 // Returns true if the URLRequestContext should use a shared NetworkQuality es timator, and false if it should use none at all. Defaults to false.
517 //
518 // TODO(mmenke): should we just hook this up to all URLRequestContexts?
519 virtual bool UseNetworkQualityEstimator() const;
520
521 // Gets the backend factory for the HttpCache. By default, returns a factory for an in-memory cache.
522 virtual std::unique_ptr<net::HttpCache::BackendFactory> GetCacheBackendFactory () const;
523
494 // The order *DOES* matter for the majority of these member variables, so 524 // The order *DOES* matter for the majority of these member variables, so
495 // don't move them around unless you know what you're doing! 525 // don't move them around unless you know what you're doing!
496 // General rules: 526 // General rules:
497 // * ResourceContext references the URLRequestContexts, so 527 // * ResourceContext references the URLRequestContexts, so
498 // URLRequestContexts must outlive ResourceContext, hence ResourceContext 528 // URLRequestContexts must outlive ResourceContext, hence ResourceContext
499 // should be destroyed first. 529 // should be destroyed first.
500 // * URLRequestContexts reference a whole bunch of members, so 530 // * URLRequestContexts reference a whole bunch of members, so
501 // URLRequestContext needs to be destroyed before them. 531 // URLRequestContext needs to be destroyed before them.
502 // * Therefore, ResourceContext should be listed last, and then the 532 // * Therefore, ResourceContext should be listed last, and then the
503 // URLRequestContexts, and then the URLRequestContext members. 533 // URLRequestContexts, and then the URLRequestContext members.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 mutable std::unique_ptr<certificate_transparency::TreeStateTracker> 634 mutable std::unique_ptr<certificate_transparency::TreeStateTracker>
605 ct_tree_tracker_; 635 ct_tree_tracker_;
606 mutable base::Closure ct_tree_tracker_unregistration_; 636 mutable base::Closure ct_tree_tracker_unregistration_;
607 637
608 const Profile::ProfileType profile_type_; 638 const Profile::ProfileType profile_type_;
609 639
610 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 640 DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
611 }; 641 };
612 642
613 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 643 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698