Changeset 287066 in webkit
- Timestamp:
- Dec 15, 2021, 1:16:02 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 25 edited
-
ChangeLog (modified) (1 diff)
-
Modules/applepay/ApplePaySession.cpp (modified) (2 diffs)
-
Modules/applepay/ApplePaySetup.cpp (modified) (1 diff)
-
Modules/applepay/ApplePaySetupWebCore.h (modified) (1 diff)
-
Modules/cache/DOMCache.cpp (modified) (2 diffs)
-
Modules/cache/DOMCache.h (modified) (1 diff)
-
Modules/cache/DOMCacheStorage.cpp (modified) (1 diff)
-
Modules/cache/DOMCacheStorage.h (modified) (1 diff)
-
Modules/entriesapi/FileSystemDirectoryReader.cpp (modified) (1 diff)
-
Modules/entriesapi/FileSystemDirectoryReader.h (modified) (1 diff)
-
Modules/filesystemaccess/FileSystemSyncAccessHandle.cpp (modified) (2 diffs)
-
Modules/geolocation/Geolocation.cpp (modified) (1 diff)
-
Modules/mediastream/MediaStream.cpp (modified) (3 diffs)
-
Modules/mediastream/RTCDTMFSender.cpp (modified) (1 diff)
-
Modules/paymentrequest/PaymentRequest.cpp (modified) (2 diffs)
-
Modules/remoteplayback/RemotePlayback.cpp (modified) (2 diffs)
-
Modules/webaudio/ScriptProcessorNode.cpp (modified) (2 diffs)
-
Modules/webxr/WebXRSession.cpp (modified) (2 diffs)
-
Modules/webxr/WebXRSystem.cpp (modified) (2 diffs)
-
css/CSSFontSelector.cpp (modified) (2 diffs)
-
css/CSSFontSelector.h (modified) (1 diff)
-
dom/MessagePort.cpp (modified) (2 diffs)
-
workers/WorkerAnimationController.cpp (modified) (2 diffs)
-
workers/service/ServiceWorker.cpp (modified) (2 diffs)
-
workers/service/ServiceWorkerRegistration.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r287065 r287066 1 2021-12-15 Antoine Quint <graouts@webkit.org> 2 3 ActiveDOMObject::suspendIfNeeded() should not be called within constructors 4 https://bugs.webkit.org/show_bug.cgi?id=233945 5 6 Reviewed by Chris Dumez and Darin Adler. 7 8 * Modules/applepay/ApplePaySession.cpp: 9 (WebCore::ApplePaySession::create): 10 * Modules/applepay/ApplePaySetup.cpp: 11 (WebCore::ApplePaySetup::create): 12 (WebCore::ApplePaySetup::ApplePaySetup): 13 * Modules/applepay/ApplePaySetupWebCore.h: 14 (WebCore::ApplePaySetup::create): Deleted. 15 * Modules/cache/DOMCache.cpp: 16 (WebCore::DOMCache::create): 17 (WebCore::DOMCache::DOMCache): 18 * Modules/cache/DOMCache.h: 19 * Modules/cache/DOMCacheStorage.cpp: 20 (WebCore::DOMCacheStorage::create): 21 (WebCore::DOMCacheStorage::DOMCacheStorage): 22 * Modules/cache/DOMCacheStorage.h: 23 (WebCore::DOMCacheStorage::create): Deleted. 24 * Modules/entriesapi/FileSystemDirectoryReader.cpp: 25 (WebCore::FileSystemDirectoryReader::create): 26 (WebCore::FileSystemDirectoryReader::FileSystemDirectoryReader): 27 * Modules/entriesapi/FileSystemDirectoryReader.h: 28 * Modules/filesystemaccess/FileSystemSyncAccessHandle.cpp: 29 (WebCore::FileSystemSyncAccessHandle::create): 30 (WebCore::FileSystemSyncAccessHandle::FileSystemSyncAccessHandle): 31 * Modules/geolocation/Geolocation.cpp: 32 (WebCore::Geolocation::create): 33 * Modules/mediastream/MediaStream.cpp: 34 (WebCore::MediaStream::create): 35 (WebCore::MediaStream::MediaStream): 36 * Modules/paymentrequest/PaymentRequest.cpp: 37 (WebCore::PaymentRequest::create): 38 * Modules/remoteplayback/RemotePlayback.cpp: 39 (WebCore::RemotePlayback::create): 40 (WebCore::RemotePlayback::RemotePlayback): 41 * Modules/webaudio/ScriptProcessorNode.cpp: 42 (WebCore::ScriptProcessorNode::create): 43 (WebCore::ScriptProcessorNode::ScriptProcessorNode): 44 * Modules/webxr/WebXRSession.cpp: 45 (WebCore::WebXRSession::create): 46 (WebCore::WebXRSession::WebXRSession): 47 * Modules/webxr/WebXRSystem.cpp: 48 (WebCore::WebXRSystem::create): 49 (WebCore::WebXRSystem::WebXRSystem): 50 * css/CSSFontSelector.cpp: 51 (WebCore::CSSFontSelector::create): 52 (WebCore::m_version): 53 * css/CSSFontSelector.h: 54 * dom/MessagePort.cpp: 55 (WebCore::MessagePort::create): 56 (WebCore::MessagePort::MessagePort): 57 * workers/WorkerAnimationController.cpp: 58 (WebCore::WorkerAnimationController::create): 59 (WebCore::WorkerAnimationController::WorkerAnimationController): 60 * workers/service/ServiceWorker.cpp: 61 (WebCore::ServiceWorker::getOrCreate): 62 (WebCore::ServiceWorker::ServiceWorker): 63 * workers/service/ServiceWorkerRegistration.cpp: 64 (WebCore::ServiceWorkerRegistration::getOrCreate): 65 (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): 66 1 67 2021-12-15 Diego Pino Garcia <dpino@igalia.com> 2 68 -
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
r286452 r287066 334 334 return convertedPaymentRequest.releaseException(); 335 335 336 return adoptRef(*new ApplePaySession(document, version, convertedPaymentRequest.releaseReturnValue())); 336 auto session = adoptRef(*new ApplePaySession(document, version, convertedPaymentRequest.releaseReturnValue())); 337 session->suspendIfNeeded(); 338 return session; 337 339 } 338 340 … … 343 345 { 344 346 ASSERT(document.page()->paymentCoordinator().supportsVersion(document, version)); 345 suspendIfNeeded();346 347 } 347 348 -
trunk/Source/WebCore/Modules/applepay/ApplePaySetup.cpp
r286496 r287066 116 116 } 117 117 118 Ref<ApplePaySetup> ApplePaySetup::create(ScriptExecutionContext& context, ApplePaySetupConfiguration&& configuration) 119 { 120 auto setup = adoptRef(*new ApplePaySetup(context, WTFMove(configuration))); 121 setup->suspendIfNeeded(); 122 return setup; 123 } 124 118 125 ApplePaySetup::ApplePaySetup(ScriptExecutionContext& context, ApplePaySetupConfiguration&& configuration) 119 126 : ActiveDOMObject(&context) 120 127 , m_configuration(WTFMove(configuration)) 121 128 { 122 suspendIfNeeded();123 129 } 124 130 -
trunk/Source/WebCore/Modules/applepay/ApplePaySetupWebCore.h
r278253 r287066 44 44 class ApplePaySetup : public ActiveDOMObject, public RefCounted<ApplePaySetup> { 45 45 public: 46 static Ref<ApplePaySetup> create(ScriptExecutionContext& context, ApplePaySetupConfiguration&& configuration) 47 { 48 return adoptRef(*new ApplePaySetup(context, WTFMove(configuration))); 49 } 46 static Ref<ApplePaySetup> create(ScriptExecutionContext&, ApplePaySetupConfiguration&&); 50 47 51 48 using SetupFeaturesPromise = DOMPromiseDeferred<IDLSequence<IDLInterface<ApplePaySetupFeature>>>; -
trunk/Source/WebCore/Modules/cache/DOMCache.cpp
r287021 r287066 41 41 using namespace WebCore::DOMCacheEngine; 42 42 43 Ref<DOMCache> DOMCache::create(ScriptExecutionContext& context, String&& name, uint64_t identifier, Ref<CacheStorageConnection>&& connection) 44 { 45 auto cache = adoptRef(*new DOMCache(context, WTFMove(name), identifier, WTFMove(connection))); 46 cache->suspendIfNeeded(); 47 return cache; 48 } 49 43 50 DOMCache::DOMCache(ScriptExecutionContext& context, String&& name, uint64_t identifier, Ref<CacheStorageConnection>&& connection) 44 51 : ActiveDOMObject(&context) … … 47 54 , m_connection(WTFMove(connection)) 48 55 { 49 suspendIfNeeded();50 56 m_connection->reference(m_identifier); 51 57 } -
trunk/Source/WebCore/Modules/cache/DOMCache.h
r287021 r287066 38 38 class DOMCache final : public RefCounted<DOMCache>, public ActiveDOMObject { 39 39 public: 40 static Ref<DOMCache> create(ScriptExecutionContext& context, String&& name, uint64_t identifier, Ref<CacheStorageConnection>&& connection) { return adoptRef(*new DOMCache(context, WTFMove(name), identifier, WTFMove(connection))); }40 static Ref<DOMCache> create(ScriptExecutionContext&, String&&, uint64_t, Ref<CacheStorageConnection>&&); 41 41 ~DOMCache(); 42 42 -
trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp
r278253 r287066 37 37 namespace WebCore { 38 38 39 Ref<DOMCacheStorage> DOMCacheStorage::create(ScriptExecutionContext& context, Ref<CacheStorageConnection>&& connection) 40 { 41 auto cacheStorage = adoptRef(*new DOMCacheStorage(context, WTFMove(connection))); 42 cacheStorage->suspendIfNeeded(); 43 return cacheStorage; 44 } 45 39 46 DOMCacheStorage::DOMCacheStorage(ScriptExecutionContext& context, Ref<CacheStorageConnection>&& connection) 40 47 : ActiveDOMObject(&context) 41 48 , m_connection(WTFMove(connection)) 42 49 { 43 suspendIfNeeded();44 50 } 45 51 -
trunk/Source/WebCore/Modules/cache/DOMCacheStorage.h
r278253 r287066 35 35 class DOMCacheStorage : public RefCounted<DOMCacheStorage>, public ActiveDOMObject { 36 36 public: 37 static Ref<DOMCacheStorage> create(ScriptExecutionContext& context, Ref<CacheStorageConnection>&& connection) { return adoptRef(*new DOMCacheStorage(context, WTFMove(connection))); }37 static Ref<DOMCacheStorage> create(ScriptExecutionContext&, Ref<CacheStorageConnection>&&); 38 38 ~DOMCacheStorage(); 39 39 -
trunk/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp
r282860 r287066 42 42 WTF_MAKE_ISO_ALLOCATED_IMPL(FileSystemDirectoryReader); 43 43 44 Ref<FileSystemDirectoryReader> FileSystemDirectoryReader::create(ScriptExecutionContext& context, FileSystemDirectoryEntry& directory) 45 { 46 auto reader = adoptRef(*new FileSystemDirectoryReader(context, directory)); 47 reader->suspendIfNeeded(); 48 return reader; 49 } 50 44 51 FileSystemDirectoryReader::FileSystemDirectoryReader(ScriptExecutionContext& context, FileSystemDirectoryEntry& directory) 45 52 : ActiveDOMObject(&context) 46 53 , m_directory(directory) 47 54 { 48 suspendIfNeeded();49 55 } 50 56 -
trunk/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h
r278253 r287066 42 42 WTF_MAKE_ISO_ALLOCATED(FileSystemDirectoryReader); 43 43 public: 44 static Ref<FileSystemDirectoryReader> create(ScriptExecutionContext& context, FileSystemDirectoryEntry& directory) 45 { 46 return adoptRef(*new FileSystemDirectoryReader(context, directory)); 47 } 44 static Ref<FileSystemDirectoryReader> create(ScriptExecutionContext&, FileSystemDirectoryEntry&); 48 45 49 46 ~FileSystemDirectoryReader(); -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemSyncAccessHandle.cpp
r286414 r287066 38 38 Ref<FileSystemSyncAccessHandle> FileSystemSyncAccessHandle::create(ScriptExecutionContext& context, FileSystemFileHandle& source, FileSystemSyncAccessHandleIdentifier identifier, FileSystem::PlatformFileHandle file) 39 39 { 40 return adoptRef(*new FileSystemSyncAccessHandle(context, source, identifier, file)); 40 auto handle = adoptRef(*new FileSystemSyncAccessHandle(context, source, identifier, file)); 41 handle->suspendIfNeeded(); 42 return handle; 41 43 } 42 44 … … 48 50 { 49 51 ASSERT(m_file != FileSystem::invalidPlatformFileHandle); 50 suspendIfNeeded();51 52 52 53 m_source->registerSyncAccessHandle(m_identifier, *this); -
trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp
r286918 r287066 135 135 { 136 136 auto geolocation = adoptRef(*new Geolocation(navigator)); 137 geolocation .get().suspendIfNeeded();137 geolocation->suspendIfNeeded(); 138 138 return geolocation; 139 139 } -
trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp
r284080 r287066 51 51 Ref<MediaStream> MediaStream::create(Document& document, MediaStream& stream) 52 52 { 53 return adoptRef(*new MediaStream(document, stream.getTracks())); 53 auto mediaStream = adoptRef(*new MediaStream(document, stream.getTracks())); 54 mediaStream->suspendIfNeeded(); 55 return mediaStream; 54 56 } 55 57 56 58 Ref<MediaStream> MediaStream::create(Document& document, const MediaStreamTrackVector& tracks) 57 59 { 58 return adoptRef(*new MediaStream(document, tracks)); 60 auto mediaStream = adoptRef(*new MediaStream(document, tracks)); 61 mediaStream->suspendIfNeeded(); 62 return mediaStream; 59 63 } 60 64 61 65 Ref<MediaStream> MediaStream::create(Document& document, Ref<MediaStreamPrivate>&& streamPrivate) 62 66 { 63 return adoptRef(*new MediaStream(document, WTFMove(streamPrivate))); 67 auto mediaStream = adoptRef(*new MediaStream(document, WTFMove(streamPrivate))); 68 mediaStream->suspendIfNeeded(); 69 return mediaStream; 64 70 } 65 71 … … 83 89 setIsActive(m_private->active()); 84 90 m_private->addObserver(*this); 85 suspendIfNeeded();86 91 } 87 92 … … 97 102 setIsActive(m_private->active()); 98 103 m_private->addObserver(*this); 99 suspendIfNeeded();100 104 } 101 105 -
trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
r284057 r287066 52 52 onTonePlayed(); 53 53 }); 54 54 55 suspendIfNeeded(); 55 56 } -
trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
r286452 r287066 345 345 346 346 auto shippingOptionAndModifierData = detailsResult.releaseReturnValue(); 347 return adoptRef(*new PaymentRequest(document, WTFMove(options), WTFMove(details), WTFMove(std::get<1>(shippingOptionAndModifierData)), WTFMove(serializedMethodData), WTFMove(std::get<0>(shippingOptionAndModifierData)))); 347 auto request = adoptRef(*new PaymentRequest(document, WTFMove(options), WTFMove(details), WTFMove(std::get<1>(shippingOptionAndModifierData)), WTFMove(serializedMethodData), WTFMove(std::get<0>(shippingOptionAndModifierData)))); 348 request->suspendIfNeeded(); 349 return request; 348 350 } 349 351 … … 361 363 , m_shippingOption { WTFMove(selectedShippingOption) } 362 364 { 363 suspendIfNeeded();364 365 } 365 366 -
trunk/Source/WebCore/Modules/remoteplayback/RemotePlayback.cpp
r284057 r287066 46 46 Ref<RemotePlayback> RemotePlayback::create(HTMLMediaElement& element) 47 47 { 48 return adoptRef(*new RemotePlayback(element)); 48 auto remotePlayback = adoptRef(*new RemotePlayback(element)); 49 remotePlayback->suspendIfNeeded(); 50 return remotePlayback; 49 51 } 50 52 … … 53 55 , m_mediaElement(element) 54 56 { 55 suspendIfNeeded();56 57 } 57 58 -
trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp
r283237 r287066 48 48 Ref<ScriptProcessorNode> ScriptProcessorNode::create(BaseAudioContext& context, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels) 49 49 { 50 return adoptRef(*new ScriptProcessorNode(context, bufferSize, numberOfInputChannels, numberOfOutputChannels)); 50 auto node = adoptRef(*new ScriptProcessorNode(context, bufferSize, numberOfInputChannels, numberOfOutputChannels)); 51 node->suspendIfNeeded(); 52 return node; 51 53 } 52 54 … … 70 72 71 73 initialize(); 72 suspendIfNeeded();73 74 } 74 75 -
trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp
r284057 r287066 48 48 Ref<WebXRSession> WebXRSession::create(Document& document, WebXRSystem& system, XRSessionMode mode, PlatformXR::Device& device, FeatureList&& requestedFeatures) 49 49 { 50 return adoptRef(*new WebXRSession(document, system, mode, device, WTFMove(requestedFeatures))); 50 auto session = adoptRef(*new WebXRSession(document, system, mode, device, WTFMove(requestedFeatures))); 51 session->suspendIfNeeded(); 52 return session; 51 53 } 52 54 … … 69 71 // Every session MUST support viewer XRReferenceSpaces. 70 72 m_device->initializeReferenceSpace(XRReferenceSpaceType::Viewer); 71 72 suspendIfNeeded();73 73 } 74 74 -
trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp
r286918 r287066 57 57 Ref<WebXRSystem> WebXRSystem::create(Navigator& navigator) 58 58 { 59 return adoptRef(*new WebXRSystem(navigator)); 59 auto system = adoptRef(*new WebXRSystem(navigator)); 60 system->suspendIfNeeded(); 61 return system; 60 62 } 61 63 … … 66 68 { 67 69 m_inlineXRDevice = m_defaultInlineDevice; 68 suspendIfNeeded();69 70 } 70 71 -
trunk/Source/WebCore/css/CSSFontSelector.cpp
r286625 r287066 63 63 static unsigned fontSelectorId; 64 64 65 Ref<CSSFontSelector> CSSFontSelector::create(ScriptExecutionContext& context) 66 { 67 auto fontSelector = adoptRef(*new CSSFontSelector(context)); 68 fontSelector->suspendIfNeeded(); 69 return fontSelector; 70 } 71 65 72 CSSFontSelector::CSSFontSelector(ScriptExecutionContext& context) 66 73 : ActiveDOMObject(&context) … … 84 91 m_cssFontFaceSet->addFontModifiedObserver(m_fontModifiedObserver); 85 92 LOG(Fonts, "CSSFontSelector %p ctor", this); 86 87 suspendIfNeeded();88 93 } 89 94 -
trunk/Source/WebCore/css/CSSFontSelector.h
r286625 r287066 52 52 class CSSFontSelector final : public FontSelector, public CSSFontFace::Client, public CanMakeWeakPtr<CSSFontSelector>, public ActiveDOMObject { 53 53 public: 54 static Ref<CSSFontSelector> create(ScriptExecutionContext& context) 55 { 56 return adoptRef(*new CSSFontSelector(context)); 57 } 54 static Ref<CSSFontSelector> create(ScriptExecutionContext&); 58 55 virtual ~CSSFontSelector(); 59 56 -
trunk/Source/WebCore/dom/MessagePort.cpp
r286918 r287066 94 94 Ref<MessagePort> MessagePort::create(ScriptExecutionContext& scriptExecutionContext, const MessagePortIdentifier& local, const MessagePortIdentifier& remote) 95 95 { 96 return adoptRef(*new MessagePort(scriptExecutionContext, local, remote)); 96 auto messagePort = adoptRef(*new MessagePort(scriptExecutionContext, local, remote)); 97 messagePort->suspendIfNeeded(); 98 return messagePort; 97 99 } 98 100 … … 111 113 112 114 scriptExecutionContext.createdMessagePort(*this); 113 suspendIfNeeded();114 115 115 116 // Don't need to call processMessageWithMessagePortsSoon() here, because the port will not be opened until start() is invoked. -
trunk/Source/WebCore/workers/WorkerAnimationController.cpp
r277560 r287066 40 40 Ref<WorkerAnimationController> WorkerAnimationController::create(WorkerGlobalScope& workerGlobalScope) 41 41 { 42 return adoptRef(*new WorkerAnimationController(workerGlobalScope)); 42 auto controller = adoptRef(*new WorkerAnimationController(workerGlobalScope)); 43 controller->suspendIfNeeded(); 44 return controller; 43 45 } 44 46 … … 48 50 , m_animationTimer(*this, &WorkerAnimationController::animationTimerFired) 49 51 { 50 suspendIfNeeded();51 52 } 52 53 -
trunk/Source/WebCore/workers/service/ServiceWorker.cpp
r286012 r287066 58 58 if (auto existingServiceWorker = context.serviceWorker(data.identifier)) 59 59 return *existingServiceWorker; 60 return adoptRef(*new ServiceWorker(context, WTFMove(data))); 60 auto serviceWorker = adoptRef(*new ServiceWorker(context, WTFMove(data))); 61 serviceWorker->suspendIfNeeded(); 62 return serviceWorker; 61 63 } 62 64 … … 65 67 , m_data(WTFMove(data)) 66 68 { 67 suspendIfNeeded();68 69 69 context.registerServiceWorker(*this); 70 70 -
trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
r286419 r287066 55 55 } 56 56 57 return adoptRef(*new ServiceWorkerRegistration(context, WTFMove(container), WTFMove(data))); 57 auto registration = adoptRef(*new ServiceWorkerRegistration(context, WTFMove(container), WTFMove(data))); 58 registration->suspendIfNeeded(); 59 return registration; 58 60 } 59 61 … … 64 66 { 65 67 LOG(ServiceWorker, "Creating registration %p for registration key %s", this, m_registrationData.key.loggingString().utf8().data()); 66 suspendIfNeeded();67 68 68 69 if (m_registrationData.installingWorker)
Note:
See TracChangeset
for help on using the changeset viewer.