| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_IMPL_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "chrome/browser/profiles/profile_io_data.h" | 13 #include "chrome/browser/profiles/profile_io_data.h" |
| 14 | 14 |
| 15 namespace chrome_browser_net { |
| 16 class Predictor; |
| 17 } |
| 18 |
| 15 namespace net { | 19 namespace net { |
| 16 class HttpTransactionFactory; | 20 class HttpTransactionFactory; |
| 17 } // namespace net | 21 } // namespace net |
| 18 | 22 |
| 19 class ProfileImplIOData : public ProfileIOData { | 23 class ProfileImplIOData : public ProfileIOData { |
| 20 public: | 24 public: |
| 21 class Handle { | 25 class Handle { |
| 22 public: | 26 public: |
| 23 explicit Handle(Profile* profile); | 27 explicit Handle(Profile* profile); |
| 24 ~Handle(); | 28 ~Handle(); |
| 25 | 29 |
| 26 bool HasMainRequestContext() const { | 30 bool HasMainRequestContext() const { |
| 27 return main_request_context_getter_ != NULL; | 31 return main_request_context_getter_ != NULL; |
| 28 } | 32 } |
| 29 | 33 |
| 30 // Init() must be called before ~Handle(). It records all the necessary | 34 // Init() must be called before ~Handle(). It records all the necessary |
| 31 // parameters needed to construct a ChromeURLRequestContextGetter. | 35 // parameters needed to construct a ChromeURLRequestContextGetter. |
| 32 void Init(const FilePath& cookie_path, | 36 void Init(const FilePath& cookie_path, |
| 33 const FilePath& origin_bound_cert_path, | 37 const FilePath& origin_bound_cert_path, |
| 34 const FilePath& cache_path, | 38 const FilePath& cache_path, |
| 35 int cache_max_size, | 39 int cache_max_size, |
| 36 const FilePath& media_cache_path, | 40 const FilePath& media_cache_path, |
| 37 int media_cache_max_size, | 41 int media_cache_max_size, |
| 38 const FilePath& extensions_cookie_path, | 42 const FilePath& extensions_cookie_path, |
| 39 const FilePath& app_path); | 43 const FilePath& app_path, |
| 44 chrome_browser_net::Predictor* predictor, |
| 45 PrefService* local_state, |
| 46 IOThread* io_thread); |
| 40 | 47 |
| 41 base::Callback<ChromeURLDataManagerBackend*(void)> | 48 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 42 GetChromeURLDataManagerBackendGetter() const; | 49 GetChromeURLDataManagerBackendGetter() const; |
| 43 const content::ResourceContext& GetResourceContext() const; | 50 const content::ResourceContext& GetResourceContext() const; |
| 44 scoped_refptr<ChromeURLRequestContextGetter> | 51 scoped_refptr<ChromeURLRequestContextGetter> |
| 45 GetMainRequestContextGetter() const; | 52 GetMainRequestContextGetter() const; |
| 46 scoped_refptr<ChromeURLRequestContextGetter> | 53 scoped_refptr<ChromeURLRequestContextGetter> |
| 47 GetMediaRequestContextGetter() const; | 54 GetMediaRequestContextGetter() const; |
| 48 scoped_refptr<ChromeURLRequestContextGetter> | 55 scoped_refptr<ChromeURLRequestContextGetter> |
| 49 GetExtensionsRequestContextGetter() const; | 56 GetExtensionsRequestContextGetter() const; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 const std::string& app_id) const; | 127 const std::string& app_id) const; |
| 121 | 128 |
| 122 // Lazy initialization params. | 129 // Lazy initialization params. |
| 123 mutable scoped_ptr<LazyParams> lazy_params_; | 130 mutable scoped_ptr<LazyParams> lazy_params_; |
| 124 | 131 |
| 125 mutable scoped_refptr<ChromeURLRequestContext> media_request_context_; | 132 mutable scoped_refptr<ChromeURLRequestContext> media_request_context_; |
| 126 | 133 |
| 127 mutable scoped_ptr<net::HttpTransactionFactory> main_http_factory_; | 134 mutable scoped_ptr<net::HttpTransactionFactory> main_http_factory_; |
| 128 mutable scoped_ptr<net::HttpTransactionFactory> media_http_factory_; | 135 mutable scoped_ptr<net::HttpTransactionFactory> media_http_factory_; |
| 129 | 136 |
| 137 mutable scoped_ptr<chrome_browser_net::Predictor> predictor_; |
| 138 |
| 130 // Parameters needed for isolated apps. | 139 // Parameters needed for isolated apps. |
| 131 FilePath app_path_; | 140 FilePath app_path_; |
| 132 mutable bool clear_local_state_on_exit_; | 141 mutable bool clear_local_state_on_exit_; |
| 133 | 142 |
| 134 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); | 143 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); |
| 135 }; | 144 }; |
| 136 | 145 |
| 137 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ | 146 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
| OLD | NEW |