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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/prefs/pref_member.h" | 11 #include "base/prefs/pref_member.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
17 #include "base/threading/worker_pool.h" | 17 #include "base/threading/worker_pool.h" |
18 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 21 #include "chrome/browser/extensions/extension_protocols.h" |
21 #include "chrome/browser/io_thread.h" | 22 #include "chrome/browser/io_thread.h" |
22 #include "chrome/browser/net/chrome_net_log.h" | 23 #include "chrome/browser/net/chrome_net_log.h" |
23 #include "chrome/browser/net/chrome_network_delegate.h" | 24 #include "chrome/browser/net/chrome_network_delegate.h" |
24 #include "chrome/browser/net/connect_interceptor.h" | 25 #include "chrome/browser/net/connect_interceptor.h" |
25 #include "chrome/browser/net/http_server_properties_manager.h" | 26 #include "chrome/browser/net/http_server_properties_manager.h" |
26 #include "chrome/browser/net/predictor.h" | 27 #include "chrome/browser/net/predictor.h" |
27 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" | 28 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" |
28 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
29 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 } | 576 } |
576 | 577 |
577 // Transfer ownership of the cookies and cache to AppRequestContext. | 578 // Transfer ownership of the cookies and cache to AppRequestContext. |
578 context->SetCookieStore(cookie_store.get()); | 579 context->SetCookieStore(cookie_store.get()); |
579 context->SetHttpTransactionFactory( | 580 context->SetHttpTransactionFactory( |
580 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); | 581 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); |
581 | 582 |
582 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 583 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
583 new net::URLRequestJobFactoryImpl()); | 584 new net::URLRequestJobFactoryImpl()); |
584 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 585 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
585 scoped_ptr<net::URLRequestJobFactory> top_job_factory; | 586 scoped_ptr<net::URLRequestJobFactory> top_job_factory( |
586 // Overwrite the job factory that we inherit from the main context so | 587 SetUpJobFactoryDefaults( |
587 // that we can later provide our own handlers for storage related protocols. | 588 job_factory.Pass(), protocol_handler_interceptor.Pass(), |
588 // Install all the usual protocol handlers unless we are in a browser plugin | 589 network_delegate(), |
589 // guest process, in which case only web-safe schemes are allowed. | 590 ftp_factory_.get())); |
590 if (!partition_descriptor.in_memory) { | |
591 top_job_factory = SetUpJobFactoryDefaults( | |
592 job_factory.Pass(), protocol_handler_interceptor.Pass(), | |
593 network_delegate(), | |
594 ftp_factory_.get()); | |
595 } else { | |
596 top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>(); | |
597 } | |
598 context->SetJobFactory(top_job_factory.Pass()); | 591 context->SetJobFactory(top_job_factory.Pass()); |
599 | 592 |
600 return context; | 593 return context; |
601 } | 594 } |
602 | 595 |
603 ChromeURLRequestContext* | 596 ChromeURLRequestContext* |
604 ProfileImplIOData::InitializeMediaRequestContext( | 597 ProfileImplIOData::InitializeMediaRequestContext( |
605 ChromeURLRequestContext* original_context, | 598 ChromeURLRequestContext* original_context, |
606 const StoragePartitionDescriptor& partition_descriptor) const { | 599 const StoragePartitionDescriptor& partition_descriptor) const { |
607 // Copy most state from the original context. | 600 // Copy most state from the original context. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 const base::Closure& completion) { | 688 const base::Closure& completion) { |
696 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 689 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
697 DCHECK(initialized()); | 690 DCHECK(initialized()); |
698 | 691 |
699 DCHECK(transport_security_state()); | 692 DCHECK(transport_security_state()); |
700 // Completes synchronously. | 693 // Completes synchronously. |
701 transport_security_state()->DeleteAllDynamicDataSince(time); | 694 transport_security_state()->DeleteAllDynamicDataSince(time); |
702 DCHECK(http_server_properties_manager_); | 695 DCHECK(http_server_properties_manager_); |
703 http_server_properties_manager_->Clear(completion); | 696 http_server_properties_manager_->Clear(completion); |
704 } | 697 } |
OLD | NEW |