OLD | NEW |
---|---|
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 #include "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 profile_, io_data_); | 204 profile_, io_data_); |
205 } | 205 } |
206 return extensions_request_context_getter_; | 206 return extensions_request_context_getter_; |
207 } | 207 } |
208 | 208 |
209 scoped_refptr<ChromeURLRequestContextGetter> | 209 scoped_refptr<ChromeURLRequestContextGetter> |
210 ProfileImplIOData::Handle::GetIsolatedAppRequestContextGetter( | 210 ProfileImplIOData::Handle::GetIsolatedAppRequestContextGetter( |
211 const FilePath& partition_path, | 211 const FilePath& partition_path, |
212 bool in_memory) const { | 212 bool in_memory) const { |
213 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 213 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
214 // TODO(nasko): Check that the partition_path is not the same as the | 214 CHECK(partition_path != profile_->GetPath()); |
215 // base profile path. We expect isolated partition, which will never go | |
216 // to the default profile path. | |
Charlie Reis
2012/11/06 00:17:18
Please keep this comment (minus the TODO).
nasko
2012/11/06 01:21:52
Done.
| |
217 LazyInitialize(); | 215 LazyInitialize(); |
218 | 216 |
219 // Keep a map of request context getters, one per requested storage partition. | 217 // Keep a map of request context getters, one per requested storage partition. |
220 StoragePartitionDescriptor descriptor(partition_path, in_memory); | 218 StoragePartitionDescriptor descriptor(partition_path, in_memory); |
221 ChromeURLRequestContextGetterMap::iterator iter = | 219 ChromeURLRequestContextGetterMap::iterator iter = |
222 app_request_context_getter_map_.find(descriptor); | 220 app_request_context_getter_map_.find(descriptor); |
223 if (iter != app_request_context_getter_map_.end()) | 221 if (iter != app_request_context_getter_map_.end()) |
224 return iter->second; | 222 return iter->second; |
225 | 223 |
226 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 224 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
227 protocol_handler_interceptor( | 225 protocol_handler_interceptor( |
228 ProtocolHandlerRegistryFactory::GetForProfile(profile_)-> | 226 ProtocolHandlerRegistryFactory::GetForProfile(profile_)-> |
229 CreateURLInterceptor()); | 227 CreateURLInterceptor()); |
230 ChromeURLRequestContextGetter* context = | 228 ChromeURLRequestContextGetter* context = |
231 ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp( | 229 ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp( |
232 profile_, io_data_, descriptor, | 230 profile_, io_data_, descriptor, |
233 protocol_handler_interceptor.Pass()); | 231 protocol_handler_interceptor.Pass()); |
234 app_request_context_getter_map_[descriptor] = context; | 232 app_request_context_getter_map_[descriptor] = context; |
235 | 233 |
236 return context; | 234 return context; |
237 } | 235 } |
238 | 236 |
239 scoped_refptr<ChromeURLRequestContextGetter> | 237 scoped_refptr<ChromeURLRequestContextGetter> |
240 ProfileImplIOData::Handle::GetIsolatedMediaRequestContextGetter( | 238 ProfileImplIOData::Handle::GetIsolatedMediaRequestContextGetter( |
241 const FilePath& partition_path, | 239 const FilePath& partition_path, |
242 bool in_memory) const { | 240 bool in_memory) const { |
243 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 241 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
244 // We must have a non-default path, or this will act like the default media | 242 // We must have a non-default path, or this will act like the default media |
245 // context. | 243 // context. |
246 // | 244 CHECK(partition_path != profile_->GetPath()); |
247 // TODO(nasko): Check that the partition_path is not the same as the | |
248 // base profile path. We expect isolated partition, which will never go | |
249 // to the default profile path. | |
Charlie Reis
2012/11/06 00:17:18
Same.
nasko
2012/11/06 01:21:52
Isn't the existing comment already doing similar j
| |
250 LazyInitialize(); | 245 LazyInitialize(); |
251 | 246 |
252 // Keep a map of request context getters, one per requested storage partition. | 247 // Keep a map of request context getters, one per requested storage partition. |
253 StoragePartitionDescriptor descriptor(partition_path, in_memory); | 248 StoragePartitionDescriptor descriptor(partition_path, in_memory); |
254 ChromeURLRequestContextGetterMap::iterator iter = | 249 ChromeURLRequestContextGetterMap::iterator iter = |
255 isolated_media_request_context_getter_map_.find(descriptor); | 250 isolated_media_request_context_getter_map_.find(descriptor); |
256 if (iter != isolated_media_request_context_getter_map_.end()) | 251 if (iter != isolated_media_request_context_getter_map_.end()) |
257 return iter->second; | 252 return iter->second; |
258 | 253 |
259 // Get the app context as the starting point for the media context, so that | 254 // Get the app context as the starting point for the media context, so that |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
679 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 674 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
680 base::Time time) { | 675 base::Time time) { |
681 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 676 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
682 LazyInitialize(); | 677 LazyInitialize(); |
683 | 678 |
684 DCHECK(transport_security_state()); | 679 DCHECK(transport_security_state()); |
685 transport_security_state()->DeleteSince(time); | 680 transport_security_state()->DeleteSince(time); |
686 DCHECK(http_server_properties_manager()); | 681 DCHECK(http_server_properties_manager()); |
687 http_server_properties_manager()->Clear(); | 682 http_server_properties_manager()->Clear(); |
688 } | 683 } |
OLD | NEW |