Title: [259135] trunk/Source/WebCore
- Revision
- 259135
- Author
- [email protected]
- Date
- 2020-03-27 13:33:25 -0700 (Fri, 27 Mar 2020)
Log Message
[StressGC] ASSERTION FAILED: m_wrapper under WebCore::MediaRecorder::dispatchError
https://bugs.webkit.org/show_bug.cgi?id=209674
<rdar://problem/60541201>
Reviewed by Darin Adler.
Keep the MediaRecorder wrapper alive while its state is not inactive (i.e. it is recording
or paused), as it may still dispatch events.
Also drop MediaRecorder::scheduleDeferredTask() and use the utility functions in
ActiveDOMObject instead to achieve the same thing.
No new tests, already covered by http/wpt/mediarecorder/MediaRecorder-onremovetrack.html.
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::suspend):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::didAddOrRemoveTrack):
(WebCore::MediaRecorder::hasPendingActivity const):
(WebCore::MediaRecorder::scheduleDeferredTask): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (259134 => 259135)
--- trunk/Source/WebCore/ChangeLog 2020-03-27 19:48:03 UTC (rev 259134)
+++ trunk/Source/WebCore/ChangeLog 2020-03-27 20:33:25 UTC (rev 259135)
@@ -1,5 +1,29 @@
2020-03-27 Chris Dumez <[email protected]>
+ [StressGC] ASSERTION FAILED: m_wrapper under WebCore::MediaRecorder::dispatchError
+ https://bugs.webkit.org/show_bug.cgi?id=209674
+ <rdar://problem/60541201>
+
+ Reviewed by Darin Adler.
+
+ Keep the MediaRecorder wrapper alive while its state is not inactive (i.e. it is recording
+ or paused), as it may still dispatch events.
+
+ Also drop MediaRecorder::scheduleDeferredTask() and use the utility functions in
+ ActiveDOMObject instead to achieve the same thing.
+
+ No new tests, already covered by http/wpt/mediarecorder/MediaRecorder-onremovetrack.html.
+
+ * Modules/mediarecorder/MediaRecorder.cpp:
+ (WebCore::MediaRecorder::suspend):
+ (WebCore::MediaRecorder::stopRecording):
+ (WebCore::MediaRecorder::didAddOrRemoveTrack):
+ (WebCore::MediaRecorder::hasPendingActivity const):
+ (WebCore::MediaRecorder::scheduleDeferredTask): Deleted.
+ * Modules/mediarecorder/MediaRecorder.h:
+
+2020-03-27 Chris Dumez <[email protected]>
+
[StressGC] ASSERTION FAILED: m_wrapper under WebCore::WebGLRenderingContextBase::dispatchContextLostEvent
https://bugs.webkit.org/show_bug.cgi?id=209660
<rdar://problem/60541733>
Modified: trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp (259134 => 259135)
--- trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp 2020-03-27 19:48:03 UTC (rev 259134)
+++ trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp 2020-03-27 20:33:25 UTC (rev 259135)
@@ -121,9 +121,7 @@
stopRecordingInternal();
- scheduleDeferredTask([this] {
- dispatchEvent(MediaRecorderErrorEvent::create(eventNames().errorEvent, Exception { UnknownError, "MediaStream recording was interrupted"_s }));
- });
+ queueTaskToDispatchEvent(*this, TaskSource::Networking, MediaRecorderErrorEvent::create(eventNames().errorEvent, Exception { UnknownError, "MediaStream recording was interrupted"_s }));
}
const char* MediaRecorder::activeDOMObjectName() const
@@ -149,7 +147,7 @@
if (state() == RecordingState::Inactive)
return Exception { InvalidStateError, "The MediaRecorder's state cannot be inactive"_s };
- scheduleDeferredTask([this] {
+ queueTaskKeepingObjectAlive(*this, TaskSource::Networking, [this] {
if (!m_isActive || state() == RecordingState::Inactive)
return;
@@ -198,7 +196,7 @@
void MediaRecorder::didAddOrRemoveTrack()
{
- scheduleDeferredTask([this] {
+ queueTaskKeepingObjectAlive(*this, TaskSource::Networking, [this] {
if (!m_isActive || state() == RecordingState::Inactive)
return;
stopRecordingInternal();
@@ -234,16 +232,9 @@
m_private->audioSamplesAvailable(track, mediaTime, audioData, description, sampleCount);
}
-void MediaRecorder::scheduleDeferredTask(Function<void()>&& function)
+bool MediaRecorder::hasPendingActivity() const
{
- ASSERT(function);
- auto* document = this->document();
- if (!document)
- return;
-
- document->eventLoop().queueTask(TaskSource::Networking, [pendingActivity = makePendingActivity(*this), function = WTFMove(function)] {
- function();
- });
+ return ActiveDOMObject::hasPendingActivity() || m_state != RecordingState::Inactive;
}
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.h (259134 => 259135)
--- trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.h 2020-03-27 19:48:03 UTC (rev 259134)
+++ trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.h 2020-03-27 20:33:25 UTC (rev 259135)
@@ -75,6 +75,8 @@
MediaStream& stream() { return m_stream.get(); }
+ bool hasPendingActivity() const final;
+
private:
MediaRecorder(Document&, Ref<MediaStream>&&, std::unique_ptr<MediaRecorderPrivate>&&, Options&& = { });
@@ -108,8 +110,6 @@
void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) final;
void audioSamplesAvailable(MediaStreamTrackPrivate&, const MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final;
- void scheduleDeferredTask(Function<void()>&&);
-
static creatorFunction m_customCreator;
Options m_options;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes