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

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

Issue 2177243002: Use per-frame TaskRunner instead of thread's default in DataConsumerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_consumer_handle_unique_ptr
Patch Set: update Created 4 years, 4 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 // This is called after all data are read from |handle| and written 48 // This is called after all data are read from |handle| and written
49 // to |outStream|, and |outStream| is closed or aborted. 49 // to |outStream|, and |outStream| is closed or aborted.
50 virtual void didFetchDataLoadedStream() 50 virtual void didFetchDataLoadedStream()
51 { 51 {
52 ASSERT_NOT_REACHED(); 52 ASSERT_NOT_REACHED();
53 } 53 }
54 54
55 virtual void didFetchDataLoadFailed() = 0; 55 virtual void didFetchDataLoadFailed() = 0;
56 56
57 virtual WebTaskRunner* getTaskRunner() = 0;
58
57 DEFINE_INLINE_VIRTUAL_TRACE() { } 59 DEFINE_INLINE_VIRTUAL_TRACE() { }
58 }; 60 };
59 61
60 static FetchDataLoader* createLoaderAsBlobHandle(const String& mimeType); 62 static FetchDataLoader* createLoaderAsBlobHandle(const String& mimeType);
61 static FetchDataLoader* createLoaderAsArrayBuffer(); 63 static FetchDataLoader* createLoaderAsArrayBuffer();
62 static FetchDataLoader* createLoaderAsString(); 64 static FetchDataLoader* createLoaderAsString();
63 static FetchDataLoader* createLoaderAsStream(Stream* outStream); 65 static FetchDataLoader* createLoaderAsStream(Stream* outStream);
64 66
65 virtual ~FetchDataLoader() { } 67 virtual ~FetchDataLoader() { }
66 68
67 // start() should be called only once on the created thread. 69 // start() should be called only once on the created thread.
68 // start() do not take the ownership of |handle|. 70 // start() do not take the ownership of |handle|.
69 // |handle| must not be locked when called. 71 // |handle| must not be locked when called.
70 virtual void start(FetchDataConsumerHandle* /* handle */, Client*) = 0; 72 virtual void start(FetchDataConsumerHandle* /* handle */, Client*) = 0;
71 73
72 virtual void cancel() = 0; 74 virtual void cancel() = 0;
73 75
74 DEFINE_INLINE_VIRTUAL_TRACE() { } 76 DEFINE_INLINE_VIRTUAL_TRACE() { }
75 }; 77 };
76 78
77 } // namespace blink 79 } // namespace blink
78 80
79 #endif // FetchDataLoader_h 81 #endif // FetchDataLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698