Commit 07969eff authored by abarth's avatar abarth Committed by Commit bot

Store network_service cache in memory

The network cache is not safe for usage by multiple processes at the same
time like when sky tests are running many mojo_shell instances in parallel.
To work around this we store the cache in memory. In the future we should
consider file system partitioning for mojo services.

This CL originally reviewed and landed in the Mojo repo in
https://codereview.chromium.org/679403002/. Re-landing in the Chromium repo
because this code is canonically developed here.

TBR=davemoore@chromium.org

Review URL: https://codereview.chromium.org/697883003

Cr-Commit-Position: refs/heads/master@{#302411}
parent ba52e3a7
......@@ -22,7 +22,10 @@ NetworkContext::NetworkContext(const base::FilePath& base_path) {
net::URLRequestContextBuilder::HttpCacheParams cache_params;
cache_params.path = base_path.Append(FILE_PATH_LITERAL("Cache"));
cache_params.type = net::URLRequestContextBuilder::HttpCacheParams::DISK;
// TODO(esprehn): For now store the cache in memory so we can run many shells
// in parallel when running tests, otherwise the network services in each
// shell will corrupt the disk cache.
cache_params.type = net::URLRequestContextBuilder::HttpCacheParams::IN_MEMORY;
builder.EnableHttpCache(cache_params);
builder.set_file_enabled(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment