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

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

Issue 2780693003: [wasm] response-based compile APIs (Closed)
Patch Set: simplify 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 "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/streams/Stream.h" 9 #include "core/streams/Stream.h"
10 #include "modules/ModulesExport.h" 10 #include "modules/ModulesExport.h"
(...skipping 17 matching lines...) Expand all
28 // called anymore. 28 // called anymore.
29 class MODULES_EXPORT FetchDataLoader 29 class MODULES_EXPORT FetchDataLoader
30 : public GarbageCollectedFinalized<FetchDataLoader> { 30 : public GarbageCollectedFinalized<FetchDataLoader> {
31 public: 31 public:
32 class MODULES_EXPORT Client : public GarbageCollectedMixin { 32 class MODULES_EXPORT Client : public GarbageCollectedMixin {
33 public: 33 public:
34 virtual ~Client() {} 34 virtual ~Client() {}
35 35
36 // The method corresponding to createLoaderAs... is called on success. 36 // The method corresponding to createLoaderAs... is called on success.
37 virtual void didFetchDataLoadedBlobHandle(PassRefPtr<BlobDataHandle>) { 37 virtual void didFetchDataLoadedBlobHandle(PassRefPtr<BlobDataHandle>) {
38 ASSERT_NOT_REACHED(); 38 NOTREACHED();
39 } 39 }
40 virtual void didFetchDataLoadedArrayBuffer(DOMArrayBuffer*) { 40 virtual void didFetchDataLoadedArrayBuffer(DOMArrayBuffer*) {
41 ASSERT_NOT_REACHED(); 41 NOTREACHED();
42 } 42 }
43 virtual void didFetchDataLoadedString(const String&) { 43 virtual void didFetchDataLoadedString(const String&) { NOTREACHED(); }
44 ASSERT_NOT_REACHED();
45 }
46 // This is called after all data are read from |handle| and written 44 // This is called after all data are read from |handle| and written
47 // to |outStream|, and |outStream| is closed or aborted. 45 // to |outStream|, and |outStream| is closed or aborted.
48 virtual void didFetchDataLoadedStream() { ASSERT_NOT_REACHED(); } 46 virtual void didFetchDataLoadedStream() { NOTREACHED(); }
47
48 // This function is called when a "custom" FetchDataLoader (none of the
49 // ones listed above) finishes loading.
50 virtual void didFetchDataLoadedCustomFormat() { NOTREACHED(); }
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