Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 42773002: Get ClientCertStore through ResourceContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update unittest, clang fix Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "content/public/browser/resource_context.h" 64 #include "content/public/browser/resource_context.h"
65 #include "extensions/common/constants.h" 65 #include "extensions/common/constants.h"
66 #include "net/cert/cert_verifier.h" 66 #include "net/cert/cert_verifier.h"
67 #include "net/cookies/canonical_cookie.h" 67 #include "net/cookies/canonical_cookie.h"
68 #include "net/cookies/cookie_monster.h" 68 #include "net/cookies/cookie_monster.h"
69 #include "net/http/http_transaction_factory.h" 69 #include "net/http/http_transaction_factory.h"
70 #include "net/http/http_util.h" 70 #include "net/http/http_util.h"
71 #include "net/proxy/proxy_config_service_fixed.h" 71 #include "net/proxy/proxy_config_service_fixed.h"
72 #include "net/proxy/proxy_script_fetcher_impl.h" 72 #include "net/proxy/proxy_script_fetcher_impl.h"
73 #include "net/proxy/proxy_service.h" 73 #include "net/proxy/proxy_service.h"
74 #include "net/ssl/client_cert_store_impl.h"
74 #include "net/ssl/server_bound_cert_service.h" 75 #include "net/ssl/server_bound_cert_service.h"
75 #include "net/url_request/data_protocol_handler.h" 76 #include "net/url_request/data_protocol_handler.h"
76 #include "net/url_request/file_protocol_handler.h" 77 #include "net/url_request/file_protocol_handler.h"
77 #include "net/url_request/ftp_protocol_handler.h" 78 #include "net/url_request/ftp_protocol_handler.h"
78 #include "net/url_request/protocol_intercept_job_factory.h" 79 #include "net/url_request/protocol_intercept_job_factory.h"
79 #include "net/url_request/url_request.h" 80 #include "net/url_request/url_request.h"
80 #include "net/url_request/url_request_file_job.h" 81 #include "net/url_request/url_request_file_job.h"
81 #include "net/url_request/url_request_job_factory_impl.h" 82 #include "net/url_request/url_request_job_factory_impl.h"
82 83
83 #if defined(ENABLE_MANAGED_USERS) 84 #if defined(ENABLE_MANAGED_USERS)
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 721
721 bool ProfileIOData::ResourceContext::AllowContentAccess( 722 bool ProfileIOData::ResourceContext::AllowContentAccess(
722 const GURL& origin, ContentSettingsType type) { 723 const GURL& origin, ContentSettingsType type) {
723 HostContentSettingsMap* content_settings = 724 HostContentSettingsMap* content_settings =
724 io_data_->GetHostContentSettingsMap(); 725 io_data_->GetHostContentSettingsMap();
725 ContentSetting setting = content_settings->GetContentSetting( 726 ContentSetting setting = content_settings->GetContentSetting(
726 origin, origin, type, NO_RESOURCE_IDENTIFIER); 727 origin, origin, type, NO_RESOURCE_IDENTIFIER);
727 return setting == CONTENT_SETTING_ALLOW; 728 return setting == CONTENT_SETTING_ALLOW;
728 } 729 }
729 730
731 scoped_ptr<net::ClientCertStore>
732 ProfileIOData::ResourceContext::GetClientCertStore() {
733 #if !defined(USE_OPENSSL)
734 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreImpl());
735 #else
736 return scoped_ptr<net::ClientCertStore>();
737 #endif
738 }
739
730 // static 740 // static
731 std::string ProfileIOData::GetSSLSessionCacheShard() { 741 std::string ProfileIOData::GetSSLSessionCacheShard() {
732 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 742 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
733 // The SSL session cache is partitioned by setting a string. This returns a 743 // The SSL session cache is partitioned by setting a string. This returns a
734 // unique string to partition the SSL session cache. Each time we create a 744 // unique string to partition the SSL session cache. Each time we create a
735 // new profile, we'll get a fresh SSL session cache which is separate from 745 // new profile, we'll get a fresh SSL session cache which is separate from
736 // the other profiles. 746 // the other profiles.
737 static unsigned ssl_session_cache_instance = 0; 747 static unsigned ssl_session_cache_instance = 0;
738 return base::StringPrintf("profile/%u", ssl_session_cache_instance++); 748 return base::StringPrintf("profile/%u", ssl_session_cache_instance++);
739 } 749 }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 void ProfileIOData::SetCookieSettingsForTesting( 988 void ProfileIOData::SetCookieSettingsForTesting(
979 CookieSettings* cookie_settings) { 989 CookieSettings* cookie_settings) {
980 DCHECK(!cookie_settings_.get()); 990 DCHECK(!cookie_settings_.get());
981 cookie_settings_ = cookie_settings; 991 cookie_settings_ = cookie_settings;
982 } 992 }
983 993
984 void ProfileIOData::set_signin_names_for_testing( 994 void ProfileIOData::set_signin_names_for_testing(
985 SigninNamesOnIOThread* signin_names) { 995 SigninNamesOnIOThread* signin_names) {
986 signin_names_.reset(signin_names); 996 signin_names_.reset(signin_names);
987 } 997 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698