Changeset 252003 in webkit
- Timestamp:
- Nov 4, 2019 10:56:35 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r251998 r252003 1 2019-11-04 Chris Dumez <cdumez@apple.com> 2 3 MediaRecorder should not prevent entering the back/forward cache 4 https://bugs.webkit.org/show_bug.cgi?id=203093 5 <rdar://problem/56748870> 6 7 Reviewed by Eric Carlson. 8 9 Add layout test coverage. 10 11 * fast/history/page-cache-media-recorder-expected.txt: Added. 12 * fast/history/page-cache-media-recorder.html: Added. 13 1 14 2019-11-04 Yury Semikhatsky <yurys@chromium.org> 2 15 -
trunk/LayoutTests/platform/win/TestExpectations
r251786 r252003 4237 4237 imported/w3c/web-platform-tests/mediacapture-record [ Skip ] 4238 4238 fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext.html [ Skip ] 4239 fast/history/page-cache-media-recorder.html [ Skip ] 4239 4240 http/wpt/mediarecorder [ Skip ] 4240 4241 -
trunk/Source/WebCore/ChangeLog
r252000 r252003 1 2019-11-04 Chris Dumez <cdumez@apple.com> 2 3 MediaRecorder should not prevent entering the back/forward cache 4 https://bugs.webkit.org/show_bug.cgi?id=203093 5 <rdar://problem/56748870> 6 7 Reviewed by Eric Carlson. 8 9 Let pages using MediaRecorder enter the back/forward cache. On suspension, we 10 stop recording and we queue an error event which will get dispatched upon 11 resuming. 12 13 Test: fast/history/page-cache-media-recorder.html 14 15 * Modules/mediarecorder/MediaRecorder.cpp: 16 (WebCore::MediaRecorder::document const): 17 (WebCore::MediaRecorder::suspend): 18 (WebCore::MediaRecorder::activeDOMObjectName const): 19 (WebCore::MediaRecorder::scheduleDeferredTask): 20 (WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted. 21 * Modules/mediarecorder/MediaRecorder.h: 22 1 23 2019-11-04 Alex Christensen <achristensen@webkit.org> 2 24 -
trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
r251244 r252003 36 36 #include "MediaRecorderPrivate.h" 37 37 #include "SharedBuffer.h" 38 #include "WindowEventLoop.h" 38 39 #include <wtf/IsoMallocInlines.h> 39 40 … … 94 95 } 95 96 97 Document* MediaRecorder::document() const 98 { 99 return downcast<Document>(scriptExecutionContext()); 100 } 101 96 102 void MediaRecorder::stop() 97 103 { … … 100 106 } 101 107 108 void MediaRecorder::suspend(ReasonForSuspension reason) 109 { 110 if (reason != ReasonForSuspension::BackForwardCache) 111 return; 112 113 if (!m_isActive || state() == RecordingState::Inactive) 114 return; 115 116 stopRecordingInternal(); 117 118 scheduleDeferredTask([this] { 119 dispatchEvent(MediaRecorderErrorEvent::create(eventNames().errorEvent, Exception { UnknownError, "MediaStream recording was interrupted"_s })); 120 }); 121 } 122 102 123 const char* MediaRecorder::activeDOMObjectName() const 103 124 { 104 125 return "MediaRecorder"; 105 }106 107 bool MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED() const108 {109 return true; // FIXME: We should do better here as this prevents entering BackForwardCache.110 126 } 111 127 … … 197 213 { 198 214 ASSERT(function); 199 auto* scriptExecutionContext = this->scriptExecutionContext();200 if (! scriptExecutionContext)201 return; 202 203 scriptExecutionContext->postTask([protectedThis = makeRef(*this), function = WTFMove(function)] (auto&){215 auto* document = this->document(); 216 if (!document) 217 return; 218 219 document->eventLoop().queueTask(TaskSource::Networking, *document, [pendingActivity = makePendingActivity(*this), function = WTFMove(function)] { 204 220 function(); 205 221 }); -
trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.h
r251244 r252003 80 80 Ref<Blob> createRecordingDataBlob(); 81 81 82 Document* document() const; 83 82 84 // EventTarget 83 85 void refEventTarget() final { ref(); } … … 87 89 88 90 // ActiveDOMObject API. 91 void suspend(ReasonForSuspension) final; 89 92 void stop() final; 90 93 const char* activeDOMObjectName() const final; 91 bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;92 94 93 95 void stopRecordingInternal();
Note: See TracChangeset
for help on using the changeset viewer.