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

Side by Side Diff: Source/modules/fetch/FetchDataLoader.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: Reflect comments. 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 FetchDataLoader_h 5 #ifndef FetchDataLoader_h
6 #define FetchDataLoader_h 6 #define FetchDataLoader_h
7 7
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/streams/Stream.h"
9 #include "modules/fetch/FetchDataConsumerHandle.h" 10 #include "modules/fetch/FetchDataConsumerHandle.h"
10 #include "platform/blob/BlobData.h" 11 #include "platform/blob/BlobData.h"
11 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
12 #include "wtf/Forward.h" 13 #include "wtf/Forward.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 // FetchDataLoader subclasses 17 // FetchDataLoader subclasses
17 // 1. take a reader of FetchDataConsumerHandle |handle|, 18 // 1. take a reader of FetchDataConsumerHandle |handle|,
18 // 2. read all data, and 19 // 2. read all data, and
(...skipping 17 matching lines...) Expand all
36 ASSERT_NOT_REACHED(); 37 ASSERT_NOT_REACHED();
37 } 38 }
38 virtual void didFetchDataLoadedArrayBuffer(PassRefPtr<DOMArrayBuffer>) 39 virtual void didFetchDataLoadedArrayBuffer(PassRefPtr<DOMArrayBuffer>)
39 { 40 {
40 ASSERT_NOT_REACHED(); 41 ASSERT_NOT_REACHED();
41 } 42 }
42 virtual void didFetchDataLoadedString(const String&) 43 virtual void didFetchDataLoadedString(const String&)
43 { 44 {
44 ASSERT_NOT_REACHED(); 45 ASSERT_NOT_REACHED();
45 } 46 }
47 virtual void didFetchDataLoadedStream()
48 {
49 ASSERT_NOT_REACHED();
50 }
46 51
47 virtual void didFetchDataLoadFailed() = 0; 52 virtual void didFetchDataLoadFailed() = 0;
48 53
49 DEFINE_INLINE_VIRTUAL_TRACE() { } 54 DEFINE_INLINE_VIRTUAL_TRACE() { }
50 }; 55 };
51 56
52 static FetchDataLoader* createLoaderAsBlobHandle(const String& mimeType); 57 static FetchDataLoader* createLoaderAsBlobHandle(const String& mimeType);
53 static FetchDataLoader* createLoaderAsArrayBuffer(); 58 static FetchDataLoader* createLoaderAsArrayBuffer();
54 static FetchDataLoader* createLoaderAsString(); 59 static FetchDataLoader* createLoaderAsString();
60 static FetchDataLoader* createLoaderAsStream(Stream* outStream);
55 61
56 virtual ~FetchDataLoader() { } 62 virtual ~FetchDataLoader() { }
57 63
58 // start() should be called only once on the created thread. 64 // start() should be called only once on the created thread.
59 // start() do not take the ownership of |handle|. 65 // start() do not take the ownership of |handle|.
60 // |handle| must not be locked when called. 66 // |handle| must not be locked when called.
61 virtual void start(FetchDataConsumerHandle* /* handle */, Client*) = 0; 67 virtual void start(FetchDataConsumerHandle* /* handle */, Client*) = 0;
62 68
63 virtual void cancel() = 0; 69 virtual void cancel() = 0;
64 70
65 DEFINE_INLINE_VIRTUAL_TRACE() { } 71 DEFINE_INLINE_VIRTUAL_TRACE() { }
66 }; 72 };
67 73
68 } // namespace blink 74 } // namespace blink
69 75
70 #endif // FetchDataLoader_h 76 #endif // FetchDataLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698