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

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

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing test and addressing mmenke comments Created 6 years 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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/prefs/pref_member.h" 18 #include "base/prefs/pref_member.h"
19 #include "base/synchronization/lock.h" 19 #include "base/synchronization/lock.h"
20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
21 #include "chrome/browser/io_thread.h" 21 #include "chrome/browser/io_thread.h"
22 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h" 22 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
23 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/profiles/storage_partition_descriptor.h" 24 #include "chrome/browser/profiles/storage_partition_descriptor.h"
25 #include "components/content_settings/core/common/content_settings_types.h" 25 #include "components/content_settings/core/common/content_settings_types.h"
26 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h" 26 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h"
27 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h"
27 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h" 28 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h"
28 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag e_stats.h" 29 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag e_stats.h"
29 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h" 30 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h"
30 #include "content/public/browser/content_browser_client.h" 31 #include "content/public/browser/content_browser_client.h"
31 #include "content/public/browser/resource_context.h" 32 #include "content/public/browser/resource_context.h"
32 #include "net/cookies/cookie_monster.h" 33 #include "net/cookies/cookie_monster.h"
33 #include "net/http/http_cache.h" 34 #include "net/http/http_cache.h"
34 #include "net/http/http_network_session.h" 35 #include "net/http/http_network_session.h"
35 #include "net/url_request/url_request_context.h" 36 #include "net/url_request/url_request_context.h"
36 #include "net/url_request/url_request_job_factory.h" 37 #include "net/url_request/url_request_job_factory.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 return data_reduction_proxy_event_store_.get(); 445 return data_reduction_proxy_event_store_.get();
445 } 446 }
446 447
447 void set_data_reduction_proxy_event_store( 448 void set_data_reduction_proxy_event_store(
448 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> 449 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore>
449 data_reduction_proxy_event_store) const { 450 data_reduction_proxy_event_store) const {
450 data_reduction_proxy_event_store_ = 451 data_reduction_proxy_event_store_ =
451 data_reduction_proxy_event_store.Pass(); 452 data_reduction_proxy_event_store.Pass();
452 } 453 }
453 454
454 ChromeNetworkDelegate* network_delegate() const { 455 void set_network_delegate(
455 return network_delegate_.get(); 456 scoped_ptr<net::NetworkDelegate> network_delegate) const {
457 network_delegate_ = network_delegate.Pass();
456 } 458 }
457 459
458 net::FraudulentCertificateReporter* fraudulent_certificate_reporter() const { 460 net::FraudulentCertificateReporter* fraudulent_certificate_reporter() const {
459 return fraudulent_certificate_reporter_.get(); 461 return fraudulent_certificate_reporter_.get();
460 } 462 }
461 463
462 net::ProxyService* proxy_service() const { 464 net::ProxyService* proxy_service() const {
463 return proxy_service_.get(); 465 return proxy_service_.get();
464 } 466 }
465 467
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 StoragePartitionDescriptorLess> 529 StoragePartitionDescriptorLess>
528 URLRequestContextMap; 530 URLRequestContextMap;
529 531
530 // -------------------------------------------- 532 // --------------------------------------------
531 // Virtual interface for subtypes to implement: 533 // Virtual interface for subtypes to implement:
532 // -------------------------------------------- 534 // --------------------------------------------
533 535
534 // Does the actual initialization of the ProfileIOData subtype. Subtypes 536 // Does the actual initialization of the ProfileIOData subtype. Subtypes
535 // should use the static helper functions above to implement this. 537 // should use the static helper functions above to implement this.
536 virtual void InitializeInternal( 538 virtual void InitializeInternal(
539 scoped_ptr<ChromeNetworkDelegate> chrome_network_delegate,
537 ProfileParams* profile_params, 540 ProfileParams* profile_params,
538 content::ProtocolHandlerMap* protocol_handlers, 541 content::ProtocolHandlerMap* protocol_handlers,
539 content::URLRequestInterceptorScopedVector 542 content::URLRequestInterceptorScopedVector
540 request_interceptors) const = 0; 543 request_interceptors) const = 0;
541 544
542 // Initializes the RequestContext for extensions. 545 // Initializes the RequestContext for extensions.
543 virtual void InitializeExtensionsRequestContext( 546 virtual void InitializeExtensionsRequestContext(
544 ProfileParams* profile_params) const = 0; 547 ProfileParams* profile_params) const = 0;
545 // Does an on-demand initialization of a RequestContext for the given 548 // Does an on-demand initialization of a RequestContext for the given
546 // isolated app. 549 // isolated app.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 658
656 // data_reduction_proxy_* classes must be declared before |network_delegate_|. 659 // data_reduction_proxy_* classes must be declared before |network_delegate_|.
657 // The data_reduction_proxy_* classes are passed in to |network_delegate_|, 660 // The data_reduction_proxy_* classes are passed in to |network_delegate_|,
658 // so this ordering ensures that the |network_delegate_| never references 661 // so this ordering ensures that the |network_delegate_| never references
659 // freed objects. 662 // freed objects.
660 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyParams> 663 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
661 data_reduction_proxy_params_; 664 data_reduction_proxy_params_;
662 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats> 665 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats>
663 data_reduction_proxy_usage_stats_; 666 data_reduction_proxy_usage_stats_;
664 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> 667 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>
665 data_reduction_proxy_statistics_prefs_; 668 data_reduction_proxy_statistics_prefs_;
666 mutable base::Callback<void(bool)> data_reduction_proxy_unavailable_callback_; 669 mutable base::Callback<void(bool)> data_reduction_proxy_unavailable_callback_;
667 mutable scoped_ptr<DataReductionProxyChromeConfigurator> 670 mutable scoped_ptr<DataReductionProxyChromeConfigurator>
668 data_reduction_proxy_chrome_configurator_; 671 data_reduction_proxy_chrome_configurator_;
669 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler> 672 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler>
670 data_reduction_proxy_auth_request_handler_; 673 data_reduction_proxy_auth_request_handler_;
671 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> 674 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore>
672 data_reduction_proxy_event_store_; 675 data_reduction_proxy_event_store_;
673 676
674 mutable scoped_ptr<ChromeNetworkDelegate> network_delegate_; 677 mutable scoped_ptr<net::NetworkDelegate> network_delegate_;
675 mutable scoped_ptr<net::FraudulentCertificateReporter> 678 mutable scoped_ptr<net::FraudulentCertificateReporter>
676 fraudulent_certificate_reporter_; 679 fraudulent_certificate_reporter_;
677 mutable scoped_ptr<net::ProxyService> proxy_service_; 680 mutable scoped_ptr<net::ProxyService> proxy_service_;
678 mutable scoped_ptr<net::TransportSecurityState> transport_security_state_; 681 mutable scoped_ptr<net::TransportSecurityState> transport_security_state_;
679 mutable scoped_ptr<net::HttpServerProperties> 682 mutable scoped_ptr<net::HttpServerProperties>
680 http_server_properties_; 683 http_server_properties_;
681 #if defined(OS_CHROMEOS) 684 #if defined(OS_CHROMEOS)
682 // Set to |cert_verifier_| if it references a PolicyCertVerifier. In that 685 // Set to |cert_verifier_| if it references a PolicyCertVerifier. In that
683 // case, the verifier is owned by |cert_verifier_|. Otherwise, set to NULL. 686 // case, the verifier is owned by |cert_verifier_|. Otherwise, set to NULL.
684 mutable policy::PolicyCertVerifier* policy_cert_verifier_; 687 mutable policy::PolicyCertVerifier* policy_cert_verifier_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 722
720 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 723 // TODO(jhawkins): Remove once crbug.com/102004 is fixed.
721 bool initialized_on_UI_thread_; 724 bool initialized_on_UI_thread_;
722 725
723 const Profile::ProfileType profile_type_; 726 const Profile::ProfileType profile_type_;
724 727
725 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 728 DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
726 }; 729 };
727 730
728 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 731 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698