Chromium Code Reviews| Index: third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h |
| diff --git a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cfc6c63f20c7a96c80154fa430af47ee9d54c192 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UnderlyingSourceBase_h |
| +#define UnderlyingSourceBase_h |
| + |
| +#include "bindings/core/v8/ScriptPromise.h" |
|
yhirano
2016/01/25 11:10:33
+ScriptState.h
domenic
2016/02/02 22:59:56
done
|
| +#include "bindings/core/v8/ScriptValue.h" |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "core/CoreExport.h" |
| +#include "core/dom/ActiveDOMObject.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class ReadableStreamController; |
| + |
| +class CORE_EXPORT UnderlyingSourceBase : public GarbageCollectedFinalized<UnderlyingSourceBase>, public ScriptWrappable, public ActiveDOMObject { |
| + DEFINE_WRAPPERTYPEINFO(); |
| + |
| +public: |
| + DECLARE_VIRTUAL_TRACE(); |
| + virtual ~UnderlyingSourceBase() {} |
| + |
| + ScriptPromise startWrapper(ScriptState*, ScriptValue stream); |
| + virtual ScriptPromise start(ScriptState*); |
| + |
| + virtual ScriptPromise pull(ScriptState*); |
| + |
| + ScriptPromise cancelWrapper(ScriptState*, ScriptValue reason); |
| + virtual ScriptPromise cancel(ScriptState*, ScriptValue reason); |
| + |
| + // ActiveDOMObject |
| + bool hasPendingActivity() const override; |
| + |
| +protected: |
| + UnderlyingSourceBase(ScriptState* scriptState) |
|
haraken
2016/01/25 00:13:29
Add explicit.
domenic
2016/02/02 22:59:55
done
|
| + : ActiveDOMObject(scriptState->executionContext()) |
| + { |
| + 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
|
| + } |
| + |
| + ReadableStreamController* controller() { return m_controller; } |
|
haraken
2016/01/25 00:13:29
Add const.
domenic
2016/02/02 22:59:55
done
|
| + |
| +private: |
| + Member<ReadableStreamController> m_controller; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // UnderlyingSourceBase_h |