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

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: Adding inits to DRPNetworkDelegate 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(
456 scoped_ptr<net::NetworkDelegate> network_delegate) const {
457 network_delegate_ = network_delegate.Pass();
458 }
459
460 net::NetworkDelegate* network_delegate() const {
mmenke 2014/12/03 18:50:38 Think we can get rid of this - can just grab it fr
megjablon 2014/12/04 01:23:46 Done.
455 return network_delegate_.get(); 461 return network_delegate_.get();
456 } 462 }
457 463
458 net::FraudulentCertificateReporter* fraudulent_certificate_reporter() const { 464 net::FraudulentCertificateReporter* fraudulent_certificate_reporter() const {
459 return fraudulent_certificate_reporter_.get(); 465 return fraudulent_certificate_reporter_.get();
460 } 466 }
461 467
462 net::ProxyService* proxy_service() const { 468 net::ProxyService* proxy_service() const {
463 return proxy_service_.get(); 469 return proxy_service_.get();
464 } 470 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 StoragePartitionDescriptorLess> 533 StoragePartitionDescriptorLess>
528 URLRequestContextMap; 534 URLRequestContextMap;
529 535
530 // -------------------------------------------- 536 // --------------------------------------------
531 // Virtual interface for subtypes to implement: 537 // Virtual interface for subtypes to implement:
532 // -------------------------------------------- 538 // --------------------------------------------
533 539
534 // Does the actual initialization of the ProfileIOData subtype. Subtypes 540 // Does the actual initialization of the ProfileIOData subtype. Subtypes
535 // should use the static helper functions above to implement this. 541 // should use the static helper functions above to implement this.
536 virtual void InitializeInternal( 542 virtual void InitializeInternal(
543 scoped_ptr<ChromeNetworkDelegate> chrome_network_delegate,
537 ProfileParams* profile_params, 544 ProfileParams* profile_params,
538 content::ProtocolHandlerMap* protocol_handlers, 545 content::ProtocolHandlerMap* protocol_handlers,
539 content::URLRequestInterceptorScopedVector 546 content::URLRequestInterceptorScopedVector
540 request_interceptors) const = 0; 547 request_interceptors) const = 0;
541 548
542 // Initializes the RequestContext for extensions. 549 // Initializes the RequestContext for extensions.
543 virtual void InitializeExtensionsRequestContext( 550 virtual void InitializeExtensionsRequestContext(
544 ProfileParams* profile_params) const = 0; 551 ProfileParams* profile_params) const = 0;
545 // Does an on-demand initialization of a RequestContext for the given 552 // Does an on-demand initialization of a RequestContext for the given
546 // isolated app. 553 // isolated app.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 662
656 // data_reduction_proxy_* classes must be declared before |network_delegate_|. 663 // data_reduction_proxy_* classes must be declared before |network_delegate_|.
657 // The data_reduction_proxy_* classes are passed in to |network_delegate_|, 664 // The data_reduction_proxy_* classes are passed in to |network_delegate_|,
658 // so this ordering ensures that the |network_delegate_| never references 665 // so this ordering ensures that the |network_delegate_| never references
659 // freed objects. 666 // freed objects.
660 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyParams> 667 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
661 data_reduction_proxy_params_; 668 data_reduction_proxy_params_;
662 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats> 669 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats>
663 data_reduction_proxy_usage_stats_; 670 data_reduction_proxy_usage_stats_;
664 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> 671 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>
665 data_reduction_proxy_statistics_prefs_; 672 data_reduction_proxy_statistics_prefs_;
666 mutable base::Callback<void(bool)> data_reduction_proxy_unavailable_callback_; 673 mutable base::Callback<void(bool)> data_reduction_proxy_unavailable_callback_;
667 mutable scoped_ptr<DataReductionProxyChromeConfigurator> 674 mutable scoped_ptr<DataReductionProxyChromeConfigurator>
668 data_reduction_proxy_chrome_configurator_; 675 data_reduction_proxy_chrome_configurator_;
669 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler> 676 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler>
670 data_reduction_proxy_auth_request_handler_; 677 data_reduction_proxy_auth_request_handler_;
671 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> 678 mutable scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore>
672 data_reduction_proxy_event_store_; 679 data_reduction_proxy_event_store_;
673 680
674 mutable scoped_ptr<ChromeNetworkDelegate> network_delegate_; 681 mutable scoped_ptr<net::NetworkDelegate> network_delegate_;
675 mutable scoped_ptr<net::FraudulentCertificateReporter> 682 mutable scoped_ptr<net::FraudulentCertificateReporter>
676 fraudulent_certificate_reporter_; 683 fraudulent_certificate_reporter_;
677 mutable scoped_ptr<net::ProxyService> proxy_service_; 684 mutable scoped_ptr<net::ProxyService> proxy_service_;
678 mutable scoped_ptr<net::TransportSecurityState> transport_security_state_; 685 mutable scoped_ptr<net::TransportSecurityState> transport_security_state_;
679 mutable scoped_ptr<net::HttpServerProperties> 686 mutable scoped_ptr<net::HttpServerProperties>
680 http_server_properties_; 687 http_server_properties_;
681 #if defined(OS_CHROMEOS) 688 #if defined(OS_CHROMEOS)
682 // Set to |cert_verifier_| if it references a PolicyCertVerifier. In that 689 // Set to |cert_verifier_| if it references a PolicyCertVerifier. In that
683 // case, the verifier is owned by |cert_verifier_|. Otherwise, set to NULL. 690 // case, the verifier is owned by |cert_verifier_|. Otherwise, set to NULL.
684 mutable policy::PolicyCertVerifier* policy_cert_verifier_; 691 mutable policy::PolicyCertVerifier* policy_cert_verifier_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 726
720 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 727 // TODO(jhawkins): Remove once crbug.com/102004 is fixed.
721 bool initialized_on_UI_thread_; 728 bool initialized_on_UI_thread_;
722 729
723 const Profile::ProfileType profile_type_; 730 const Profile::ProfileType profile_type_;
724 731
725 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 732 DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
726 }; 733 };
727 734
728 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 735 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698