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

Side by Side Diff: third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 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 2016 The Chromium Authors. All rights reserved. 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 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 UnderlyingSourceBase_h 5 #ifndef UnderlyingSourceBase_h
6 #define UnderlyingSourceBase_h 6 #define UnderlyingSourceBase_h
7 7
8 #include "bindings/core/v8/ActiveScriptWrappable.h"
8 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptValue.h" 11 #include "bindings/core/v8/ScriptValue.h"
11 #include "bindings/core/v8/ScriptWrappable.h" 12 #include "bindings/core/v8/ScriptWrappable.h"
12 #include "core/CoreExport.h" 13 #include "core/CoreExport.h"
13 #include "core/dom/ActiveDOMObject.h" 14 #include "core/dom/ActiveDOMObject.h"
14 #include "platform/heap/GarbageCollected.h" 15 #include "platform/heap/GarbageCollected.h"
15 #include "platform/heap/Handle.h" 16 #include "platform/heap/Handle.h"
16 17
17 namespace blink { 18 namespace blink {
18 19
19 class ReadableStreamController; 20 class ReadableStreamController;
20 21
21 class CORE_EXPORT UnderlyingSourceBase : public GarbageCollectedFinalized<Underl yingSourceBase>, public ScriptWrappable, public ActiveDOMObject { 22 class CORE_EXPORT UnderlyingSourceBase : public GarbageCollectedFinalized<Underl yingSourceBase>, public ScriptWrappable, public ActiveScriptWrappable, public Ac tiveDOMObject {
22 DEFINE_WRAPPERTYPEINFO(); 23 DEFINE_WRAPPERTYPEINFO();
23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(UnderlyingSourceBase); 24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(UnderlyingSourceBase);
24 25
25 public: 26 public:
26 DECLARE_VIRTUAL_TRACE(); 27 DECLARE_VIRTUAL_TRACE();
27 virtual ~UnderlyingSourceBase() {} 28 virtual ~UnderlyingSourceBase() {}
28 29
29 ScriptPromise startWrapper(ScriptState*, ScriptValue stream); 30 ScriptPromise startWrapper(ScriptState*, ScriptValue stream);
30 virtual ScriptPromise start(ScriptState*); 31 virtual ScriptPromise start(ScriptState*);
31 32
32 virtual ScriptPromise pull(ScriptState*); 33 virtual ScriptPromise pull(ScriptState*);
33 34
34 ScriptPromise cancelWrapper(ScriptState*, ScriptValue reason); 35 ScriptPromise cancelWrapper(ScriptState*, ScriptValue reason);
35 virtual ScriptPromise cancel(ScriptState*, ScriptValue reason); 36 virtual ScriptPromise cancel(ScriptState*, ScriptValue reason);
36 37
38 // ActiveScriptWrappable
39 bool hasPendingActivity() const final;
40
37 // ActiveDOMObject 41 // ActiveDOMObject
38 bool hasPendingActivity() const override;
39 void stop() override; 42 void stop() override;
40 43
41 protected: 44 protected:
42 explicit UnderlyingSourceBase(ScriptState* scriptState) 45 explicit UnderlyingSourceBase(ScriptState* scriptState)
43 : ActiveDOMObject(scriptState->getExecutionContext()) 46 : ActiveScriptWrappable(this)
47 , ActiveDOMObject(scriptState->getExecutionContext())
44 { 48 {
45 this->suspendIfNeeded(); 49 this->suspendIfNeeded();
46 } 50 }
47 51
48 ReadableStreamController* controller() const { return m_controller; } 52 ReadableStreamController* controller() const { return m_controller; }
49 53
50 private: 54 private:
51 Member<ReadableStreamController> m_controller; 55 Member<ReadableStreamController> m_controller;
52 }; 56 };
53 57
54 } // namespace blink 58 } // namespace blink
55 59
56 #endif // UnderlyingSourceBase_h 60 #endif // UnderlyingSourceBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698