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

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

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed macro and InMemory. Created 8 years, 2 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 | Annotate | Revision Log
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_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 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // safely be used during initialization. 59 // safely be used during initialization.
60 content::ResourceContext* GetResourceContextNoInit() const; 60 content::ResourceContext* GetResourceContextNoInit() const;
61 scoped_refptr<ChromeURLRequestContextGetter> 61 scoped_refptr<ChromeURLRequestContextGetter>
62 GetMainRequestContextGetter() const; 62 GetMainRequestContextGetter() const;
63 scoped_refptr<ChromeURLRequestContextGetter> 63 scoped_refptr<ChromeURLRequestContextGetter>
64 GetMediaRequestContextGetter() const; 64 GetMediaRequestContextGetter() const;
65 scoped_refptr<ChromeURLRequestContextGetter> 65 scoped_refptr<ChromeURLRequestContextGetter>
66 GetExtensionsRequestContextGetter() const; 66 GetExtensionsRequestContextGetter() const;
67 scoped_refptr<ChromeURLRequestContextGetter> 67 scoped_refptr<ChromeURLRequestContextGetter>
68 GetIsolatedAppRequestContextGetter( 68 GetIsolatedAppRequestContextGetter(
69 const std::string& app_id) const; 69 const FilePath& partition_path,
70 bool in_memory) const;
70 scoped_refptr<ChromeURLRequestContextGetter> 71 scoped_refptr<ChromeURLRequestContextGetter>
71 GetIsolatedMediaRequestContextGetter( 72 GetIsolatedMediaRequestContextGetter(
72 const std::string& app_id) const; 73 const FilePath& partition_path,
74 bool in_memory) const;
73 75
74 void ClearNetworkingHistorySince(base::Time time); 76 void ClearNetworkingHistorySince(base::Time time);
75 77
76 private: 78 private:
77 typedef base::hash_map<std::string, 79 #if defined(COMPILER_MSVC)
78 scoped_refptr<ChromeURLRequestContextGetter> > 80 typedef BASE_HASH_NAMESPACE::hash_map<
79 ChromeURLRequestContextGetterMap; 81 StoragePartitionDescriptor, scoped_refptr<ChromeURLRequestContextGetter>,
82 BASE_HASH_NAMESPACE::hash_compare<StoragePartitionDescriptor,
83 StoragePartitionDescriptorLess> >
84 #elif defined(COMPILER_GCC)
85 typedef BASE_HASH_NAMESPACE::hash_map< \
86 StoragePartitionDescriptor, scoped_refptr<ChromeURLRequestContextGetter>,
87 BASE_HASH_NAMESPACE::hash<StoragePartitionDescriptor>,
88 StoragePartitionDescriptorEq>
89 #endif
90 ChromeURLRequestContextGetterMap;
80 91
81 // Lazily initialize ProfileParams. We do this on the calls to 92 // Lazily initialize ProfileParams. We do this on the calls to
82 // Get*RequestContextGetter(), so we only initialize ProfileParams right 93 // Get*RequestContextGetter(), so we only initialize ProfileParams right
83 // before posting a task to the IO thread to start using them. This prevents 94 // before posting a task to the IO thread to start using them. This prevents
84 // objects that are supposed to be deleted on the IO thread, but are created 95 // objects that are supposed to be deleted on the IO thread, but are created
85 // on the UI thread from being unnecessarily initialized. 96 // on the UI thread from being unnecessarily initialized.
86 void LazyInitialize() const; 97 void LazyInitialize() const;
87 98
88 // Ordering is important here. Do not reorder unless you know what you're 99 // Ordering is important here. Do not reorder unless you know what you're
89 // doing. We need to release |io_data_| *before* the getters, because we 100 // doing. We need to release |io_data_| *before* the getters, because we
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 typedef base::hash_map<std::string, net::HttpTransactionFactory* > 143 typedef base::hash_map<std::string, net::HttpTransactionFactory* >
133 HttpTransactionFactoryMap; 144 HttpTransactionFactoryMap;
134 145
135 ProfileImplIOData(); 146 ProfileImplIOData();
136 virtual ~ProfileImplIOData(); 147 virtual ~ProfileImplIOData();
137 148
138 virtual void LazyInitializeInternal( 149 virtual void LazyInitializeInternal(
139 ProfileParams* profile_params) const OVERRIDE; 150 ProfileParams* profile_params) const OVERRIDE;
140 virtual ChromeURLRequestContext* InitializeAppRequestContext( 151 virtual ChromeURLRequestContext* InitializeAppRequestContext(
141 ChromeURLRequestContext* main_context, 152 ChromeURLRequestContext* main_context,
142 const std::string& app_id, 153 const StoragePartitionDescriptor& partition_descriptor,
143 scoped_ptr<net::URLRequestJobFactory::Interceptor> 154 scoped_ptr<net::URLRequestJobFactory::Interceptor>
144 protocol_handler_interceptor) const OVERRIDE; 155 protocol_handler_interceptor) const OVERRIDE;
145 virtual ChromeURLRequestContext* InitializeMediaRequestContext( 156 virtual ChromeURLRequestContext* InitializeMediaRequestContext(
146 ChromeURLRequestContext* original_context, 157 ChromeURLRequestContext* original_context,
147 const std::string& app_id) const OVERRIDE; 158 const StoragePartitionDescriptor& partition_descriptor) const OVERRIDE;
148 virtual ChromeURLRequestContext* 159 virtual ChromeURLRequestContext*
149 AcquireMediaRequestContext() const OVERRIDE; 160 AcquireMediaRequestContext() const OVERRIDE;
150 virtual ChromeURLRequestContext* 161 virtual ChromeURLRequestContext*
151 AcquireIsolatedAppRequestContext( 162 AcquireIsolatedAppRequestContext(
152 ChromeURLRequestContext* main_context, 163 ChromeURLRequestContext* main_context,
153 const std::string& app_id, 164 const StoragePartitionDescriptor& partition_descriptor,
154 scoped_ptr<net::URLRequestJobFactory::Interceptor> 165 scoped_ptr<net::URLRequestJobFactory::Interceptor>
155 protocol_handler_interceptor) const OVERRIDE; 166 protocol_handler_interceptor) const OVERRIDE;
156 virtual ChromeURLRequestContext* 167 virtual ChromeURLRequestContext*
157 AcquireIsolatedMediaRequestContext( 168 AcquireIsolatedMediaRequestContext(
158 ChromeURLRequestContext* app_context, 169 ChromeURLRequestContext* app_context,
159 const std::string& app_id) const OVERRIDE; 170 const StoragePartitionDescriptor& partition_descriptor)
171 const OVERRIDE;
160 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( 172 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats(
161 IOThread::Globals* io_thread_globals) const OVERRIDE; 173 IOThread::Globals* io_thread_globals) const OVERRIDE;
162 174
163 void SetUpJobFactory(net::URLRequestJobFactory* job_factory, 175 void SetUpJobFactory(net::URLRequestJobFactory* job_factory,
164 scoped_ptr<net::URLRequestJobFactory::Interceptor> 176 scoped_ptr<net::URLRequestJobFactory::Interceptor>
165 protocol_handler_interceptor, 177 protocol_handler_interceptor,
166 net::NetworkDelegate* network_delegate, 178 net::NetworkDelegate* network_delegate,
167 net::FtpTransactionFactory* ftp_transaction_factory, 179 net::FtpTransactionFactory* ftp_transaction_factory,
168 net::FtpAuthCache* ftp_auth_cache) const; 180 net::FtpAuthCache* ftp_auth_cache) const;
169 181
(...skipping 15 matching lines...) Expand all
185 197
186 // Parameters needed for isolated apps. 198 // Parameters needed for isolated apps.
187 FilePath profile_path_; 199 FilePath profile_path_;
188 int app_cache_max_size_; 200 int app_cache_max_size_;
189 int app_media_cache_max_size_; 201 int app_media_cache_max_size_;
190 202
191 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); 203 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData);
192 }; 204 };
193 205
194 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ 206 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698