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

Unified Diff: net/tools/fetch/fetch_client.cc

Issue 5386001: Cache certificate verification results in memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add unit tests. Ready for review. Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: net/tools/fetch/fetch_client.cc
===================================================================
--- net/tools/fetch/fetch_client.cc (revision 68922)
+++ net/tools/fetch/fetch_client.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/singleton.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "net/base/cert_verifier.h"
#include "net/base/completion_callback.h"
#include "net/base/host_resolver.h"
#include "net/base/io_buffer.h"
@@ -139,6 +140,7 @@
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
NULL, NULL));
+ scoped_ptr<net::CertVerifier> cert_verifier(new net::CertVerifier);
willchan no longer on Chromium 2010/12/13 09:30:53 Why not just do CertVerifier cert_verifier? Do yo
scoped_refptr<net::ProxyService> proxy_service(
net::ProxyService::CreateDirect());
scoped_refptr<net::SSLConfigService> ssl_config_service(
@@ -147,13 +149,15 @@
scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory(
net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
if (use_cache) {
- factory = new net::HttpCache(host_resolver.get(), NULL, NULL, proxy_service,
- ssl_config_service, http_auth_handler_factory.get(), NULL, NULL,
+ factory = new net::HttpCache(host_resolver.get(), cert_verifier.get(),
+ NULL, NULL, proxy_service, ssl_config_service,
+ http_auth_handler_factory.get(), NULL, NULL,
net::HttpCache::DefaultBackend::InMemory(0));
} else {
factory = new net::HttpNetworkLayer(
net::ClientSocketFactory::GetDefaultFactory(),
host_resolver.get(),
+ cert_verifier.get(),
NULL /* dnsrr_resolver */,
NULL /* dns_cert_checker */,
NULL /* ssl_host_info_factory */,
@@ -203,7 +207,7 @@
// Dump the stats table.
printf("<stats>\n");
int counter_max = table.GetMaxCounters();
- for (int index=0; index < counter_max; index++) {
+ for (int index = 0; index < counter_max; index++) {
std::string name(table.GetRowName(index));
if (name.length() > 0) {
int value = table.GetRowValue(index);

Powered by Google App Engine
This is Rietveld 408576698