- Adds kWasmCodeCache to blink::features.
- Checks if enabled before creating the cache in the browser.
- Checks if enabled before fetching from cache in renderer.
This is patterned after the Javascript IsolatedCodeCache feature.
Bug: chromium:719172
Change-Id: I1ffea5d8029b2b550c45e3ba25821889c7c2183c
Reviewed-on: https://chromium-review.googlesource.com/c/1341071
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609705}
Use SimplifyURLForRequest to erase username, password and ref so we can safely
use the URL as a cache key. SpecForRequest does not handle chrome:// URLs.
Bug: chromium:812168
Change-Id: Ia8118b46c6aa42f4c7184197e880b3fbcee9c47a
Reviewed-on: https://chromium-review.googlesource.com/c/1298719
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603381}
When site-isolation is not enabled (for ex: on Android), render
process would not be locked to an origin. In such cases it is safe
to use code cache by keying it only on the url of the requested
resource. Earlier, we prevented any render process that is not
locked to an origin from using code caches.
Bug: chromium:812168
Change-Id: Ib231bfca19d7e40fdf9d9cdd430bb0aedbe7426f
Reviewed-on: https://chromium-review.googlesource.com/c/1264675
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599780}
GeneratedCodeCache is used both by V8 and WebAssembly. This cl collects
the code cache behaviour statistics (ex: hit/miss/error rate) in different
histograms for V8 and WebAssembly.
Bug: chromium:812168
Change-Id: Ic91ff21b59f3f621b95afa2bd4a27eb0cc94613a
Reviewed-on: https://chromium-review.googlesource.com/c/1268282
Reviewed-by: Brian White <bcwhite@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598328}
Fixes a few problems preventing the WASM cache from working.
- Routes raw resource metadata to the WASM code cache.
- Separates JS and WASM generated code caches. They can't share
a directory.
- Allow cached metadata to be set on RawResources.
Bug: chromium:719172
Change-Id: I0f3709340948bb25d134504bb03632eb1ce24196
Reviewed-on: https://chromium-review.googlesource.com/c/1255963
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596779}
In GeneratedCodeCache::ReadDataComplete also handle cases when
the entry was just created but no data is written into. We
always expect response_time as the header in the cache entry. If
the number of bytes read is smaller than the response_header then
it should be treated as a Error. Also, we can have entries with
only response time and no data associated with it.
Bug: chromium:884217
Change-Id: I5cc3f0923aa87ce208fe766ab6e9fb2633c24159
Reviewed-on: https://chromium-review.googlesource.com/1228123
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592414}
This CL only handles the files in //content. The files in //net were
tackled in https://crrev.com/c/1188959. Parallel CLs will tackle other
directories.
net::IOBuffer is (thread-safe) ref-counted. Asides from improving the
ability to reason about instance ownership locally, creating instances
via base::MakeRefCounted makes it possible to use 1-based ref-counting
in the future (see base/memory/ref_counted.h).
This CL is mechanical, to avoid introducing any behavior changes. The
difficult cases will be tackled by follow-up CLs. The following
transformations were performed.
* new IOBufferType(args) => base::MakeRefCounted<IOBufferType>(args)
* new IOBufferType => base::MakeRefCounted<IOBufferType>()
* scoped_refptr x(base::MakeRefCounted<IOBufferType>(args)) =>
scoped_refptr x = base::MakeRefCounted<IOBufferType>(args)
* scoped_refptr<IOBufferType>(base::MakeRefCounted<IOBufferType>(args)) =>
base::MakeRefCounted<IOBufferType>(args)
* In comments: creates a new IOBufferType => creates an IOBufferType
(so it wouldn't trigger future searches for "new BufferType")
* Instantiated static members in HttpResponseBodyDrainer,
HttpNetworkTransaction, HttpProxyClientSocket, WritersTest,
UDPSocketTest, TestDelegate, UDPSocketPerfTest
(needed to fix linker errors)
* arraysize -> base::size (where needed to pass presubmit checks)
* git cl format
Change-Id: Ib3f9965fe92b84be3db88d0143a398079b812efd
Reviewed-on: https://chromium-review.googlesource.com/1200525
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588243}
Adds SiteIsolatedCodeCache.Behavour histogram. This collects the
behaviour of site isolated code cache for each request received.
It records if the request was serviced and if serviced how it was
serviced for ex: hit, miss, update.
Bug: chromium:812168
Change-Id: Ie9e45af8e72dee6fafc1b088c139b7b87fcc0851
Reviewed-on: https://chromium-review.googlesource.com/1196430
Reviewed-by: Brian White <bcwhite@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588047}
Pass in 0 as the size of code cache, so disk_cache backend
picks a default value based on some heuristics. The size
of code cache would be the same as the size of http_cache.
We can tune it once we have some initial results. We also
need to add support for embedder to override this default
value and that is tracked in this bug: crbug.com/867552
Bug: chromium:812168
Change-Id: Iab8d98764e3e306cb006377e5b8adaf2c727b689
Reviewed-on: https://chromium-review.googlesource.com/1161922
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585032}
Update the fetch interface of GeneratedCodeCache to send
response time and data instead of just raw data. This will
make it cleaner when using it and also make it consistent
with the write interface.
Bug: chromium:812168
Change-Id: Ic460bbbf15788caf04946a35b5cb3ba356cd212e
Reviewed-on: https://chromium-review.googlesource.com/1154539
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580183}
We want to decouple the code cache from the HttpCache and
recently added a separate code cache [1]. This cl is a follow up
that actually writes the generated code into the code cache.
There will be a followup cl that also fetches from the code cache.
[1] chromium-review.googlesource.com/c/chromium/src/+/1120179
Bug: chromium:812168
Change-Id: I2866f8689b83ccba13ea8e0bcf7c60558997380d
Reviewed-on: https://chromium-review.googlesource.com/1150237
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579037}
We to store the code generated for javascript resources in a separate
cache [1]. This cl just creates a code cache, one instance per each
storage partition. I will follow it up with other cls that actually
start using this cache. This feature is behind a flag.
[1] docs.google.com/document/d/1O_PVZPn37Ev3_DWJjQLX-gid__OKxnXP1UsE8g_YkRY
Bug: chromium:812168
Change-Id: I610f640faec1fc331936e6388344c2975d268b4a
Reviewed-on: https://chromium-review.googlesource.com/1120179
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Sergey Volk <servolk@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578283}