Changeset 286025 in webkit
- Timestamp:
- Nov 18, 2021, 1:28:14 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 23 edited
-
ChangeLog (modified) (1 diff)
-
Modules/mediacapabilities/MediaCapabilities.cpp (modified) (2 diffs)
-
Modules/mediastream/RTCDataChannel.cpp (modified) (2 diffs)
-
Modules/mediastream/RTCRtpSFrameTransform.cpp (modified) (2 diffs)
-
crypto/CryptoAlgorithm.cpp (modified) (1 diff)
-
crypto/algorithms/CryptoAlgorithmECDH.cpp (modified) (1 diff)
-
crypto/algorithms/CryptoAlgorithmSHA1.cpp (modified) (1 diff)
-
crypto/algorithms/CryptoAlgorithmSHA224.cpp (modified) (1 diff)
-
crypto/algorithms/CryptoAlgorithmSHA256.cpp (modified) (1 diff)
-
crypto/algorithms/CryptoAlgorithmSHA384.cpp (modified) (1 diff)
-
crypto/algorithms/CryptoAlgorithmSHA512.cpp (modified) (1 diff)
-
crypto/mac/CryptoKeyRSAMac.cpp (modified) (1 diff)
-
dom/BroadcastChannel.cpp (modified) (1 diff)
-
dom/ScriptExecutionContext.cpp (modified) (3 diffs)
-
dom/ScriptExecutionContext.h (modified) (2 diffs)
-
inspector/agents/worker/ServiceWorkerAgent.cpp (modified) (1 diff)
-
page/cocoa/ResourceUsageThreadCocoa.mm (modified) (1 diff)
-
workers/WorkerGlobalScope.cpp (modified) (3 diffs)
-
workers/WorkerGlobalScope.h (modified) (3 diffs)
-
workers/WorkerOrWorkletThread.cpp (modified) (1 diff)
-
workers/WorkerOrWorkletThread.h (modified) (3 diffs)
-
workers/WorkerThread.cpp (modified) (2 diffs)
-
workers/WorkerThread.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r286024 r286025 1 2021-11-18 Chris Dumez <cdumez@apple.com> 2 3 Port call sites to ScriptExecutionContext::identifier() and drop ScriptExecutionContext::contextIdentifier() 4 https://bugs.webkit.org/show_bug.cgi?id=233323 5 6 Reviewed by Geoffrey Garen. 7 8 Port call sites to ScriptExecutionContext::identifier() and drop ScriptExecutionContext::contextIdentifier() alias. 9 10 * Modules/mediacapabilities/MediaCapabilities.cpp: 11 (WebCore::MediaCapabilities::decodingInfo): 12 (WebCore::MediaCapabilities::encodingInfo): 13 * Modules/mediastream/RTCDataChannel.cpp: 14 (WebCore::RTCDataChannel::create): 15 (WebCore::m_contextIdentifier): 16 * Modules/mediastream/RTCRtpSFrameTransform.cpp: 17 (WebCore::RTCRtpSFrameTransform::initializeTransformer): 18 (WebCore::RTCRtpSFrameTransform::createStreams): 19 * crypto/CryptoAlgorithm.cpp: 20 (WebCore::dispatchAlgorithmOperation): 21 * crypto/algorithms/CryptoAlgorithmECDH.cpp: 22 (WebCore::CryptoAlgorithmECDH::deriveBits): 23 * crypto/algorithms/CryptoAlgorithmSHA1.cpp: 24 (WebCore::CryptoAlgorithmSHA1::digest): 25 * crypto/algorithms/CryptoAlgorithmSHA224.cpp: 26 (WebCore::CryptoAlgorithmSHA224::digest): 27 * crypto/algorithms/CryptoAlgorithmSHA256.cpp: 28 (WebCore::CryptoAlgorithmSHA256::digest): 29 * crypto/algorithms/CryptoAlgorithmSHA384.cpp: 30 (WebCore::CryptoAlgorithmSHA384::digest): 31 * crypto/algorithms/CryptoAlgorithmSHA512.cpp: 32 (WebCore::CryptoAlgorithmSHA512::digest): 33 * crypto/mac/CryptoKeyRSAMac.cpp: 34 (WebCore::CryptoKeyRSA::generatePair): 35 * dom/BroadcastChannel.cpp: 36 (WebCore::BroadcastChannel::MainThreadBridge::registerChannel): 37 * dom/ScriptExecutionContext.cpp: 38 (WebCore::ScriptExecutionContext::ScriptExecutionContext): 39 (WebCore::ScriptExecutionContext::removeFromContextsMap): 40 (WebCore::ScriptExecutionContext::~ScriptExecutionContext): 41 * dom/ScriptExecutionContext.h: 42 (WebCore::ScriptExecutionContext::identifier const): 43 (WebCore::ScriptExecutionContext::contextIdentifier const): Deleted. 44 * workers/WorkerGlobalScope.cpp: 45 (WebCore::m_credentials): 46 (WebCore::WorkerGlobalScope::~WorkerGlobalScope): 47 1 48 2021-11-18 Alan Bujtas <zalan@apple.com> 2 49 -
trunk/Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp
r284443 r286025 258 258 259 259 m_decodingTasks.add(++m_nextTaskIdentifier, WTFMove(callback)); 260 context.postTaskToResponsibleDocument([configuration = WTFMove(configuration).isolatedCopy(), contextIdentifier = context. contextIdentifier(), weakThis = WeakPtr { this }, taskIdentifier = m_nextTaskIdentifier](auto& document) mutable {260 context.postTaskToResponsibleDocument([configuration = WTFMove(configuration).isolatedCopy(), contextIdentifier = context.identifier(), weakThis = WeakPtr { this }, taskIdentifier = m_nextTaskIdentifier](auto& document) mutable { 261 261 gatherDecodingInfo(document, WTFMove(configuration), [contextIdentifier, weakThis = WTFMove(weakThis), taskIdentifier](auto&& result) mutable { 262 262 ScriptExecutionContext::postTaskTo(contextIdentifier, [weakThis = WTFMove(weakThis), taskIdentifier, result = WTFMove(result).isolatedCopy()](auto&) mutable { … … 315 315 316 316 m_encodingTasks.add(++m_nextTaskIdentifier, WTFMove(callback)); 317 context.postTaskToResponsibleDocument([configuration = WTFMove(configuration).isolatedCopy(), contextIdentifier = context. contextIdentifier(), weakThis = WeakPtr { this }, taskIdentifier = m_nextTaskIdentifier](auto& document) mutable {317 context.postTaskToResponsibleDocument([configuration = WTFMove(configuration).isolatedCopy(), contextIdentifier = context.identifier(), weakThis = WeakPtr { this }, taskIdentifier = m_nextTaskIdentifier](auto& document) mutable { 318 318 gatherEncodingInfo(document, WTFMove(configuration), [contextIdentifier, weakThis = WTFMove(weakThis), taskIdentifier](auto&& result) mutable { 319 319 ScriptExecutionContext::postTaskTo(contextIdentifier, [weakThis = WTFMove(weakThis), taskIdentifier, result = WTFMove(result).isolatedCopy()](auto&) mutable { -
trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
r285654 r286025 72 72 return; 73 73 if (auto* context = channel->scriptExecutionContext()) 74 channel->m_handler->setClient(*channel, context-> contextIdentifier());74 channel->m_handler->setClient(*channel, context->identifier()); 75 75 }); 76 76 return channel; … … 98 98 , m_handler(WTFMove(handler)) 99 99 , m_identifier(RTCDataChannelIdentifier { Process::identifier(), ObjectIdentifier<RTCDataChannelLocalIdentifierType>::generateThreadSafe() }) 100 , m_contextIdentifier(context.isDocument() ? ScriptExecutionContextIdentifier { } : context. contextIdentifier())100 , m_contextIdentifier(context.isDocument() ? ScriptExecutionContextIdentifier { } : context.identifier()) 101 101 , m_label(WTFMove(label)) 102 102 , m_options(WTFMove(options)) -
trunk/Source/WebCore/Modules/mediastream/RTCRtpSFrameTransform.cpp
r284095 r286025 160 160 m_transformer->setMediaType(backend.mediaType()); 161 161 162 backend.setTransformableFrameCallback([transformer = m_transformer, identifier = context-> contextIdentifier(), backend = Ref { backend }, weakThis = WeakPtr { *this }](auto&& frame) {162 backend.setTransformableFrameCallback([transformer = m_transformer, identifier = context->identifier(), backend = Ref { backend }, weakThis = WeakPtr { *this }](auto&& frame) { 163 163 auto chunk = frame->data(); 164 164 if (!chunk.data() || !chunk.size()) … … 232 232 // We do not want to throw any exception in the transform to make sure we do not error the transform. 233 233 WTF::switchOn(frame, [&](RefPtr<RTCEncodedAudioFrame>& value) { 234 transformFrame(*value, globalObject, transformer.get(), *readableStreamSource, context. contextIdentifier(), weakThis);234 transformFrame(*value, globalObject, transformer.get(), *readableStreamSource, context.identifier(), weakThis); 235 235 }, [&](RefPtr<RTCEncodedVideoFrame>& value) { 236 transformFrame(*value, globalObject, transformer.get(), *readableStreamSource, context. contextIdentifier(), weakThis);236 transformFrame(*value, globalObject, transformer.get(), *readableStreamSource, context.identifier(), weakThis); 237 237 }, [&](RefPtr<ArrayBuffer>& value) { 238 transformFrame({ static_cast<const uint8_t*>(value->data()), value->byteLength() }, globalObject, transformer.get(), *readableStreamSource, context. contextIdentifier(), weakThis);238 transformFrame({ static_cast<const uint8_t*>(value->data()), value->byteLength() }, globalObject, transformer.get(), *readableStreamSource, context.identifier(), weakThis); 239 239 }, [&](RefPtr<ArrayBufferView>& value) { 240 transformFrame({ static_cast<const uint8_t*>(value->data()), value->byteLength() }, globalObject, transformer.get(), *readableStreamSource, context. contextIdentifier(), weakThis);240 transformFrame({ static_cast<const uint8_t*>(value->data()), value->byteLength() }, globalObject, transformer.get(), *readableStreamSource, context.identifier(), weakThis); 241 241 }); 242 242 return { }; -
trunk/Source/WebCore/crypto/CryptoAlgorithm.cpp
r284857 r286025 97 97 { 98 98 workQueue.dispatch( 99 [operation = WTFMove(operation), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), contextIdentifier = context. contextIdentifier()]() mutable {99 [operation = WTFMove(operation), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), contextIdentifier = context.identifier()]() mutable { 100 100 auto result = operation(); 101 101 ScriptExecutionContext::postTaskTo(contextIdentifier, [result = crossThreadCopy(result), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback)](auto&) mutable { -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp
r284095 r286025 112 112 // the result validation and callback dispatch into unifiedCallback. 113 113 workQueue.dispatch( 114 [baseKey = WTFMove(baseKey), publicKey = ecParameters.publicKey, length, unifiedCallback = WTFMove(unifiedCallback), contextIdentifier = context. contextIdentifier()]() mutable {114 [baseKey = WTFMove(baseKey), publicKey = ecParameters.publicKey, length, unifiedCallback = WTFMove(unifiedCallback), contextIdentifier = context.identifier()]() mutable { 115 115 auto derivedKey = platformDeriveBits(downcast<CryptoKeyEC>(baseKey.get()), downcast<CryptoKeyEC>(*publicKey)); 116 116 ScriptExecutionContext::postTaskTo(contextIdentifier, [derivedKey = WTFMove(derivedKey), length, unifiedCallback = WTFMove(unifiedCallback)](auto&) mutable { -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
r238754 r286025 52 52 } 53 53 54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context. contextIdentifier()]() mutable {54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { 55 55 digest->addBytes(message.data(), message.size()); 56 56 auto result = digest->computeHash(); -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp
r238754 r286025 52 52 } 53 53 54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context. contextIdentifier()]() mutable {54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { 55 55 digest->addBytes(message.data(), message.size()); 56 56 auto result = digest->computeHash(); -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp
r238754 r286025 52 52 } 53 53 54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context. contextIdentifier()]() mutable {54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { 55 55 digest->addBytes(message.data(), message.size()); 56 56 auto result = digest->computeHash(); -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp
r238754 r286025 52 52 } 53 53 54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context. contextIdentifier()]() mutable {54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { 55 55 digest->addBytes(message.data(), message.size()); 56 56 auto result = digest->computeHash(); -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp
r238754 r286025 52 52 } 53 53 54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context. contextIdentifier()]() mutable {54 workQueue.dispatch([digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { 55 55 digest->addBytes(message.data(), message.size()); 56 56 auto result = digest->computeHash(); -
trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp
r278253 r286025 278 278 __block auto blockCallback(WTFMove(callback)); 279 279 __block auto blockFailureCallback(WTFMove(failureCallback)); 280 auto contextIdentifier = context-> contextIdentifier();280 auto contextIdentifier = context->identifier(); 281 281 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 282 282 CCRSACryptorRef ccPublicKey = nullptr; -
trunk/Source/WebCore/dom/BroadcastChannel.cpp
r285587 r286025 119 119 void BroadcastChannel::MainThreadBridge::registerChannel() 120 120 { 121 ensureOnMainThread([this, contextIdentifier = m_broadcastChannel->scriptExecutionContext()-> contextIdentifier()](auto& document) {121 ensureOnMainThread([this, contextIdentifier = m_broadcastChannel->scriptExecutionContext()->identifier()](auto& document) { 122 122 m_origin = { shouldPartitionOrigin(document) ? document.topOrigin().data() : document.securityOrigin().data(), document.securityOrigin().data() }; 123 123 if (auto* page = document.page()) -
trunk/Source/WebCore/dom/ScriptExecutionContext.cpp
r286012 r286025 115 115 116 116 ScriptExecutionContext::ScriptExecutionContext() 117 : m_ contextIdentifier(ScriptExecutionContextIdentifier::generateThreadSafe())117 : m_identifier(ScriptExecutionContextIdentifier::generateThreadSafe()) 118 118 { 119 119 Locker locker { allScriptExecutionContextsMapLock }; 120 allScriptExecutionContextsMap().add(m_ contextIdentifier, this);120 allScriptExecutionContextsMap().add(m_identifier, this); 121 121 } 122 122 … … 124 124 { 125 125 Locker locker { allScriptExecutionContextsMapLock }; 126 ASSERT(allScriptExecutionContextsMap().contains(m_ contextIdentifier));127 allScriptExecutionContextsMap().remove(m_ contextIdentifier);126 ASSERT(allScriptExecutionContextsMap().contains(m_identifier)); 127 allScriptExecutionContextsMap().remove(m_identifier); 128 128 } 129 129 … … 159 159 { 160 160 Locker locker { allScriptExecutionContextsMapLock }; 161 ASSERT_WITH_MESSAGE(!allScriptExecutionContextsMap().contains(m_ contextIdentifier), "A ScriptExecutionContext subclass instance implementing postTask should have already removed itself from the map");161 ASSERT_WITH_MESSAGE(!allScriptExecutionContextsMap().contains(m_identifier), "A ScriptExecutionContext subclass instance implementing postTask should have already removed itself from the map"); 162 162 } 163 163 -
trunk/Source/WebCore/dom/ScriptExecutionContext.h
r286012 r286025 284 284 WEBCORE_EXPORT static bool ensureOnContextThread(ScriptExecutionContextIdentifier, Task&&); 285 285 286 // FIXME: Port call sites to identifier() and drop this function. 287 ScriptExecutionContextIdentifier contextIdentifier() const { return m_contextIdentifier; } 288 ScriptExecutionContextIdentifier identifier() const { return m_contextIdentifier; } 286 ScriptExecutionContextIdentifier identifier() const { return m_identifier; } 289 287 290 288 protected: … … 364 362 365 363 String m_domainForCachePartition; 366 mutable ScriptExecutionContextIdentifier m_ contextIdentifier;364 mutable ScriptExecutionContextIdentifier m_identifier; 367 365 }; 368 366 -
trunk/Source/WebCore/inspector/agents/worker/ServiceWorkerAgent.cpp
r275443 r286025 58 58 { 59 59 return Protocol::ServiceWorker::Configuration::create() 60 .setTargetId(m_serviceWorkerGlobalScope.i dentifier())60 .setTargetId(m_serviceWorkerGlobalScope.inspectorIdentifier()) 61 61 .setSecurityOrigin(m_serviceWorkerGlobalScope.securityOrigin()->toRawString()) 62 62 .setUrl(m_serviceWorkerGlobalScope.contextData().scriptURL.string()) -
trunk/Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm
r278185 r286025 179 179 mach_port_t machThread = thread->thread()->machThread(); 180 180 if (MACH_PORT_VALID(machThread)) 181 knownWorkerThreads.set(machThread, thread->i dentifier().isolatedCopy());181 knownWorkerThreads.set(machThread, thread->inspectorIdentifier().isolatedCopy()); 182 182 } 183 183 } -
trunk/Source/WebCore/workers/WorkerGlobalScope.cpp
r285653 r286025 89 89 : WorkerOrWorkletGlobalScope(type, isMainThread() ? Ref { commonVM() } : JSC::VM::create(), &thread) 90 90 , m_url(params.scriptURL) 91 , m_i dentifier(params.identifier)91 , m_inspectorIdentifier(params.inspectorIdentifier) 92 92 , m_userAgent(params.userAgent) 93 93 , m_isOnline(params.isOnline) … … 104 104 { 105 105 Locker locker { allWorkerGlobalScopeIdentifiersLock }; 106 allWorkerGlobalScopeIdentifiers().add( contextIdentifier());106 allWorkerGlobalScopeIdentifiers().add(identifier()); 107 107 } 108 108 … … 125 125 { 126 126 Locker locker { allWorkerGlobalScopeIdentifiersLock }; 127 allWorkerGlobalScopeIdentifiers().remove( contextIdentifier());127 allWorkerGlobalScopeIdentifiers().remove(identifier()); 128 128 } 129 129 -
trunk/Source/WebCore/workers/WorkerGlobalScope.h
r285566 r286025 80 80 const URL& url() const final { return m_url; } 81 81 String origin() const; 82 const String& i dentifier() const { return m_identifier; }82 const String& inspectorIdentifier() const { return m_inspectorIdentifier; } 83 83 84 84 IDBClient::IDBConnectionProxy* idbConnectionProxy() final; … … 178 178 179 179 EventTarget* errorEventTarget() final; 180 String resourceRequestIdentifier() const final { return m_i dentifier; }180 String resourceRequestIdentifier() const final { return m_inspectorIdentifier; } 181 181 SocketProvider* socketProvider() final; 182 182 RefPtr<RTCDataChannelRemoteHandlerConnection> createRTCDataChannelRemoteHandlerConnection() final; … … 192 192 193 193 URL m_url; 194 String m_i dentifier;194 String m_inspectorIdentifier; 195 195 String m_userAgent; 196 196 -
trunk/Source/WebCore/workers/WorkerOrWorkletThread.cpp
r284857 r286025 67 67 } 68 68 69 WorkerOrWorkletThread::WorkerOrWorkletThread(const String& i dentifier, WorkerThreadMode workerThreadMode)70 : m_i dentifier(identifier)69 WorkerOrWorkletThread::WorkerOrWorkletThread(const String& inspectorIdentifier, WorkerThreadMode workerThreadMode) 70 : m_inspectorIdentifier(inspectorIdentifier) 71 71 , m_runLoop(constructRunLoop(workerThreadMode)) 72 72 { -
trunk/Source/WebCore/workers/WorkerOrWorkletThread.h
r284857 r286025 64 64 void resume(); 65 65 66 const String& i dentifier() const { return m_identifier; }66 const String& inspectorIdentifier() const { return m_inspectorIdentifier; } 67 67 68 68 static HashSet<WorkerOrWorkletThread*>& workerOrWorkletThreads() WTF_REQUIRES_LOCK(workerOrWorkletThreadsLock()); … … 71 71 72 72 protected: 73 explicit WorkerOrWorkletThread(const String& i dentifier, WorkerThreadMode = WorkerThreadMode::CreateNewThread);73 explicit WorkerOrWorkletThread(const String& inspectorIdentifier, WorkerThreadMode = WorkerThreadMode::CreateNewThread); 74 74 void workerOrWorkletThread(); 75 75 … … 85 85 static Lock s_workerOrWorkletThreadsLock; 86 86 87 String m_i dentifier;87 String m_inspectorIdentifier; 88 88 Lock m_threadCreationAndGlobalScopeLock; 89 89 RefPtr<WorkerOrWorkletGlobalScope> m_globalScope; -
trunk/Source/WebCore/workers/WorkerThread.cpp
r284093 r286025 51 51 scriptURL.isolatedCopy(), 52 52 name.isolatedCopy(), 53 i dentifier.isolatedCopy(),53 inspectorIdentifier.isolatedCopy(), 54 54 userAgent.isolatedCopy(), 55 55 isOnline, … … 88 88 89 89 WorkerThread::WorkerThread(const WorkerParameters& params, const ScriptBuffer& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerDebuggerProxy& workerDebuggerProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags) 90 : WorkerOrWorkletThread(params.i dentifier.isolatedCopy(), params.workerThreadMode)90 : WorkerOrWorkletThread(params.inspectorIdentifier.isolatedCopy(), params.workerThreadMode) 91 91 , m_workerLoaderProxy(workerLoaderProxy) 92 92 , m_workerDebuggerProxy(workerDebuggerProxy) -
trunk/Source/WebCore/workers/WorkerThread.h
r284857 r286025 62 62 URL scriptURL; 63 63 String name; 64 String i dentifier;64 String inspectorIdentifier; 65 65 String userAgent; 66 66 bool isOnline;
Note:
See TracChangeset
for help on using the changeset viewer.