Commit c5a24d54 authored by Mythri Alle's avatar Mythri Alle Committed by Commit Bot

Fetch from code cache only on main thread

Currently the code cache uses RenderMessageFilter to post tasks to the
browser thread. This is available only on the main thread. Hence, we
should not fetch code caches on non-main threads.

Fetching caches would be enabled on all threads once code cache has
its own thread-safe mojo interface.

Bug: chromium:884135
Change-Id: I1a91307aaa8d3be6aff37b1a7fb7b4bc8270dd87
Reviewed-on: https://chromium-review.googlesource.com/1226597Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593122}
parent 7e86b995
......@@ -298,6 +298,12 @@ bool ResourceLoader::ShouldFetchCodeCache() {
if (!RuntimeEnabledFeatures::IsolatedCodeCacheEnabled())
return false;
// TODO(crbug.com/867347): Enable fetching of code caches on non-main threads
// once code cache has its own mojo interface. Currently it is using
// RenderMessageFilter that is not available on non-main threads.
if (!IsMainThread())
return false;
const ResourceRequest& request = resource_->GetResourceRequest();
if (!request.Url().ProtocolIsInHTTPFamily())
return false;
......@@ -986,9 +992,9 @@ void ResourceLoader::RequestSynchronously(const ResourceRequest& request) {
return;
DCHECK_GE(response_out.ToResourceResponse().EncodedBodyLength(), 0);
if (code_cache_request_) {
code_cache_request_->FetchFromCodeCacheSynchronously(this);
}
// TODO(crbug.com/867347): Enable fetching of code caches synchronously
// once code cache has its own mojo interface. Currently it is using
// RenderMessageFilter that is not available on non-main threads.
// Follow the async case convention of not calling DidReceiveData or
// appending data to m_resource if the response body is empty. Copying the
......
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