Commit 8c8203d9 authored by Kenichi Ishibashi's avatar Kenichi Ishibashi Committed by Commit Bot

service worker: Clarify valid usage of resource readers/writers

Bug: 1117369
Change-Id: I72f5277b8d7e57a648b5d14cec4318e7488f6636
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440329Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812996}
parent 68a73c4a
...@@ -55,6 +55,9 @@ interface ServiceWorkerDataPipeStateNotifier { ...@@ -55,6 +55,9 @@ interface ServiceWorkerDataPipeStateNotifier {
}; };
// An interface that reads a service worker script (resource) to storage. // An interface that reads a service worker script (resource) to storage.
// A valid use of this interface is that exactly one call to
// ReadResponseHead(), followed by possibly multiple ReadData() calls. Each call
// must not be overlapped.
interface ServiceWorkerResourceReader { interface ServiceWorkerResourceReader {
// Reads the response head of the resource associated with this reader. // Reads the response head of the resource associated with this reader.
// |status| is the number of bytes read, or a //net error. // |status| is the number of bytes read, or a //net error.
...@@ -70,6 +73,9 @@ interface ServiceWorkerResourceReader { ...@@ -70,6 +73,9 @@ interface ServiceWorkerResourceReader {
}; };
// An interface that writes a service worker script (resource) to storage. // An interface that writes a service worker script (resource) to storage.
// A valid use of this interface is that exactly one call to
// WriteResponseHead(), followed by at most one call to WriteData(). These calls
// must not be overlapped.
interface ServiceWorkerResourceWriter { interface ServiceWorkerResourceWriter {
// Writes the response head to storage. Returns the number of bytes written, // Writes the response head to storage. Returns the number of bytes written,
// or a //net error. // or a //net error.
...@@ -81,7 +87,7 @@ interface ServiceWorkerResourceWriter { ...@@ -81,7 +87,7 @@ interface ServiceWorkerResourceWriter {
}; };
// An interface that writes a metadata (script cache) of a service worker script // An interface that writes a metadata (script cache) of a service worker script
// to storage. // to storage. WriteMetadata() should be called at most once.
interface ServiceWorkerResourceMetadataWriter { interface ServiceWorkerResourceMetadataWriter {
// Writes the metadata of the resource associated with this writer. Returns // Writes the metadata of the resource associated with this writer. Returns
// the number of bytes written, or a //net error. // the number of bytes written, or a //net error.
......
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