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

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

Issue 1902963003: [Streams] UnderlyingSourceBase should be kept alive only when locked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-stream-operations
Patch Set: Created 4 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 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/ActiveScriptWrappable.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 17 matching lines...) Expand all
28 virtual ~UnderlyingSourceBase() {} 28 virtual ~UnderlyingSourceBase() {}
29 29
30 ScriptPromise startWrapper(ScriptState*, ScriptValue stream); 30 ScriptPromise startWrapper(ScriptState*, ScriptValue stream);
31 virtual ScriptPromise start(ScriptState*); 31 virtual ScriptPromise start(ScriptState*);
32 32
33 virtual ScriptPromise pull(ScriptState*); 33 virtual ScriptPromise pull(ScriptState*);
34 34
35 ScriptPromise cancelWrapper(ScriptState*, ScriptValue reason); 35 ScriptPromise cancelWrapper(ScriptState*, ScriptValue reason);
36 virtual ScriptPromise cancel(ScriptState*, ScriptValue reason); 36 virtual ScriptPromise cancel(ScriptState*, ScriptValue reason);
37 37
38 void notifyLockAcquired();
39 void notifyLockReleased();
40
38 // ActiveScriptWrappable 41 // ActiveScriptWrappable
39 bool hasPendingActivity() const final; 42 bool hasPendingActivity() const final;
40 43
41 // ActiveDOMObject 44 // ActiveDOMObject
42 void stop() override; 45 void stop() override;
43 46
44 protected: 47 protected:
45 explicit UnderlyingSourceBase(ScriptState* scriptState) 48 explicit UnderlyingSourceBase(ScriptState* scriptState)
46 : ActiveScriptWrappable(this) 49 : ActiveScriptWrappable(this)
47 , ActiveDOMObject(scriptState->getExecutionContext()) 50 , ActiveDOMObject(scriptState->getExecutionContext())
48 { 51 {
49 this->suspendIfNeeded(); 52 this->suspendIfNeeded();
50 } 53 }
51 54
52 ReadableStreamController* controller() const { return m_controller; } 55 ReadableStreamController* controller() const { return m_controller; }
53 56
54 private: 57 private:
55 Member<ReadableStreamController> m_controller; 58 Member<ReadableStreamController> m_controller;
59 bool m_isStreamLocked = false;
56 }; 60 };
57 61
58 } // namespace blink 62 } // namespace blink
59 63
60 #endif // UnderlyingSourceBase_h 64 #endif // UnderlyingSourceBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698