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

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

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed code review comments by asvitkine@. Created 6 years, 5 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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "base/prefs/pref_member.h" 17 #include "base/prefs/pref_member.h"
18 #include "base/synchronization/lock.h" 18 #include "base/synchronization/lock.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
20 #include "chrome/browser/io_thread.h" 20 #include "chrome/browser/io_thread.h"
21 #include "chrome/browser/net/chrome_url_request_context.h" 21 #include "chrome/browser/net/chrome_url_request_context.h"
22 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/profiles/storage_partition_descriptor.h" 23 #include "chrome/browser/profiles/storage_partition_descriptor.h"
24 #include "chrome/common/content_settings_types.h" 24 #include "chrome/common/content_settings_types.h"
25 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
25 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta ts.h" 26 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta ts.h"
26 #include "content/public/browser/content_browser_client.h" 27 #include "content/public/browser/content_browser_client.h"
27 #include "content/public/browser/resource_context.h" 28 #include "content/public/browser/resource_context.h"
28 #include "net/cookies/cookie_monster.h" 29 #include "net/cookies/cookie_monster.h"
29 #include "net/http/http_cache.h" 30 #include "net/http/http_cache.h"
30 #include "net/http/http_network_session.h" 31 #include "net/http/http_network_session.h"
31 #include "net/url_request/url_request_job_factory.h" 32 #include "net/url_request/url_request_job_factory.h"
32 33
33 class ChromeHttpUserAgentSettings; 34 class ChromeHttpUserAgentSettings;
34 class ChromeNetworkDelegate; 35 class ChromeNetworkDelegate;
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 prerender::PrerenderTracker* prerender_tracker; 335 prerender::PrerenderTracker* prerender_tracker;
335 }; 336 };
336 337
337 explicit ProfileIOData(Profile::ProfileType profile_type); 338 explicit ProfileIOData(Profile::ProfileType profile_type);
338 339
339 static std::string GetSSLSessionCacheShard(); 340 static std::string GetSSLSessionCacheShard();
340 341
341 void InitializeOnUIThread(Profile* profile); 342 void InitializeOnUIThread(Profile* profile);
342 void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const; 343 void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const;
343 344
344 #if defined(OS_ANDROID) 345 // Setup data reduction proxy for the given |profile| with |params| and
345 #if defined(SPDY_PROXY_AUTH_ORIGIN) 346 // |usage_stats| from |IOThread::Globals| on |IOThread|.
346 void SetDataReductionProxyUsageStatsOnIOThread(IOThread* io_thread, 347 void SetupDataReductionProxyOnIOThread(IOThread* io_thread,
347 Profile* profile); 348 Profile* profile);
348 void SetDataReductionProxyUsageStatsOnUIThread(Profile* profile, 349
350 // Setup data reduction proxy for the given |profile|, |params|, and
351 // |usage_stats| on |UIThread|.
352 void SetupDataReductionProxyOnUIThread(Profile* profile,
353 data_reduction_proxy::DataReductionProxyParams* params,
349 data_reduction_proxy::DataReductionProxyUsageStats* usage_stats); 354 data_reduction_proxy::DataReductionProxyUsageStats* usage_stats);
350 #endif
351 #endif
352 355
353 scoped_ptr<net::URLRequestJobFactory> SetUpJobFactoryDefaults( 356 scoped_ptr<net::URLRequestJobFactory> SetUpJobFactoryDefaults(
354 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, 357 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory,
355 content::URLRequestInterceptorScopedVector request_interceptors, 358 content::URLRequestInterceptorScopedVector request_interceptors,
356 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 359 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
357 protocol_handler_interceptor, 360 protocol_handler_interceptor,
358 net::NetworkDelegate* network_delegate, 361 net::NetworkDelegate* network_delegate,
359 net::FtpTransactionFactory* ftp_transaction_factory) const; 362 net::FtpTransactionFactory* ftp_transaction_factory) const;
360 363
361 // Called when the profile is destroyed. 364 // Called when the profile is destroyed.
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 619
617 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 620 // TODO(jhawkins): Remove once crbug.com/102004 is fixed.
618 bool initialized_on_UI_thread_; 621 bool initialized_on_UI_thread_;
619 622
620 const Profile::ProfileType profile_type_; 623 const Profile::ProfileType profile_type_;
621 624
622 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 625 DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
623 }; 626 };
624 627
625 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 628 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698