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

Unified Diff: chrome/browser/profiles/profile_io_data.h

Issue 575143003: Fix lifecycle of data reduction proxy objects in profile io data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_io_data.h
diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h
index ad9aaee78357fa4d56553e2705ad62ecee8cbbe2..81f588c30f074d80c64d90cf17fa4eecd9b9853b 100644
--- a/chrome/browser/profiles/profile_io_data.h
+++ b/chrome/browser/profiles/profile_io_data.h
@@ -19,9 +19,11 @@
#include "base/synchronization/lock.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/io_thread.h"
+#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/storage_partition_descriptor.h"
#include "components/content_settings/core/common/content_settings_types.h"
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_statistics_prefs.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/resource_context.h"
@@ -31,6 +33,10 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_job_factory.h"
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h"
+#endif // SPDY_PROXY_AUTH_ORIGIN
+
class ChromeHttpUserAgentSettings;
class ChromeNetworkDelegate;
class ChromeURLRequestContextGetter;
@@ -377,6 +383,76 @@ class ProfileIOData {
void set_channel_id_service(
net::ChannelIDService* channel_id_service) const;
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params()
+ const {
+ return data_reduction_proxy_params_.get();
+ }
+
+ void set_data_reduction_proxy_params(
+ scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
+ data_reduction_proxy_params) const {
+ data_reduction_proxy_params_ = data_reduction_proxy_params.Pass();
+ }
+
+ data_reduction_proxy::DataReductionProxyUsageStats*
+ data_reduction_proxy_usage_stats() const {
+ return data_reduction_proxy_usage_stats_.get();
+ }
+
+ void set_data_reduction_proxy_statistics_prefs(
+ scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>
+ data_reduction_proxy_statistics_prefs) {
+ data_reduction_proxy_statistics_prefs_ =
+ data_reduction_proxy_statistics_prefs.Pass();
+ }
+
+ data_reduction_proxy::DataReductionProxyStatisticsPrefs*
+ data_reduction_proxy_statistics_prefs() const {
+ return data_reduction_proxy_statistics_prefs_.get();
+ }
+
+ void set_data_reduction_proxy_usage_stats(
+ scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats>
+ data_reduction_proxy_usage_stats) const {
+ data_reduction_proxy_usage_stats_ =
+ data_reduction_proxy_usage_stats.Pass();
+ }
+
+ base::Callback<void(bool)> data_reduction_proxy_unavailable_callback() const {
+ return data_reduction_proxy_unavailable_callback_;
+ }
+
+ void set_data_reduction_proxy_unavailable_callback(
+ const base::Callback<void(bool)>& unavailable_callback) const {
+ data_reduction_proxy_unavailable_callback_ = unavailable_callback;
+ }
+
+ DataReductionProxyChromeConfigurator*
+ data_reduction_proxy_chrome_configurator() const {
+ return data_reduction_proxy_chrome_configurator_.get();
+ }
+
+ void set_data_reduction_proxy_chrome_configurator(
+ scoped_ptr<DataReductionProxyChromeConfigurator>
+ data_reduction_proxy_chrome_configurator) const {
+ data_reduction_proxy_chrome_configurator_ =
+ data_reduction_proxy_chrome_configurator.Pass();
+ }
+
+ data_reduction_proxy::DataReductionProxyAuthRequestHandler*
+ data_reduction_proxy_auth_request_handler() const {
+ return data_reduction_proxy_auth_request_handler_.get();
+ }
+
+ void set_data_reduction_proxy_auth_request_handler(
+ scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler>
+ data_reduction_proxy_auth_request_handler) const {
+ data_reduction_proxy_auth_request_handler_ =
+ data_reduction_proxy_auth_request_handler.Pass();
+ }
+#endif // defined(SPDY_PROXY_AUTH_ORIGIN)
+
ChromeNetworkDelegate* network_delegate() const {
return network_delegate_.get();
}
@@ -579,6 +655,25 @@ class ProfileIOData {
mutable scoped_refptr<extensions::InfoMap> extension_info_map_;
#endif
mutable scoped_ptr<net::ChannelIDService> channel_id_service_;
+
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ // data_reduction_proxy_* classes must be declared before |network_delegate_|.
+ // The data_reduction_proxy_* classes are passed in to |network_delegate_|,
+ // so this ordering ensures that the |network_delegate_| never references
+ // freed objects.
+ mutable scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
+ data_reduction_proxy_params_;
+ mutable scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats>
+ data_reduction_proxy_usage_stats_;
+ mutable scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>
+ data_reduction_proxy_statistics_prefs_;
+ mutable base::Callback<void(bool)> data_reduction_proxy_unavailable_callback_;
+ mutable scoped_ptr<DataReductionProxyChromeConfigurator>
+ data_reduction_proxy_chrome_configurator_;
+ mutable scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler>
+ data_reduction_proxy_auth_request_handler_;
+#endif // defined(SPDY_PROXY_AUTH_ORIGIN)
+
mutable scoped_ptr<ChromeNetworkDelegate> network_delegate_;
mutable scoped_ptr<net::FraudulentCertificateReporter>
fraudulent_certificate_reporter_;
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698