Index: net/http/http_cache.cc |
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc |
index aa6fc228bc6c91b7cbf31c3fa67145683466695f..2137475ce555f47020eebfeb253e92ac6a4bcb54 100644 |
--- a/net/http/http_cache.cc |
+++ b/net/http/http_cache.cc |
@@ -33,6 +33,7 @@ |
#include "net/base/net_errors.h" |
#include "net/base/upload_data_stream.h" |
#include "net/disk_cache/disk_cache.h" |
+#include "net/http/disk_based_cert_cache.h" |
#include "net/http/disk_cache_based_quic_server_info.h" |
#include "net/http/http_cache_transaction.h" |
#include "net/http/http_network_layer.h" |
@@ -45,6 +46,11 @@ |
namespace { |
+bool UseCertCache() { |
wtc
2014/07/08 00:14:03
IMPORTANT: Should we also use a command-line optio
Ryan Sleevi
2014/07/08 00:34:18
wtc: What's the use case here? I discouraged Brand
wtc
2014/07/08 01:54:41
A command-line option is a common way to allow us
|
+ return base::FieldTrialList::FindFullName("CertCacheTrial") == |
+ "ExperimentGroup"; |
wtc
2014/07/08 18:24:21
IMPORTANT: Users in the field trial will have new
Ryan Sleevi
2014/07/08 18:29:08
Yes. We're using the DiskCache.
wtc
2014/07/08 19:00:11
Suppose we change the URI scheme to "cert2:". Won'
|
+} |
+ |
// Adaptor to delete a file on a worker thread. |
void DeletePath(base::FilePath path) { |
base::DeleteFile(path, false); |
@@ -1174,8 +1180,11 @@ void HttpCache::OnBackendCreated(int result, PendingOp* pending_op) { |
// work items. The first call saves the backend and releases the factory, |
// and the last call clears building_backend_. |
backend_factory_.reset(); // Reclaim memory. |
- if (result == OK) |
+ if (result == OK) { |
disk_cache_ = pending_op->backend.Pass(); |
+ if (UseCertCache()) |
+ cert_cache_.reset(new DiskBasedCertCache(disk_cache_.get())); |
+ } |
} |
if (!pending_op->pending_queue.empty()) { |