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

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

Issue 1714613003: BodyStreamBuffer should release WebDataConsumerHandle::Reader eagerly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "core/streams/UnderlyingSource.h" 11 #include "core/streams/UnderlyingSource.h"
12 #include "modules/ModulesExport.h" 12 #include "modules/ModulesExport.h"
13 #include "modules/fetch/FetchDataConsumerHandle.h" 13 #include "modules/fetch/FetchDataConsumerHandle.h"
14 #include "modules/fetch/FetchDataLoader.h" 14 #include "modules/fetch/FetchDataLoader.h"
15 #include "platform/heap/Handle.h" 15 #include "platform/heap/Handle.h"
16 #include "public/platform/WebDataConsumerHandle.h" 16 #include "public/platform/WebDataConsumerHandle.h"
17 #include "wtf/OwnPtr.h" 17 #include "wtf/OwnPtr.h"
18 #include "wtf/PassOwnPtr.h" 18 #include "wtf/PassOwnPtr.h"
19 19
20 namespace blink { 20 namespace blink {
21 21
22 class EncodedFormData; 22 class EncodedFormData;
23 class ExecutionContext; 23 class ExecutionContext;
24 24
25 class MODULES_EXPORT BodyStreamBuffer final : public GarbageCollectedFinalized<B odyStreamBuffer>, public UnderlyingSource, public WebDataConsumerHandle::Client { 25 class MODULES_EXPORT BodyStreamBuffer final : public GarbageCollectedFinalized<B odyStreamBuffer>, public UnderlyingSource, public WebDataConsumerHandle::Client {
26 WTF_MAKE_NONCOPYABLE(BodyStreamBuffer); 26 WTF_MAKE_NONCOPYABLE(BodyStreamBuffer);
27 USING_GARBAGE_COLLECTED_MIXIN(BodyStreamBuffer); 27 USING_GARBAGE_COLLECTED_MIXIN(BodyStreamBuffer);
28 // Needed because we have to release |m_reader| promptly.
29 EAGERLY_FINALIZE();
28 public: 30 public:
29 // |handle| cannot be null and cannot be locked. 31 // |handle| cannot be null and cannot be locked.
30 explicit BodyStreamBuffer(PassOwnPtr<FetchDataConsumerHandle> /* handle */); 32 explicit BodyStreamBuffer(PassOwnPtr<FetchDataConsumerHandle> /* handle */);
31 33
32 ReadableByteStream* stream() { return m_stream; } 34 ReadableByteStream* stream() { return m_stream; }
33 35
34 // Callable only when not locked. 36 // Callable only when not locked.
35 PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(FetchDataConsumerHandle::Re ader::BlobSizePolicy); 37 PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(FetchDataConsumerHandle::Re ader::BlobSizePolicy);
36 PassRefPtr<EncodedFormData> drainAsFormData(); 38 PassRefPtr<EncodedFormData> drainAsFormData();
37 void startLoading(ExecutionContext*, FetchDataLoader*, FetchDataLoader::Clie nt* /* client */); 39 void startLoading(ExecutionContext*, FetchDataLoader*, FetchDataLoader::Clie nt* /* client */);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 OwnPtr<FetchDataConsumerHandle::Reader> m_reader; 74 OwnPtr<FetchDataConsumerHandle::Reader> m_reader;
73 Member<ReadableByteStream> m_stream; 75 Member<ReadableByteStream> m_stream;
74 // We need this member to keep it alive while loading. 76 // We need this member to keep it alive while loading.
75 Member<FetchDataLoader> m_loader; 77 Member<FetchDataLoader> m_loader;
76 bool m_streamNeedsMore; 78 bool m_streamNeedsMore;
77 }; 79 };
78 80
79 } // namespace blink 81 } // namespace blink
80 82
81 #endif // BodyStreamBuffer_h 83 #endif // BodyStreamBuffer_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698