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

Unified Diff: third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp
diff --git a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp
index d4d3ed75505136e03964917bcd27f9117416f8c4..b63fe960860111b84c995e15bd4ffeda51ab5471 100644
--- a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp
+++ b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp
@@ -46,13 +46,23 @@ ScriptPromise UnderlyingSourceBase::cancel(ScriptState* scriptState, ScriptValue
return ScriptPromise::castUndefined(scriptState);
}
+void UnderlyingSourceBase::notifyLockAcquired()
+{
+ m_isStreamLocked = true;
+}
+
+void UnderlyingSourceBase::notifyLockReleased()
+{
+ m_isStreamLocked = false;
+}
+
bool UnderlyingSourceBase::hasPendingActivity() const
{
// This will return false within a finite time period _assuming_ that
// consumers use the controller to close or error the stream.
// Browser-created readable streams should always close or error within a
// finite time period, due to timeouts etc.
- return m_controller && m_controller->isActive();
+ return m_controller && m_controller->isActive() && m_isStreamLocked;
}
void UnderlyingSourceBase::stop()

Powered by Google App Engine
This is Rietveld 408576698