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/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 | 248 |
249 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() { | 249 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() { |
250 return DownloadServiceFactory::GetForProfile(this)-> | 250 return DownloadServiceFactory::GetForProfile(this)-> |
251 GetDownloadManagerDelegate(); | 251 GetDownloadManagerDelegate(); |
252 } | 252 } |
253 | 253 |
254 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { | 254 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { |
255 return io_data_.GetMainRequestContextGetter(); | 255 return io_data_.GetMainRequestContextGetter(); |
256 } | 256 } |
257 | 257 |
258 net::URLRequestContextGetter* OffTheRecordProfileImpl::CreateRequestContext( | |
mmenke
2012/12/20 16:55:06
Definition order should match the header (Same goe
| |
259 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
260 blob_protocol_handler, | |
261 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
262 file_system_protocol_handler, | |
263 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
264 developer_protocol_handler) { | |
265 return io_data_.CreateMainRequestContextGetter(blob_protocol_handler.Pass(), | |
266 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass()); | |
267 } | |
268 | |
258 net::URLRequestContextGetter* | 269 net::URLRequestContextGetter* |
259 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( | 270 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( |
260 int renderer_child_id) { | 271 int renderer_child_id) { |
261 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 272 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
262 renderer_child_id); | 273 renderer_child_id); |
263 return rph->GetStoragePartition()->GetURLRequestContext(); | 274 return rph->GetStoragePartition()->GetURLRequestContext(); |
264 } | 275 } |
265 | 276 |
266 net::URLRequestContextGetter* | 277 net::URLRequestContextGetter* |
267 OffTheRecordProfileImpl::GetMediaRequestContext() { | 278 OffTheRecordProfileImpl::GetMediaRequestContext() { |
268 // In OTR mode, media request context is the same as the original one. | 279 // In OTR mode, media request context is the same as the original one. |
269 return GetRequestContext(); | 280 return GetRequestContext(); |
270 } | 281 } |
271 | 282 |
272 net::URLRequestContextGetter* | 283 net::URLRequestContextGetter* |
273 OffTheRecordProfileImpl::GetMediaRequestContextForRenderProcess( | 284 OffTheRecordProfileImpl::GetMediaRequestContextForRenderProcess( |
274 int renderer_child_id) { | 285 int renderer_child_id) { |
275 // In OTR mode, media request context is the same as the original one. | 286 // In OTR mode, media request context is the same as the original one. |
276 return GetRequestContextForRenderProcess(renderer_child_id); | 287 return GetRequestContextForRenderProcess(renderer_child_id); |
277 } | 288 } |
278 | 289 |
279 net::URLRequestContextGetter* | 290 net::URLRequestContextGetter* |
280 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition( | 291 OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition( |
281 const FilePath& partition_path, | 292 const FilePath& partition_path, |
282 bool in_memory) { | 293 bool in_memory) { |
283 return GetRequestContextForStoragePartition(partition_path, in_memory); | 294 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory); |
284 } | 295 } |
285 | 296 |
286 net::URLRequestContextGetter* | 297 net::URLRequestContextGetter* |
287 OffTheRecordProfileImpl::GetRequestContextForExtensions() { | 298 OffTheRecordProfileImpl::GetRequestContextForExtensions() { |
288 return io_data_.GetExtensionsRequestContextGetter(); | 299 return io_data_.GetExtensionsRequestContextGetter(); |
289 } | 300 } |
290 | 301 |
291 net::URLRequestContextGetter* | 302 net::URLRequestContextGetter* |
292 OffTheRecordProfileImpl::GetRequestContextForStoragePartition( | 303 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( |
293 const FilePath& partition_path, | 304 const FilePath& partition_path, |
294 bool in_memory) { | 305 bool in_memory, |
295 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory); | 306 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
307 blob_protocol_handler, | |
308 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
309 file_system_protocol_handler, | |
310 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
311 developer_protocol_handler) { | |
312 return io_data_.CreateIsolatedAppRequestContextGetter( | |
313 partition_path, in_memory, blob_protocol_handler.Pass(), | |
314 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass()); | |
296 } | 315 } |
297 | 316 |
298 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { | 317 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { |
299 return io_data_.GetResourceContext(); | 318 return io_data_.GetResourceContext(); |
300 } | 319 } |
301 | 320 |
302 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { | 321 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { |
303 return profile_->GetSSLConfigService(); | 322 return profile_->GetSSLConfigService(); |
304 } | 323 } |
305 | 324 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
478 if (!profile) | 497 if (!profile) |
479 profile = new OffTheRecordProfileImpl(this); | 498 profile = new OffTheRecordProfileImpl(this); |
480 profile->Init(); | 499 profile->Init(); |
481 return profile; | 500 return profile; |
482 } | 501 } |
483 | 502 |
484 base::Callback<ChromeURLDataManagerBackend*(void)> | 503 base::Callback<ChromeURLDataManagerBackend*(void)> |
485 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 504 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
486 return io_data_.GetChromeURLDataManagerBackendGetter(); | 505 return io_data_.GetChromeURLDataManagerBackendGetter(); |
487 } | 506 } |
OLD | NEW |