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

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

Issue 2300213002: Adding an IO Data and keyed service to previews/ (Closed)
Patch Set: thestig comments Created 4 years, 3 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class TransportSecurityState; 88 class TransportSecurityState;
89 class URLRequestJobFactoryImpl; 89 class URLRequestJobFactoryImpl;
90 } // namespace net 90 } // namespace net
91 91
92 namespace policy { 92 namespace policy {
93 class PolicyCertVerifier; 93 class PolicyCertVerifier;
94 class PolicyHeaderIOHelper; 94 class PolicyHeaderIOHelper;
95 class URLBlacklistManager; 95 class URLBlacklistManager;
96 } // namespace policy 96 } // namespace policy
97 97
98 namespace previews {
99 class PreviewsIOData;
100 }
101
98 // Conceptually speaking, the ProfileIOData represents data that lives on the IO 102 // Conceptually speaking, the ProfileIOData represents data that lives on the IO
99 // thread that is owned by a Profile, such as, but not limited to, network 103 // thread that is owned by a Profile, such as, but not limited to, network
100 // objects like CookieMonster, HttpTransactionFactory, etc. Profile owns 104 // objects like CookieMonster, HttpTransactionFactory, etc. Profile owns
101 // ProfileIOData, but will make sure to delete it on the IO thread (except 105 // ProfileIOData, but will make sure to delete it on the IO thread (except
102 // possibly in unit tests where there is no IO thread). 106 // possibly in unit tests where there is no IO thread).
103 class ProfileIOData { 107 class ProfileIOData {
104 public: 108 public:
105 typedef std::vector<scoped_refptr<ChromeURLRequestContextGetter>> 109 typedef std::vector<scoped_refptr<ChromeURLRequestContextGetter>>
106 ChromeURLRequestContextGetterVector; 110 ChromeURLRequestContextGetterVector;
107 111
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 client_cert_store_factory_ = factory; 250 client_cert_store_factory_ = factory;
247 } 251 }
248 252
249 bool IsDataReductionProxyEnabled() const; 253 bool IsDataReductionProxyEnabled() const;
250 254
251 data_reduction_proxy::DataReductionProxyIOData* 255 data_reduction_proxy::DataReductionProxyIOData*
252 data_reduction_proxy_io_data() const { 256 data_reduction_proxy_io_data() const {
253 return data_reduction_proxy_io_data_.get(); 257 return data_reduction_proxy_io_data_.get();
254 } 258 }
255 259
260 previews::PreviewsIOData* previews_io_data() const {
261 return previews_io_data_.get();
262 }
263
256 // This function is to be used to check if the |url| is defined in 264 // This function is to be used to check if the |url| is defined in
257 // blacklist or whitelist policy. 265 // blacklist or whitelist policy.
258 virtual policy::URLBlacklist::URLBlacklistState GetURLBlacklistState( 266 virtual policy::URLBlacklist::URLBlacklistState GetURLBlacklistState(
259 const GURL& url) const; 267 const GURL& url) const;
260 268
261 // Returns the predictor service for this Profile. Returns nullptr if there is 269 // Returns the predictor service for this Profile. Returns nullptr if there is
262 // no Predictor, as is the case with OffTheRecord profiles. 270 // no Predictor, as is the case with OffTheRecord profiles.
263 virtual chrome_browser_net::Predictor* GetPredictor(); 271 virtual chrome_browser_net::Predictor* GetPredictor();
264 272
265 // Get platform ClientCertStore. May return nullptr. 273 // Get platform ClientCertStore. May return nullptr.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // ProfileIOData, and the derived class calls this method to set the 390 // ProfileIOData, and the derived class calls this method to set the
383 // channel_id_service_ member and transfers ownership to the base 391 // channel_id_service_ member and transfers ownership to the base
384 // class. 392 // class.
385 void set_channel_id_service( 393 void set_channel_id_service(
386 net::ChannelIDService* channel_id_service) const; 394 net::ChannelIDService* channel_id_service) const;
387 395
388 void set_data_reduction_proxy_io_data( 396 void set_data_reduction_proxy_io_data(
389 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> 397 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
390 data_reduction_proxy_io_data) const; 398 data_reduction_proxy_io_data) const;
391 399
400 void set_previews_io_data(
401 std::unique_ptr<previews::PreviewsIOData> previews_io_data) const;
402
392 net::ProxyService* proxy_service() const { 403 net::ProxyService* proxy_service() const {
393 return proxy_service_.get(); 404 return proxy_service_.get();
394 } 405 }
395 406
396 net::HttpServerProperties* http_server_properties() const; 407 net::HttpServerProperties* http_server_properties() const;
397 408
398 void set_http_server_properties( 409 void set_http_server_properties(
399 std::unique_ptr<net::HttpServerProperties> http_server_properties) const; 410 std::unique_ptr<net::HttpServerProperties> http_server_properties) const;
400 411
401 net::URLRequestContext* main_request_context() const { 412 net::URLRequestContext* main_request_context() const {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 570
560 // Pointed to by URLRequestContext. 571 // Pointed to by URLRequestContext.
561 #if defined(ENABLE_EXTENSIONS) 572 #if defined(ENABLE_EXTENSIONS)
562 mutable scoped_refptr<extensions::InfoMap> extension_info_map_; 573 mutable scoped_refptr<extensions::InfoMap> extension_info_map_;
563 #endif 574 #endif
564 mutable std::unique_ptr<net::ChannelIDService> channel_id_service_; 575 mutable std::unique_ptr<net::ChannelIDService> channel_id_service_;
565 576
566 mutable std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> 577 mutable std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
567 data_reduction_proxy_io_data_; 578 data_reduction_proxy_io_data_;
568 579
580 mutable std::unique_ptr<previews::PreviewsIOData> previews_io_data_;
581
569 mutable std::unique_ptr<net::ProxyService> proxy_service_; 582 mutable std::unique_ptr<net::ProxyService> proxy_service_;
570 mutable std::unique_ptr<net::TransportSecurityState> 583 mutable std::unique_ptr<net::TransportSecurityState>
571 transport_security_state_; 584 transport_security_state_;
572 mutable std::unique_ptr<net::CTVerifier> cert_transparency_verifier_; 585 mutable std::unique_ptr<net::CTVerifier> cert_transparency_verifier_;
573 mutable std::unique_ptr<ChromeExpectCTReporter> expect_ct_reporter_; 586 mutable std::unique_ptr<ChromeExpectCTReporter> expect_ct_reporter_;
574 mutable std::unique_ptr<net::HttpServerProperties> http_server_properties_; 587 mutable std::unique_ptr<net::HttpServerProperties> http_server_properties_;
575 #if defined(OS_CHROMEOS) 588 #if defined(OS_CHROMEOS)
576 // Set to |cert_verifier_| if it references a PolicyCertVerifier. In that 589 // Set to |cert_verifier_| if it references a PolicyCertVerifier. In that
577 // case, the verifier is owned by |cert_verifier_|. Otherwise, set to NULL. 590 // case, the verifier is owned by |cert_verifier_|. Otherwise, set to NULL.
578 mutable std::unique_ptr<net::CertVerifier> cert_verifier_; 591 mutable std::unique_ptr<net::CertVerifier> cert_verifier_;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 mutable std::unique_ptr<certificate_transparency::TreeStateTracker> 638 mutable std::unique_ptr<certificate_transparency::TreeStateTracker>
626 ct_tree_tracker_; 639 ct_tree_tracker_;
627 mutable base::Closure ct_tree_tracker_unregistration_; 640 mutable base::Closure ct_tree_tracker_unregistration_;
628 641
629 const Profile::ProfileType profile_type_; 642 const Profile::ProfileType profile_type_;
630 643
631 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 644 DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
632 }; 645 };
633 646
634 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 647 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698