Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 UnderlyingSourceBase_h | |
| 6 #define UnderlyingSourceBase_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptPromise.h" | |
|
yhirano
2016/01/25 11:10:33
+ScriptState.h
domenic
2016/02/02 22:59:56
done
| |
| 9 #include "bindings/core/v8/ScriptValue.h" | |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | |
| 11 #include "core/CoreExport.h" | |
| 12 #include "core/dom/ActiveDOMObject.h" | |
| 13 #include "platform/heap/Handle.h" | |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 class ReadableStreamController; | |
| 18 | |
| 19 class CORE_EXPORT UnderlyingSourceBase : public GarbageCollectedFinalized<Underl yingSourceBase>, public ScriptWrappable, public ActiveDOMObject { | |
| 20 DEFINE_WRAPPERTYPEINFO(); | |
| 21 | |
| 22 public: | |
| 23 DECLARE_VIRTUAL_TRACE(); | |
| 24 virtual ~UnderlyingSourceBase() {} | |
| 25 | |
| 26 ScriptPromise startWrapper(ScriptState*, ScriptValue stream); | |
| 27 virtual ScriptPromise start(ScriptState*); | |
| 28 | |
| 29 virtual ScriptPromise pull(ScriptState*); | |
| 30 | |
| 31 ScriptPromise cancelWrapper(ScriptState*, ScriptValue reason); | |
| 32 virtual ScriptPromise cancel(ScriptState*, ScriptValue reason); | |
| 33 | |
| 34 // ActiveDOMObject | |
| 35 bool hasPendingActivity() const override; | |
| 36 | |
| 37 protected: | |
| 38 UnderlyingSourceBase(ScriptState* scriptState) | |
|
haraken
2016/01/25 00:13:29
Add explicit.
domenic
2016/02/02 22:59:55
done
| |
| 39 : ActiveDOMObject(scriptState->executionContext()) | |
| 40 { | |
| 41 this->suspendIfNeeded(); | |
|
haraken
2016/01/25 00:13:29
Nit: We normally use a create function.
Underlyin
domenic
2016/02/02 22:59:55
I cannot figure out how to do this without making
| |
| 42 } | |
| 43 | |
| 44 ReadableStreamController* controller() { return m_controller; } | |
|
haraken
2016/01/25 00:13:29
Add const.
domenic
2016/02/02 22:59:55
done
| |
| 45 | |
| 46 private: | |
| 47 Member<ReadableStreamController> m_controller; | |
| 48 }; | |
| 49 | |
| 50 } // namespace blink | |
| 51 | |
| 52 #endif // UnderlyingSourceBase_h | |
| OLD | NEW |