Changeset 275611 in webkit
- Timestamp:
- Apr 7, 2021 10:08:35 AM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r275610 r275611 1 2021-04-07 Chris Dumez <cdumez@apple.com> 2 3 Drop unnecessary NDEBUG checks in ServiceWorkerContainer 4 https://bugs.webkit.org/show_bug.cgi?id=224285 5 6 Reviewed by Youenn Fablet. 7 8 * workers/service/ServiceWorkerContainer.cpp: 9 (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): 10 (WebCore::ServiceWorkerContainer::scheduleJob): 11 (WebCore::ServiceWorkerContainer::jobFailedWithException): 12 (WebCore::ServiceWorkerContainer::queueTaskToFireUpdateFoundEvent): 13 (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): 14 (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): 15 (WebCore::ServiceWorkerContainer::startScriptFetchForJob): 16 (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): 17 (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): 18 (WebCore::ServiceWorkerContainer::destroyJob): 19 (WebCore::ServiceWorkerContainer::addRegistration): 20 (WebCore::ServiceWorkerContainer::removeRegistration): 21 (WebCore::ServiceWorkerContainer::queueTaskToDispatchControllerChangeEvent): 22 (WebCore::ServiceWorkerContainer::contextIdentifier): 23 * workers/service/ServiceWorkerContainer.h: 24 1 25 2021-04-07 Simon Fraser <simon.fraser@apple.com> 2 26 -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
r275465 r275611 84 84 ServiceWorkerContainer::~ServiceWorkerContainer() 85 85 { 86 #ifndef NDEBUG 87 ASSERT(m_creationThread.ptr() == &Thread::current()); 88 #endif 86 ASSERT(m_creationThread.ptr() == &Thread::current()); 89 87 } 90 88 … … 235 233 void ServiceWorkerContainer::scheduleJob(std::unique_ptr<ServiceWorkerJob>&& job) 236 234 { 237 #ifndef NDEBUG 238 ASSERT(m_creationThread.ptr() == &Thread::current()); 239 #endif 240 235 ASSERT(m_creationThread.ptr() == &Thread::current()); 241 236 ASSERT(m_swConnection); 242 237 ASSERT(!isStopped()); … … 329 324 void ServiceWorkerContainer::jobFailedWithException(ServiceWorkerJob& job, const Exception& exception) 330 325 { 331 #ifndef NDEBUG 332 ASSERT(m_creationThread.ptr() == &Thread::current()); 333 #endif 334 326 ASSERT(m_creationThread.ptr() == &Thread::current()); 335 327 ASSERT_WITH_MESSAGE(job.hasPromise() || job.data().type == ServiceWorkerJobType::Update, "Only soft updates have no promise"); 336 328 … … 352 344 void ServiceWorkerContainer::queueTaskToFireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier identifier) 353 345 { 354 #ifndef NDEBUG 355 ASSERT(m_creationThread.ptr() == &Thread::current()); 356 #endif 346 ASSERT(m_creationThread.ptr() == &Thread::current()); 357 347 358 348 if (auto* registration = m_registrations.get(identifier)) … … 362 352 void ServiceWorkerContainer::jobResolvedWithRegistration(ServiceWorkerJob& job, ServiceWorkerRegistrationData&& data, ShouldNotifyWhenResolved shouldNotifyWhenResolved) 363 353 { 364 #ifndef NDEBUG 365 ASSERT(m_creationThread.ptr() == &Thread::current()); 366 #endif 354 ASSERT(m_creationThread.ptr() == &Thread::current()); 367 355 ASSERT_WITH_MESSAGE(job.hasPromise() || job.data().type == ServiceWorkerJobType::Update, "Only soft updates have no promise"); 368 356 … … 433 421 void ServiceWorkerContainer::jobResolvedWithUnregistrationResult(ServiceWorkerJob& job, bool unregistrationResult) 434 422 { 435 #ifndef NDEBUG 436 ASSERT(m_creationThread.ptr() == &Thread::current()); 437 #endif 438 423 ASSERT(m_creationThread.ptr() == &Thread::current()); 439 424 ASSERT(job.hasPromise()); 440 425 … … 458 443 void ServiceWorkerContainer::startScriptFetchForJob(ServiceWorkerJob& job, FetchOptions::Cache cachePolicy) 459 444 { 460 #ifndef NDEBUG 461 ASSERT(m_creationThread.ptr() == &Thread::current()); 462 #endif 445 ASSERT(m_creationThread.ptr() == &Thread::current()); 463 446 464 447 CONTAINER_RELEASE_LOG_IF_ALLOWED("startScriptFetchForJob: Starting script fetch for job %" PRIu64, job.identifier().toUInt64()); … … 477 460 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const String& referrerPolicy) 478 461 { 479 #ifndef NDEBUG 480 ASSERT(m_creationThread.ptr() == &Thread::current()); 481 #endif 462 ASSERT(m_creationThread.ptr() == &Thread::current()); 482 463 483 464 CONTAINER_RELEASE_LOG_IF_ALLOWED("jobFinishedLoadingScript: Successfuly finished fetching script for job %" PRIu64, job.identifier().toUInt64()); … … 488 469 void ServiceWorkerContainer::jobFailedLoadingScript(ServiceWorkerJob& job, const ResourceError& error, Exception&& exception) 489 470 { 490 #ifndef NDEBUG 491 ASSERT(m_creationThread.ptr() == &Thread::current()); 492 #endif 471 ASSERT(m_creationThread.ptr() == &Thread::current()); 493 472 ASSERT_WITH_MESSAGE(job.hasPromise() || job.data().type == ServiceWorkerJobType::Update, "Only soft updates have no promise"); 494 473 … … 512 491 void ServiceWorkerContainer::destroyJob(ServiceWorkerJob& job) 513 492 { 514 #ifndef NDEBUG 515 ASSERT(m_creationThread.ptr() == &Thread::current()); 516 #endif 517 493 ASSERT(m_creationThread.ptr() == &Thread::current()); 518 494 ASSERT(m_jobMap.contains(job.identifier())); 519 495 m_jobMap.remove(job.identifier()); … … 540 516 void ServiceWorkerContainer::addRegistration(ServiceWorkerRegistration& registration) 541 517 { 542 #ifndef NDEBUG 543 ASSERT(m_creationThread.ptr() == &Thread::current()); 544 #endif 518 ASSERT(m_creationThread.ptr() == &Thread::current()); 545 519 546 520 ensureSWClientConnection().addServiceWorkerRegistrationInServer(registration.identifier()); … … 550 524 void ServiceWorkerContainer::removeRegistration(ServiceWorkerRegistration& registration) 551 525 { 552 #ifndef NDEBUG 553 ASSERT(m_creationThread.ptr() == &Thread::current()); 554 #endif 526 ASSERT(m_creationThread.ptr() == &Thread::current()); 555 527 556 528 m_swConnection->removeServiceWorkerRegistrationInServer(registration.identifier()); … … 560 532 void ServiceWorkerContainer::queueTaskToDispatchControllerChangeEvent() 561 533 { 562 #ifndef NDEBUG 563 ASSERT(m_creationThread.ptr() == &Thread::current()); 564 #endif 534 ASSERT(m_creationThread.ptr() == &Thread::current()); 565 535 566 536 queueTaskToDispatchEvent(*this, TaskSource::DOMManipulation, Event::create(eventNames().controllerchangeEvent, Event::CanBubble::No, Event::IsCancelable::No)); … … 585 555 DocumentOrWorkerIdentifier ServiceWorkerContainer::contextIdentifier() 586 556 { 587 #ifndef NDEBUG 588 ASSERT(m_creationThread.ptr() == &Thread::current()); 589 #endif 590 557 ASSERT(m_creationThread.ptr() == &Thread::current()); 591 558 ASSERT(scriptExecutionContext()); 592 559 if (is<ServiceWorkerGlobalScope>(*scriptExecutionContext())) -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h
r275465 r275611 139 139 HashMap<ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistration*> m_registrations; 140 140 141 #if ndef NDEBUG141 #if ASSERT_ENABLED 142 142 Ref<Thread> m_creationThread { Thread::current() }; 143 143 #endif
Note: See TracChangeset
for help on using the changeset viewer.