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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 cookie_store = new net::CookieMonster(cookie_db.get(), NULL); | 549 cookie_store = new net::CookieMonster(cookie_db.get(), NULL); |
550 } | 550 } |
551 | 551 |
552 // Transfer ownership of the cookies and cache to AppRequestContext. | 552 // Transfer ownership of the cookies and cache to AppRequestContext. |
553 context->SetCookieStore(cookie_store); | 553 context->SetCookieStore(cookie_store); |
554 context->SetHttpTransactionFactory( | 554 context->SetHttpTransactionFactory( |
555 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); | 555 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); |
556 | 556 |
557 // Overwrite the job factory that we inherit from the main context so | 557 // Overwrite the job factory that we inherit from the main context so |
558 // that we can later provide our own handles for storage related protocols. | 558 // that we can later provide our own handles for storage related protocols. |
| 559 // Install all the usual protocol handlers unless we are in a browser plugin |
| 560 // guest process, in which case only web-safe schemes are allowed. |
559 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 561 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
560 new net::URLRequestJobFactoryImpl()); | 562 new net::URLRequestJobFactoryImpl()); |
561 SetUpJobFactory(job_factory.get(), protocol_handler_interceptor.Pass(), | 563 if (!is_guest_process) { |
562 network_delegate(), | 564 SetUpJobFactory(job_factory.get(), protocol_handler_interceptor.Pass(), |
563 context->ftp_transaction_factory(), | 565 network_delegate(), |
564 context->ftp_auth_cache()); | 566 context->ftp_transaction_factory(), |
| 567 context->ftp_auth_cache()); |
| 568 } |
565 context->SetJobFactory(job_factory.PassAs<net::URLRequestJobFactory>()); | 569 context->SetJobFactory(job_factory.PassAs<net::URLRequestJobFactory>()); |
566 | 570 |
567 return context; | 571 return context; |
568 } | 572 } |
569 | 573 |
570 ChromeURLRequestContext* | 574 ChromeURLRequestContext* |
571 ProfileImplIOData::InitializeMediaRequestContext( | 575 ProfileImplIOData::InitializeMediaRequestContext( |
572 ChromeURLRequestContext* original_context, | 576 ChromeURLRequestContext* original_context, |
573 const std::string& app_id) const { | 577 const std::string& app_id) const { |
574 // If this is for a guest process, we do not persist storage, so we can | 578 // If this is for a guest process, we do not persist storage, so we can |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 675 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
672 base::Time time) { | 676 base::Time time) { |
673 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 677 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
674 LazyInitialize(); | 678 LazyInitialize(); |
675 | 679 |
676 DCHECK(transport_security_state()); | 680 DCHECK(transport_security_state()); |
677 transport_security_state()->DeleteSince(time); | 681 transport_security_state()->DeleteSince(time); |
678 DCHECK(http_server_properties_manager()); | 682 DCHECK(http_server_properties_manager()); |
679 http_server_properties_manager()->Clear(); | 683 http_server_properties_manager()->Clear(); |
680 } | 684 } |
OLD | NEW |