Make sure Blob refcounts/lifetime work for cache and fetch APIs.
Pass a mojo BlobPtr in addition to the uuid in all the IPCs/mojo calls
for the cache and fetch APIs to make sure the blobs stay alive long
enough. Since the cache and fetch APIs largely pass around their parameters
in a copyable struct (mostly passed by const reference) this also required
introduction of a storage::BlobHandle type, a ref-counted wrapper around
a BlobPtr.
The BlobPtr passed along in IPCs/mojo messages isn't actually used for
anything other than lifetime management at this point. The browser side
code still uses the UUID to actually look up the blob and get its data.
Also add service worker and fetch tests to the mojo blobs virtual test
suite to make sure this all works correctly.
Bug: 740744
Change-Id: I6bfcda977cd605099bd6c04d9f079ce7783b43f4
Reviewed-on: https://chromium-review.googlesource.com/567549
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Takeshi Yoshino <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Daniel Murphy <[email protected]>
Commit-Queue: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/master@{#491140}
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites
index 3fda57e..42799f6 100644
--- a/third_party/WebKit/LayoutTests/VirtualTestSuites
+++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -565,6 +565,16 @@
},
{
"prefix": "mojo-blobs",
+ "base": "external/wpt/fetch",
+ "args": ["--enable-features=MojoBlobs"]
+ },
+ {
+ "prefix": "mojo-blobs",
+ "base": "external/wpt/service-workers",
+ "args": ["--enable-features=MojoBlobs"]
+ },
+ {
+ "prefix": "mojo-blobs",
"base": "fast/files",
"args": ["--enable-features=MojoBlobs"]
}