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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/Body.h

Issue 1899873006: Make Response::body return v8-extra based stream behind flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notify-locked-released
Patch Set: Created 4 years, 8 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef Body_h 5 #ifndef Body_h
6 #define Body_h 6 #define Body_h
7 7
8 #include "bindings/core/v8/ActiveScriptWrappable.h" 8 #include "bindings/core/v8/ActiveScriptWrappable.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
(...skipping 27 matching lines...) Expand all
38 USING_GARBAGE_COLLECTED_MIXIN(Body); 38 USING_GARBAGE_COLLECTED_MIXIN(Body);
39 public: 39 public:
40 explicit Body(ExecutionContext*); 40 explicit Body(ExecutionContext*);
41 ~Body() override { } 41 ~Body() override { }
42 42
43 ScriptPromise arrayBuffer(ScriptState*); 43 ScriptPromise arrayBuffer(ScriptState*);
44 ScriptPromise blob(ScriptState*); 44 ScriptPromise blob(ScriptState*);
45 ScriptPromise formData(ScriptState*); 45 ScriptPromise formData(ScriptState*);
46 ScriptPromise json(ScriptState*); 46 ScriptPromise json(ScriptState*);
47 ScriptPromise text(ScriptState*); 47 ScriptPromise text(ScriptState*);
48 ReadableByteStream* bodyWithUseCounter(); 48 ScriptValue bodyWithUseCounter(ScriptState*);
49 virtual BodyStreamBuffer* bodyBuffer() = 0; 49 virtual BodyStreamBuffer* bodyBuffer() = 0;
50 virtual const BodyStreamBuffer* bodyBuffer() const = 0; 50 virtual const BodyStreamBuffer* bodyBuffer() const = 0;
51 ScriptValue v8ExtraStreamBody(ScriptState*);
52 51
53 virtual bool bodyUsed(); 52 virtual bool bodyUsed();
54 bool isBodyLocked(); 53 bool isBodyLocked();
55 54
56 // ActiveScriptWrappable override. 55 // ActiveScriptWrappable override.
57 bool hasPendingActivity() const override; 56 bool hasPendingActivity() const override;
58 57
59 DEFINE_INLINE_VIRTUAL_TRACE() 58 DEFINE_INLINE_VIRTUAL_TRACE()
60 { 59 {
61 ActiveDOMObject::trace(visitor); 60 ActiveDOMObject::trace(visitor);
62 } 61 }
63 62
64 private: 63 private:
65 ReadableByteStream* body();
66 virtual String mimeType() const = 0; 64 virtual String mimeType() const = 0;
67 65
68 // Body consumption algorithms will reject with a TypeError in a number of 66 // Body consumption algorithms will reject with a TypeError in a number of
69 // error conditions. This method wraps those up into one call which returns 67 // error conditions. This method wraps those up into one call which returns
70 // an empty ScriptPromise if the consumption may proceed, and a 68 // an empty ScriptPromise if the consumption may proceed, and a
71 // ScriptPromise rejected with a TypeError if it ought to be blocked. 69 // ScriptPromise rejected with a TypeError if it ought to be blocked.
72 ScriptPromise rejectInvalidConsumption(ScriptState*); 70 ScriptPromise rejectInvalidConsumption(ScriptState*);
73 }; 71 };
74 72
75 } // namespace blink 73 } // namespace blink
76 74
77 #endif // Body_h 75 #endif // Body_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698