| 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/hash_tables.h" | 11 #include "base/hash_tables.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "chrome/browser/profiles/profile_io_data.h" | 13 #include "chrome/browser/profiles/profile_io_data.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 class HttpTransactionFactory; | 16 class HttpTransactionFactory; |
| 16 } // namespace net | 17 } // namespace net |
| 17 | 18 |
| 18 class ProfileImplIOData : public ProfileIOData { | 19 class ProfileImplIOData : public ProfileIOData { |
| 19 public: | 20 public: |
| 20 class Handle { | 21 class Handle { |
| 21 public: | 22 public: |
| 22 explicit Handle(Profile* profile); | 23 explicit Handle(Profile* profile); |
| 23 ~Handle(); | 24 ~Handle(); |
| 24 | 25 |
| 25 bool HasMainRequestContext() const { | 26 bool HasMainRequestContext() const { |
| 26 return main_request_context_getter_ != NULL; | 27 return main_request_context_getter_ != NULL; |
| 27 } | 28 } |
| 28 | 29 |
| 29 // Init() must be called before ~Handle(). It records all the necessary | 30 // Init() must be called before ~Handle(). It records all the necessary |
| 30 // parameters needed to construct a ChromeURLRequestContextGetter. | 31 // parameters needed to construct a ChromeURLRequestContextGetter. |
| 31 void Init(const FilePath& cookie_path, | 32 void Init(const FilePath& cookie_path, |
| 32 const FilePath& cache_path, | 33 const FilePath& cache_path, |
| 33 int cache_max_size, | 34 int cache_max_size, |
| 34 const FilePath& media_cache_path, | 35 const FilePath& media_cache_path, |
| 35 int media_cache_max_size, | 36 int media_cache_max_size, |
| 36 const FilePath& extensions_cookie_path, | 37 const FilePath& extensions_cookie_path, |
| 37 const FilePath& app_path); | 38 const FilePath& app_path); |
| 38 | 39 |
| 40 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 41 GetChromeURLDataManagerBackendGetter() const; |
| 39 const content::ResourceContext& GetResourceContext() const; | 42 const content::ResourceContext& GetResourceContext() const; |
| 40 scoped_refptr<ChromeURLRequestContextGetter> | 43 scoped_refptr<ChromeURLRequestContextGetter> |
| 41 GetMainRequestContextGetter() const; | 44 GetMainRequestContextGetter() const; |
| 42 scoped_refptr<ChromeURLRequestContextGetter> | 45 scoped_refptr<ChromeURLRequestContextGetter> |
| 43 GetMediaRequestContextGetter() const; | 46 GetMediaRequestContextGetter() const; |
| 44 scoped_refptr<ChromeURLRequestContextGetter> | 47 scoped_refptr<ChromeURLRequestContextGetter> |
| 45 GetExtensionsRequestContextGetter() const; | 48 GetExtensionsRequestContextGetter() const; |
| 46 scoped_refptr<ChromeURLRequestContextGetter> | 49 scoped_refptr<ChromeURLRequestContextGetter> |
| 47 GetIsolatedAppRequestContextGetter( | 50 GetIsolatedAppRequestContextGetter( |
| 48 const std::string& app_id) const; | 51 const std::string& app_id) const; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 65 // thread. The getters will be deleted on the IO thread, so they will | 68 // thread. The getters will be deleted on the IO thread, so they will |
| 66 // release their refs to their contexts, which will release the last refs to | 69 // release their refs to their contexts, which will release the last refs to |
| 67 // the ProfileIOData on the IO thread. | 70 // the ProfileIOData on the IO thread. |
| 68 mutable scoped_refptr<ChromeURLRequestContextGetter> | 71 mutable scoped_refptr<ChromeURLRequestContextGetter> |
| 69 main_request_context_getter_; | 72 main_request_context_getter_; |
| 70 mutable scoped_refptr<ChromeURLRequestContextGetter> | 73 mutable scoped_refptr<ChromeURLRequestContextGetter> |
| 71 media_request_context_getter_; | 74 media_request_context_getter_; |
| 72 mutable scoped_refptr<ChromeURLRequestContextGetter> | 75 mutable scoped_refptr<ChromeURLRequestContextGetter> |
| 73 extensions_request_context_getter_; | 76 extensions_request_context_getter_; |
| 74 mutable ChromeURLRequestContextGetterMap app_request_context_getter_map_; | 77 mutable ChromeURLRequestContextGetterMap app_request_context_getter_map_; |
| 75 const scoped_refptr<ProfileImplIOData> io_data_; | 78 scoped_refptr<ProfileImplIOData> io_data_; |
| 76 | 79 |
| 77 Profile* const profile_; | 80 Profile* const profile_; |
| 78 | 81 |
| 79 mutable bool initialized_; | 82 mutable bool initialized_; |
| 80 | 83 |
| 81 DISALLOW_COPY_AND_ASSIGN(Handle); | 84 DISALLOW_COPY_AND_ASSIGN(Handle); |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 private: | 87 private: |
| 85 friend class base::RefCountedThreadSafe<ProfileImplIOData>; | 88 friend class base::RefCountedThreadSafe<ProfileImplIOData>; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 mutable scoped_ptr<net::HttpTransactionFactory> media_http_factory_; | 126 mutable scoped_ptr<net::HttpTransactionFactory> media_http_factory_; |
| 124 | 127 |
| 125 // Parameters needed for isolated apps. | 128 // Parameters needed for isolated apps. |
| 126 FilePath app_path_; | 129 FilePath app_path_; |
| 127 mutable bool clear_local_state_on_exit_; | 130 mutable bool clear_local_state_on_exit_; |
| 128 | 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); | 132 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ | 135 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
| OLD | NEW |