| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 ProfileImplIOData::Handle::GetResourceContextNoInit() const { | 121 ProfileImplIOData::Handle::GetResourceContextNoInit() const { |
| 122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 123 // Don't call LazyInitialize here, since the resource context is created at | 123 // Don't call LazyInitialize here, since the resource context is created at |
| 124 // the beginning of initalization and is used by some members while they're | 124 // the beginning of initalization and is used by some members while they're |
| 125 // being initialized (i.e. AppCacheService). | 125 // being initialized (i.e. AppCacheService). |
| 126 return io_data_->GetResourceContext(); | 126 return io_data_->GetResourceContext(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 scoped_refptr<ChromeURLRequestContextGetter> | 129 scoped_refptr<ChromeURLRequestContextGetter> |
| 130 ProfileImplIOData::Handle::CreateMainRequestContextGetter( | 130 ProfileImplIOData::Handle::CreateMainRequestContextGetter( |
| 131 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 131 content::ProtocolHandlerMap* protocol_handlers, |
| 132 blob_protocol_handler, | |
| 133 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 134 file_system_protocol_handler, | |
| 135 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 136 developer_protocol_handler, | |
| 137 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 138 chrome_protocol_handler, | |
| 139 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 140 chrome_devtools_protocol_handler, | |
| 141 PrefService* local_state, | 132 PrefService* local_state, |
| 142 IOThread* io_thread) const { | 133 IOThread* io_thread) const { |
| 143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 144 LazyInitialize(); | 135 LazyInitialize(); |
| 145 DCHECK(!main_request_context_getter_); | 136 DCHECK(!main_request_context_getter_); |
| 146 main_request_context_getter_ = ChromeURLRequestContextGetter::CreateOriginal( | 137 main_request_context_getter_ = ChromeURLRequestContextGetter::CreateOriginal( |
| 147 profile_, io_data_, blob_protocol_handler.Pass(), | 138 profile_, io_data_, protocol_handlers); |
| 148 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass(), | |
| 149 chrome_protocol_handler.Pass(), chrome_devtools_protocol_handler.Pass()); | |
| 150 | 139 |
| 151 io_data_->predictor_->InitNetworkPredictor(profile_->GetPrefs(), | 140 io_data_->predictor_->InitNetworkPredictor(profile_->GetPrefs(), |
| 152 local_state, | 141 local_state, |
| 153 io_thread, | 142 io_thread, |
| 154 main_request_context_getter_); | 143 main_request_context_getter_); |
| 155 | 144 |
| 156 content::NotificationService::current()->Notify( | 145 content::NotificationService::current()->Notify( |
| 157 chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED, | 146 chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED, |
| 158 content::Source<Profile>(profile_), | 147 content::Source<Profile>(profile_), |
| 159 content::NotificationService::NoDetails()); | 148 content::NotificationService::NoDetails()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 181 ChromeURLRequestContextGetter::CreateOriginalForExtensions( | 170 ChromeURLRequestContextGetter::CreateOriginalForExtensions( |
| 182 profile_, io_data_); | 171 profile_, io_data_); |
| 183 } | 172 } |
| 184 return extensions_request_context_getter_; | 173 return extensions_request_context_getter_; |
| 185 } | 174 } |
| 186 | 175 |
| 187 scoped_refptr<ChromeURLRequestContextGetter> | 176 scoped_refptr<ChromeURLRequestContextGetter> |
| 188 ProfileImplIOData::Handle::CreateIsolatedAppRequestContextGetter( | 177 ProfileImplIOData::Handle::CreateIsolatedAppRequestContextGetter( |
| 189 const base::FilePath& partition_path, | 178 const base::FilePath& partition_path, |
| 190 bool in_memory, | 179 bool in_memory, |
| 191 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 180 content::ProtocolHandlerMap* protocol_handlers) const { |
| 192 blob_protocol_handler, | |
| 193 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 194 file_system_protocol_handler, | |
| 195 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 196 developer_protocol_handler, | |
| 197 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 198 chrome_protocol_handler, | |
| 199 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 200 chrome_devtools_protocol_handler) const { | |
| 201 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 181 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 202 // Check that the partition_path is not the same as the base profile path. We | 182 // Check that the partition_path is not the same as the base profile path. We |
| 203 // expect isolated partition, which will never go to the default profile path. | 183 // expect isolated partition, which will never go to the default profile path. |
| 204 CHECK(partition_path != profile_->GetPath()); | 184 CHECK(partition_path != profile_->GetPath()); |
| 205 LazyInitialize(); | 185 LazyInitialize(); |
| 206 | 186 |
| 207 // Keep a map of request context getters, one per requested storage partition. | 187 // Keep a map of request context getters, one per requested storage partition. |
| 208 StoragePartitionDescriptor descriptor(partition_path, in_memory); | 188 StoragePartitionDescriptor descriptor(partition_path, in_memory); |
| 209 ChromeURLRequestContextGetterMap::iterator iter = | 189 ChromeURLRequestContextGetterMap::iterator iter = |
| 210 app_request_context_getter_map_.find(descriptor); | 190 app_request_context_getter_map_.find(descriptor); |
| 211 if (iter != app_request_context_getter_map_.end()) | 191 if (iter != app_request_context_getter_map_.end()) |
| 212 return iter->second; | 192 return iter->second; |
| 213 | 193 |
| 214 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 194 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 215 protocol_handler_interceptor( | 195 protocol_handler_interceptor( |
| 216 ProtocolHandlerRegistryFactory::GetForProfile(profile_)-> | 196 ProtocolHandlerRegistryFactory::GetForProfile(profile_)-> |
| 217 CreateJobInterceptorFactory()); | 197 CreateJobInterceptorFactory()); |
| 218 ChromeURLRequestContextGetter* context = | 198 ChromeURLRequestContextGetter* context = |
| 219 ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp( | 199 ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp( |
| 220 profile_, io_data_, descriptor, | 200 profile_, io_data_, descriptor, |
| 221 protocol_handler_interceptor.Pass(), blob_protocol_handler.Pass(), | 201 protocol_handler_interceptor.Pass(), |
| 222 file_system_protocol_handler.Pass(), | 202 protocol_handlers); |
| 223 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | |
| 224 chrome_devtools_protocol_handler.Pass()); | |
| 225 app_request_context_getter_map_[descriptor] = context; | 203 app_request_context_getter_map_[descriptor] = context; |
| 226 | 204 |
| 227 return context; | 205 return context; |
| 228 } | 206 } |
| 229 | 207 |
| 230 scoped_refptr<ChromeURLRequestContextGetter> | 208 scoped_refptr<ChromeURLRequestContextGetter> |
| 231 ProfileImplIOData::Handle::GetIsolatedMediaRequestContextGetter( | 209 ProfileImplIOData::Handle::GetIsolatedMediaRequestContextGetter( |
| 232 const base::FilePath& partition_path, | 210 const base::FilePath& partition_path, |
| 233 bool in_memory) const { | 211 bool in_memory) const { |
| 234 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 212 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 http_server_properties_manager_(NULL) {} | 288 http_server_properties_manager_(NULL) {} |
| 311 ProfileImplIOData::~ProfileImplIOData() { | 289 ProfileImplIOData::~ProfileImplIOData() { |
| 312 DestroyResourceContext(); | 290 DestroyResourceContext(); |
| 313 | 291 |
| 314 if (media_request_context_.get()) | 292 if (media_request_context_.get()) |
| 315 media_request_context_->AssertNoURLRequests(); | 293 media_request_context_->AssertNoURLRequests(); |
| 316 } | 294 } |
| 317 | 295 |
| 318 void ProfileImplIOData::InitializeInternal( | 296 void ProfileImplIOData::InitializeInternal( |
| 319 ProfileParams* profile_params, | 297 ProfileParams* profile_params, |
| 320 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 298 content::ProtocolHandlerMap* protocol_handlers) const { |
| 321 blob_protocol_handler, | |
| 322 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 323 file_system_protocol_handler, | |
| 324 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 325 developer_protocol_handler, | |
| 326 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 327 chrome_protocol_handler, | |
| 328 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 329 chrome_devtools_protocol_handler) const { | |
| 330 ChromeURLRequestContext* main_context = main_request_context(); | 299 ChromeURLRequestContext* main_context = main_request_context(); |
| 331 | 300 |
| 332 IOThread* const io_thread = profile_params->io_thread; | 301 IOThread* const io_thread = profile_params->io_thread; |
| 333 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 302 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
| 334 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 303 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 335 // Only allow Record Mode if we are in a Debug build or where we are running | 304 // Only allow Record Mode if we are in a Debug build or where we are running |
| 336 // a cycle, and the user has limited control. | 305 // a cycle, and the user has limited control. |
| 337 bool record_mode = command_line.HasSwitch(switches::kRecordMode) && | 306 bool record_mode = command_line.HasSwitch(switches::kRecordMode) && |
| 338 (chrome::kRecordModeEnabled || | 307 (chrome::kRecordModeEnabled || |
| 339 command_line.HasSwitch(switches::kVisitURLs)); | 308 command_line.HasSwitch(switches::kVisitURLs)); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 main_context->set_http_transaction_factory(main_cache); | 409 main_context->set_http_transaction_factory(main_cache); |
| 441 | 410 |
| 442 #if !defined(DISABLE_FTP_SUPPORT) | 411 #if !defined(DISABLE_FTP_SUPPORT) |
| 443 ftp_factory_.reset( | 412 ftp_factory_.reset( |
| 444 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 413 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
| 445 main_context->set_ftp_transaction_factory(ftp_factory_.get()); | 414 main_context->set_ftp_transaction_factory(ftp_factory_.get()); |
| 446 #endif // !defined(DISABLE_FTP_SUPPORT) | 415 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 447 | 416 |
| 448 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 417 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
| 449 new net::URLRequestJobFactoryImpl()); | 418 new net::URLRequestJobFactoryImpl()); |
| 450 bool set_protocol = main_job_factory->SetProtocolHandler( | 419 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
| 451 chrome::kBlobScheme, blob_protocol_handler.release()); | |
| 452 DCHECK(set_protocol); | |
| 453 set_protocol = main_job_factory->SetProtocolHandler( | |
| 454 chrome::kFileSystemScheme, file_system_protocol_handler.release()); | |
| 455 DCHECK(set_protocol); | |
| 456 set_protocol = main_job_factory->SetProtocolHandler( | |
| 457 chrome::kChromeUIScheme, chrome_protocol_handler.release()); | |
| 458 DCHECK(set_protocol); | |
| 459 set_protocol = main_job_factory->SetProtocolHandler( | |
| 460 chrome::kChromeDevToolsScheme, | |
| 461 chrome_devtools_protocol_handler.release()); | |
| 462 DCHECK(set_protocol); | |
| 463 main_job_factory_ = SetUpJobFactoryDefaults( | 420 main_job_factory_ = SetUpJobFactoryDefaults( |
| 464 main_job_factory.Pass(), | 421 main_job_factory.Pass(), |
| 465 profile_params->protocol_handler_interceptor.Pass(), | 422 profile_params->protocol_handler_interceptor.Pass(), |
| 466 network_delegate(), | 423 network_delegate(), |
| 467 main_context->ftp_transaction_factory(), | 424 main_context->ftp_transaction_factory(), |
| 468 main_context->ftp_auth_cache()); | 425 main_context->ftp_auth_cache()); |
| 469 main_job_factory_.reset(new net::ProtocolInterceptJobFactory( | |
| 470 main_job_factory_.Pass(), developer_protocol_handler.Pass())); | |
| 471 main_context->set_job_factory(main_job_factory_.get()); | 426 main_context->set_job_factory(main_job_factory_.get()); |
| 472 | 427 |
| 473 #if defined(ENABLE_EXTENSIONS) | 428 #if defined(ENABLE_EXTENSIONS) |
| 474 InitializeExtensionsRequestContext(profile_params); | 429 InitializeExtensionsRequestContext(profile_params); |
| 475 #endif | 430 #endif |
| 476 | 431 |
| 477 // Create a media request context based on the main context, but using a | 432 // Create a media request context based on the main context, but using a |
| 478 // media cache. It shares the same job factory as the main context. | 433 // media cache. It shares the same job factory as the main context. |
| 479 StoragePartitionDescriptor details(profile_path_, false); | 434 StoragePartitionDescriptor details(profile_path_, false); |
| 480 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 435 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 extensions_context->ftp_auth_cache()); | 487 extensions_context->ftp_auth_cache()); |
| 533 extensions_context->set_job_factory(extensions_job_factory_.get()); | 488 extensions_context->set_job_factory(extensions_job_factory_.get()); |
| 534 } | 489 } |
| 535 | 490 |
| 536 ChromeURLRequestContext* | 491 ChromeURLRequestContext* |
| 537 ProfileImplIOData::InitializeAppRequestContext( | 492 ProfileImplIOData::InitializeAppRequestContext( |
| 538 ChromeURLRequestContext* main_context, | 493 ChromeURLRequestContext* main_context, |
| 539 const StoragePartitionDescriptor& partition_descriptor, | 494 const StoragePartitionDescriptor& partition_descriptor, |
| 540 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 495 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 541 protocol_handler_interceptor, | 496 protocol_handler_interceptor, |
| 542 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 497 content::ProtocolHandlerMap* protocol_handlers) const { |
| 543 blob_protocol_handler, | |
| 544 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 545 file_system_protocol_handler, | |
| 546 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 547 developer_protocol_handler, | |
| 548 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 549 chrome_protocol_handler, | |
| 550 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 551 chrome_devtools_protocol_handler) const { | |
| 552 // Copy most state from the main context. | 498 // Copy most state from the main context. |
| 553 AppRequestContext* context = new AppRequestContext(load_time_stats()); | 499 AppRequestContext* context = new AppRequestContext(load_time_stats()); |
| 554 context->CopyFrom(main_context); | 500 context->CopyFrom(main_context); |
| 555 | 501 |
| 556 base::FilePath cookie_path = partition_descriptor.path.Append( | 502 base::FilePath cookie_path = partition_descriptor.path.Append( |
| 557 chrome::kCookieFilename); | 503 chrome::kCookieFilename); |
| 558 base::FilePath cache_path = | 504 base::FilePath cache_path = |
| 559 partition_descriptor.path.Append(chrome::kCacheDirname); | 505 partition_descriptor.path.Append(chrome::kCacheDirname); |
| 560 | 506 |
| 561 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 507 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 cookie_store = new net::CookieMonster(cookie_db.get(), NULL); | 559 cookie_store = new net::CookieMonster(cookie_db.get(), NULL); |
| 614 } | 560 } |
| 615 | 561 |
| 616 // Transfer ownership of the cookies and cache to AppRequestContext. | 562 // Transfer ownership of the cookies and cache to AppRequestContext. |
| 617 context->SetCookieStore(cookie_store); | 563 context->SetCookieStore(cookie_store); |
| 618 context->SetHttpTransactionFactory( | 564 context->SetHttpTransactionFactory( |
| 619 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); | 565 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); |
| 620 | 566 |
| 621 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 567 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 622 new net::URLRequestJobFactoryImpl()); | 568 new net::URLRequestJobFactoryImpl()); |
| 623 bool set_protocol = job_factory->SetProtocolHandler( | 569 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
| 624 chrome::kBlobScheme, blob_protocol_handler.release()); | |
| 625 DCHECK(set_protocol); | |
| 626 set_protocol = job_factory->SetProtocolHandler( | |
| 627 chrome::kFileSystemScheme, file_system_protocol_handler.release()); | |
| 628 DCHECK(set_protocol); | |
| 629 set_protocol = job_factory->SetProtocolHandler( | |
| 630 chrome::kChromeUIScheme, chrome_protocol_handler.release()); | |
| 631 DCHECK(set_protocol); | |
| 632 set_protocol = job_factory->SetProtocolHandler( | |
| 633 chrome::kChromeDevToolsScheme, | |
| 634 chrome_devtools_protocol_handler.release()); | |
| 635 DCHECK(set_protocol); | |
| 636 scoped_ptr<net::URLRequestJobFactory> top_job_factory; | 570 scoped_ptr<net::URLRequestJobFactory> top_job_factory; |
| 637 // Overwrite the job factory that we inherit from the main context so | 571 // Overwrite the job factory that we inherit from the main context so |
| 638 // that we can later provide our own handlers for storage related protocols. | 572 // that we can later provide our own handlers for storage related protocols. |
| 639 // Install all the usual protocol handlers unless we are in a browser plugin | 573 // Install all the usual protocol handlers unless we are in a browser plugin |
| 640 // guest process, in which case only web-safe schemes are allowed. | 574 // guest process, in which case only web-safe schemes are allowed. |
| 641 if (!partition_descriptor.in_memory) { | 575 if (!partition_descriptor.in_memory) { |
| 642 top_job_factory = SetUpJobFactoryDefaults( | 576 top_job_factory = SetUpJobFactoryDefaults( |
| 643 job_factory.Pass(), protocol_handler_interceptor.Pass(), | 577 job_factory.Pass(), protocol_handler_interceptor.Pass(), |
| 644 network_delegate(), | 578 network_delegate(), |
| 645 context->ftp_transaction_factory(), | 579 context->ftp_transaction_factory(), |
| 646 context->ftp_auth_cache()); | 580 context->ftp_auth_cache()); |
| 647 } else { | 581 } else { |
| 648 top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>(); | 582 top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>(); |
| 649 } | 583 } |
| 650 top_job_factory.reset(new net::ProtocolInterceptJobFactory( | |
| 651 top_job_factory.Pass(), developer_protocol_handler.Pass())); | |
| 652 context->SetJobFactory(top_job_factory.Pass()); | 584 context->SetJobFactory(top_job_factory.Pass()); |
| 653 | 585 |
| 654 return context; | 586 return context; |
| 655 } | 587 } |
| 656 | 588 |
| 657 ChromeURLRequestContext* | 589 ChromeURLRequestContext* |
| 658 ProfileImplIOData::InitializeMediaRequestContext( | 590 ProfileImplIOData::InitializeMediaRequestContext( |
| 659 ChromeURLRequestContext* original_context, | 591 ChromeURLRequestContext* original_context, |
| 660 const StoragePartitionDescriptor& partition_descriptor) const { | 592 const StoragePartitionDescriptor& partition_descriptor) const { |
| 661 // If this is for a in_memory partition, we can simply use the original | 593 // If this is for a in_memory partition, we can simply use the original |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 DCHECK(media_request_context_.get()); | 639 DCHECK(media_request_context_.get()); |
| 708 return media_request_context_.get(); | 640 return media_request_context_.get(); |
| 709 } | 641 } |
| 710 | 642 |
| 711 ChromeURLRequestContext* | 643 ChromeURLRequestContext* |
| 712 ProfileImplIOData::AcquireIsolatedAppRequestContext( | 644 ProfileImplIOData::AcquireIsolatedAppRequestContext( |
| 713 ChromeURLRequestContext* main_context, | 645 ChromeURLRequestContext* main_context, |
| 714 const StoragePartitionDescriptor& partition_descriptor, | 646 const StoragePartitionDescriptor& partition_descriptor, |
| 715 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 647 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 716 protocol_handler_interceptor, | 648 protocol_handler_interceptor, |
| 717 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 649 content::ProtocolHandlerMap* protocol_handlers) const { |
| 718 blob_protocol_handler, | |
| 719 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 720 file_system_protocol_handler, | |
| 721 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 722 developer_protocol_handler, | |
| 723 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 724 chrome_protocol_handler, | |
| 725 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 726 chrome_devtools_protocol_handler) const { | |
| 727 // We create per-app contexts on demand, unlike the others above. | 650 // We create per-app contexts on demand, unlike the others above. |
| 728 ChromeURLRequestContext* app_request_context = | 651 ChromeURLRequestContext* app_request_context = |
| 729 InitializeAppRequestContext(main_context, partition_descriptor, | 652 InitializeAppRequestContext(main_context, partition_descriptor, |
| 730 protocol_handler_interceptor.Pass(), | 653 protocol_handler_interceptor.Pass(), |
| 731 blob_protocol_handler.Pass(), | 654 protocol_handlers); |
| 732 file_system_protocol_handler.Pass(), | |
| 733 developer_protocol_handler.Pass(), | |
| 734 chrome_protocol_handler.Pass(), | |
| 735 chrome_devtools_protocol_handler.Pass()); | |
| 736 DCHECK(app_request_context); | 655 DCHECK(app_request_context); |
| 737 return app_request_context; | 656 return app_request_context; |
| 738 } | 657 } |
| 739 | 658 |
| 740 ChromeURLRequestContext* | 659 ChromeURLRequestContext* |
| 741 ProfileImplIOData::AcquireIsolatedMediaRequestContext( | 660 ProfileImplIOData::AcquireIsolatedMediaRequestContext( |
| 742 ChromeURLRequestContext* app_context, | 661 ChromeURLRequestContext* app_context, |
| 743 const StoragePartitionDescriptor& partition_descriptor) const { | 662 const StoragePartitionDescriptor& partition_descriptor) const { |
| 744 // We create per-app media contexts on demand, unlike the others above. | 663 // We create per-app media contexts on demand, unlike the others above. |
| 745 ChromeURLRequestContext* media_request_context = | 664 ChromeURLRequestContext* media_request_context = |
| (...skipping 12 matching lines...) Expand all Loading... |
| 758 const base::Closure& completion) { | 677 const base::Closure& completion) { |
| 759 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 678 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 760 DCHECK(initialized()); | 679 DCHECK(initialized()); |
| 761 | 680 |
| 762 DCHECK(transport_security_state()); | 681 DCHECK(transport_security_state()); |
| 763 // Completes synchronously. | 682 // Completes synchronously. |
| 764 transport_security_state()->DeleteAllDynamicDataSince(time); | 683 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 765 DCHECK(http_server_properties_manager_); | 684 DCHECK(http_server_properties_manager_); |
| 766 http_server_properties_manager_->Clear(completion); | 685 http_server_properties_manager_->Clear(completion); |
| 767 } | 686 } |
| OLD | NEW |