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

Side by Side Diff: Source/modules/fetch/FetchBlobDataConsumerHandle.h

Issue 1192913007: Change BodyStreamBuffer to be FetchDataConsumerHandle-based and enable backpressure in Fetch API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Created 5 years, 6 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FetchBlobDataConsumerHandle_h
6 #define FetchBlobDataConsumerHandle_h
7
8 #include "core/fetch/ResourceLoaderOptions.h"
9 #include "core/loader/ThreadableLoader.h"
10 #include "modules/fetch/FetchDataConsumerHandle.h"
11 #include "platform/blob/BlobData.h"
12 #include "wtf/PassOwnPtr.h"
13 #include "wtf/PassRefPtr.h"
14 #include "wtf/RefPtr.h"
15
16 namespace blink {
17
18 class ExecutionContext;
19 class FetchBlobDataConsumerHandle final : public FetchDataConsumerHandle {
20 public:
21 class LoaderFactory : public GarbageCollectedFinalized<LoaderFactory> {
22 public:
23 virtual PassRefPtr<ThreadableLoader> create(ExecutionContext&, Threadabl eLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&, const Re sourceLoaderOptions&) = 0;
24 virtual ~LoaderFactory() { }
25 DEFINE_INLINE_VIRTUAL_TRACE() { }
26 };
27
28 static PassOwnPtr<FetchDataConsumerHandle> create(ExecutionContext*, PassRef Ptr<BlobDataHandle>);
29
30 // For testing.
31 static PassOwnPtr<FetchDataConsumerHandle> create(ExecutionContext*, PassRef Ptr<BlobDataHandle>, LoaderFactory*);
32
33 ~FetchBlobDataConsumerHandle();
34
35 private:
36 FetchBlobDataConsumerHandle(ExecutionContext*, PassRefPtr<BlobDataHandle>, L oaderFactory*);
37 Reader* obtainReaderInternal(Client*) override;
38
39 const char* debugName() const override { return "FetchBlobDataConsumerHandle "; }
40
41 class ReaderContext;
42 RefPtr<ReaderContext> m_readerContext;
43 };
44
45 } // namespace blink
46
47 #endif // FetchBlobDataConsumerHandle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698