Chromium Code Reviews| Index: chrome/browser/profiles/profile_impl_io_data.cc |
| =================================================================== |
| --- chrome/browser/profiles/profile_impl_io_data.cc (revision 94628) |
| +++ chrome/browser/profiles/profile_impl_io_data.cc (working copy) |
| @@ -12,6 +12,7 @@ |
| #include "chrome/browser/io_thread.h" |
| #include "chrome/browser/net/chrome_net_log.h" |
| #include "chrome/browser/net/chrome_network_delegate.h" |
| +#include "chrome/browser/net/sqlite_origin_bound_cert_store.h" |
| #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| #include "chrome/browser/prefs/pref_member.h" |
| #include "chrome/browser/profiles/profile.h" |
| @@ -21,6 +22,7 @@ |
| #include "chrome/common/url_constants.h" |
| #include "content/browser/browser_thread.h" |
| #include "content/browser/resource_context.h" |
| +#include "net/base/origin_bound_cert_service.h" |
| #include "net/ftp/ftp_network_layer.h" |
| #include "net/http/http_cache.h" |
| @@ -52,23 +54,29 @@ |
| io_data_.release()->ShutdownOnUIThread(); |
| } |
| -void ProfileImplIOData::Handle::Init(const FilePath& cookie_path, |
| - const FilePath& cache_path, |
| - int cache_max_size, |
| - const FilePath& media_cache_path, |
| - int media_cache_max_size, |
| - const FilePath& extensions_cookie_path, |
| - const FilePath& app_path) { |
| +void ProfileImplIOData::Handle::Init( |
| + const FilePath& cookie_path, |
| + const FilePath& origin_bound_cert_path, |
| + const FilePath& cache_path, |
| + int cache_max_size, |
| + const FilePath& media_cache_path, |
| + int media_cache_max_size, |
| + const FilePath& extensions_cookie_path, |
| + const FilePath& extensions_origin_bound_cert_path, |
| + const FilePath& app_path) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| DCHECK(!io_data_->lazy_params_.get()); |
| LazyParams* lazy_params = new LazyParams; |
| lazy_params->cookie_path = cookie_path; |
| + lazy_params->origin_bound_cert_path = origin_bound_cert_path; |
| lazy_params->cache_path = cache_path; |
| lazy_params->cache_max_size = cache_max_size; |
| lazy_params->media_cache_path = media_cache_path; |
| lazy_params->media_cache_max_size = media_cache_max_size; |
| lazy_params->extensions_cookie_path = extensions_cookie_path; |
| + lazy_params->extensions_origin_bound_cert_path = |
| + extensions_origin_bound_cert_path; |
| io_data_->lazy_params_.reset(lazy_params); |
| @@ -230,6 +238,40 @@ |
| main_context->set_proxy_service(proxy_service()); |
| media_request_context_->set_proxy_service(proxy_service()); |
| + // BEGIN(rkn) |
|
wtc
2011/08/01 18:21:24
Remove the "BEGIN(rkn)" and "END(rkn)" comments.
|
| + scoped_refptr<net::OriginBoundCertService> origin_bound_cert_service = NULL; |
| + if (record_mode || playback_mode) { |
| + // Don't use existing cookies and use an in-memory store. |
| + origin_bound_cert_service= new net::OriginBoundCertService( |
| + new net::DefaultOriginBoundCertStore(NULL)); |
| + } |
| + |
| + // Setup origin bound cert service. |
| + if (!origin_bound_cert_service) { |
| + DCHECK(!lazy_params_->origin_bound_cert_path.empty()); |
| + |
| + scoped_refptr<SQLiteOriginBoundCertStore> origin_bound_cert_db = |
| + new SQLiteOriginBoundCertStore(lazy_params_->origin_bound_cert_path); |
| + origin_bound_cert_db->SetClearLocalStateOnExit( |
| + profile_params->clear_local_state_on_exit); |
| + origin_bound_cert_service = |
| + new net::OriginBoundCertService( |
| + new net::DefaultOriginBoundCertStore(origin_bound_cert_db.get())); |
| + } |
| + |
| + net::OriginBoundCertService* extensions_origin_bound_cert_service = |
|
wtc
2011/08/01 18:21:24
Store this in a scoped_refptr. As a general rule,
|
| + new net::OriginBoundCertService( |
| + new net::DefaultOriginBoundCertStore( |
| + new SQLiteOriginBoundCertStore( |
| + lazy_params_->extensions_origin_bound_cert_path))); |
| + |
| + main_context->set_origin_bound_cert_service(origin_bound_cert_service); |
| + media_request_context_->set_origin_bound_cert_service( |
| + origin_bound_cert_service); |
| + extensions_context->set_origin_bound_cert_service( |
| + extensions_origin_bound_cert_service); |
| + // END(rkn) |
|
wtc
2011/08/01 18:21:24
Is it OK to put this code next to the code that se
|
| + |
| net::HttpCache::DefaultBackend* main_backend = |
| new net::HttpCache::DefaultBackend( |
| net::DISK_CACHE, |
| @@ -239,6 +281,7 @@ |
| net::HttpCache* main_cache = new net::HttpCache( |
| main_context->host_resolver(), |
| main_context->cert_verifier(), |
| + main_context->origin_bound_cert_service(), |
| main_context->dnsrr_resolver(), |
| main_context->dns_cert_checker(), |
| main_context->proxy_service(), |