Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1414)

Unified Diff: Source/modules/serviceworkers/Body.h

Issue 786893004: [ServiceWorker] Use BodyStreamBuffer as the body data of the Response object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: introduced internalBlobDataHandle(), internalBuffer() and internalContentType() to Response and FetchResponseData Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/modules/serviceworkers/Body.cpp » ('j') | Source/modules/serviceworkers/Body.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Body.h
diff --git a/Source/modules/serviceworkers/Body.h b/Source/modules/serviceworkers/Body.h
index dbaa20a7f5ece170a43562a3587dc4ea33919b61..17199ba92c2b05650dd59179c7ba8fa422a3ff8b 100644
--- a/Source/modules/serviceworkers/Body.h
+++ b/Source/modules/serviceworkers/Body.h
@@ -18,6 +18,7 @@
namespace blink {
+class BodyStreamBuffer;
class ScriptState;
class Body
@@ -50,6 +51,8 @@ public:
void setBodyUsed();
bool bodyUsed() const;
+ bool streamAccessed() const;
+
// ActiveDOMObject override.
virtual void stop() override;
virtual bool hasPendingActivity() const override;
@@ -62,9 +65,12 @@ protected:
private:
class ReadableStreamSource;
+ class BlobHandleResolver;
+
void pullSource();
void readAllFromStream(ScriptState*);
ScriptPromise readAsync(ScriptState*, ResponseType);
+ void readAsyncFromBlob(PassRefPtr<BlobDataHandle>);
void resolveJSON(const String&);
// FileReaderLoaderClient functions.
@@ -73,7 +79,11 @@ private:
virtual void didFinishLoading() override;
virtual void didFail(FileError::ErrorCode) override;
- virtual PassRefPtr<BlobDataHandle> blobDataHandle() = 0;
+ void didBlobHandleResolveError(PassRefPtrWillBeRawPtr<DOMException>);
+
+ virtual PassRefPtr<BlobDataHandle> blobDataHandle() const = 0;
+ virtual BodyStreamBuffer* buffer() const = 0;
+ virtual String contentType() const = 0;
void didFinishLoadingViaStream(DOMArrayBuffer*);
« no previous file with comments | « no previous file | Source/modules/serviceworkers/Body.cpp » ('j') | Source/modules/serviceworkers/Body.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698