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

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

Issue 1895693004: [Fetch API] Add streams predicates to BodyStreamBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 BodyStreamBuffer_h 5 #ifndef BodyStreamBuffer_h
6 #define BodyStreamBuffer_h 6 #define BodyStreamBuffer_h
7 7
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/streams/ReadableByteStream.h" 9 #include "core/streams/ReadableByteStream.h"
10 #include "core/streams/ReadableByteStreamReader.h" 10 #include "core/streams/ReadableByteStreamReader.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 bool hasPendingActivity() const; 48 bool hasPendingActivity() const;
49 void stop(); 49 void stop();
50 50
51 // UnderlyingSource 51 // UnderlyingSource
52 void pullSource() override; 52 void pullSource() override;
53 ScriptPromise cancelSource(ScriptState*, ScriptValue reason) override; 53 ScriptPromise cancelSource(ScriptState*, ScriptValue reason) override;
54 54
55 // WebDataConsumerHandle::Client 55 // WebDataConsumerHandle::Client
56 void didGetReadable() override; 56 void didGetReadable() override;
57 57
58 bool isStreamReadable() const;
59 bool isStreamClosed() const;
60 bool isStreamErrored() const;
61 bool isStreamLocked() const;
62 bool isStreamDisturbed() const;
63
58 DEFINE_INLINE_TRACE() 64 DEFINE_INLINE_TRACE()
59 { 65 {
60 visitor->trace(m_stream); 66 visitor->trace(m_stream);
61 visitor->trace(m_loader); 67 visitor->trace(m_loader);
62 UnderlyingSource::trace(visitor); 68 UnderlyingSource::trace(visitor);
63 } 69 }
64 70
65 private: 71 private:
66 class LoaderClient; 72 class LoaderClient;
67 void close(); 73 void close();
68 void error(); 74 void error();
69 void processData(); 75 void processData();
70 void endLoading(); 76 void endLoading();
71 void stopLoading(); 77 void stopLoading();
72 78
73 OwnPtr<FetchDataConsumerHandle> m_handle; 79 OwnPtr<FetchDataConsumerHandle> m_handle;
74 OwnPtr<FetchDataConsumerHandle::Reader> m_reader; 80 OwnPtr<FetchDataConsumerHandle::Reader> m_reader;
75 Member<ReadableByteStream> m_stream; 81 Member<ReadableByteStream> m_stream;
76 // We need this member to keep it alive while loading. 82 // We need this member to keep it alive while loading.
77 Member<FetchDataLoader> m_loader; 83 Member<FetchDataLoader> m_loader;
78 bool m_streamNeedsMore; 84 bool m_streamNeedsMore;
79 }; 85 };
80 86
81 } // namespace blink 87 } // namespace blink
82 88
83 #endif // BodyStreamBuffer_h 89 #endif // BodyStreamBuffer_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/Body.cpp ('k') | third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698