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

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

Issue 2780693003: [wasm] response-based compile APIs (Closed)
Patch Set: no specific OWNERS for now Created 3 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 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 "bindings/core/v8/ScriptPromiseResolver.h"
yhirano 2017/04/07 02:39:36 These two lines are no longer needed.
Mircea Trofin 2017/04/07 06:11:16 Done.
9 #include "bindings/core/v8/ScriptState.h"
8 #include "core/dom/DOMArrayBuffer.h" 10 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/streams/Stream.h" 11 #include "core/streams/Stream.h"
10 #include "modules/ModulesExport.h" 12 #include "modules/ModulesExport.h"
11 #include "platform/blob/BlobData.h" 13 #include "platform/blob/BlobData.h"
12 #include "platform/heap/Handle.h" 14 #include "platform/heap/Handle.h"
13 #include "wtf/Forward.h" 15 #include "wtf/Forward.h"
14 16
15 namespace blink { 17 namespace blink {
16 18
17 class BytesConsumer; 19 class BytesConsumer;
(...skipping 10 matching lines...) Expand all
28 // called anymore. 30 // called anymore.
29 class MODULES_EXPORT FetchDataLoader 31 class MODULES_EXPORT FetchDataLoader
30 : public GarbageCollectedFinalized<FetchDataLoader> { 32 : public GarbageCollectedFinalized<FetchDataLoader> {
31 public: 33 public:
32 class MODULES_EXPORT Client : public GarbageCollectedMixin { 34 class MODULES_EXPORT Client : public GarbageCollectedMixin {
33 public: 35 public:
34 virtual ~Client() {} 36 virtual ~Client() {}
35 37
36 // The method corresponding to createLoaderAs... is called on success. 38 // The method corresponding to createLoaderAs... is called on success.
37 virtual void didFetchDataLoadedBlobHandle(PassRefPtr<BlobDataHandle>) { 39 virtual void didFetchDataLoadedBlobHandle(PassRefPtr<BlobDataHandle>) {
38 ASSERT_NOT_REACHED(); 40 NOTREACHED();
39 } 41 }
40 virtual void didFetchDataLoadedArrayBuffer(DOMArrayBuffer*) { 42 virtual void didFetchDataLoadedArrayBuffer(DOMArrayBuffer*) {
41 ASSERT_NOT_REACHED(); 43 NOTREACHED();
42 } 44 }
43 virtual void didFetchDataLoadedString(const String&) { 45 virtual void didFetchDataLoadedString(const String&) { NOTREACHED(); }
44 ASSERT_NOT_REACHED();
45 }
46 // This is called after all data are read from |handle| and written 46 // This is called after all data are read from |handle| and written
47 // to |outStream|, and |outStream| is closed or aborted. 47 // to |outStream|, and |outStream| is closed or aborted.
48 virtual void didFetchDataLoadedStream() { ASSERT_NOT_REACHED(); } 48 virtual void didFetchDataLoadedStream() { NOTREACHED(); }
49
50 virtual void didFetchDataLoadedCustomFormat() { NOTREACHED(); }
yhirano 2017/04/07 02:39:36 // This function is called when a "custom" FetchDa
Mircea Trofin 2017/04/07 06:11:16 Done.
49 51
50 virtual void didFetchDataLoadFailed() = 0; 52 virtual void didFetchDataLoadFailed() = 0;
51 53
52 DEFINE_INLINE_VIRTUAL_TRACE() {} 54 DEFINE_INLINE_VIRTUAL_TRACE() {}
53 }; 55 };
54 56
55 static FetchDataLoader* createLoaderAsBlobHandle(const String& mimeType); 57 static FetchDataLoader* createLoaderAsBlobHandle(const String& mimeType);
56 static FetchDataLoader* createLoaderAsArrayBuffer(); 58 static FetchDataLoader* createLoaderAsArrayBuffer();
57 static FetchDataLoader* createLoaderAsString(); 59 static FetchDataLoader* createLoaderAsString();
58 static FetchDataLoader* createLoaderAsStream(Stream* outStream); 60 static FetchDataLoader* createLoaderAsStream(Stream*);
59
60 virtual ~FetchDataLoader() {} 61 virtual ~FetchDataLoader() {}
61 62
62 // |consumer| must not have a client when called. 63 // |consumer| must not have a client when called.
63 virtual void start(BytesConsumer* /* consumer */, Client*) = 0; 64 virtual void start(BytesConsumer* /* consumer */, Client*) = 0;
64 65
65 virtual void cancel() = 0; 66 virtual void cancel() = 0;
66 67
67 DEFINE_INLINE_VIRTUAL_TRACE() {} 68 DEFINE_INLINE_VIRTUAL_TRACE() {}
68 }; 69 };
69 70
70 } // namespace blink 71 } // namespace blink
71 72
72 #endif // FetchDataLoader_h 73 #endif // FetchDataLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698