Changeset 228691 in webkit


Ignore:
Timestamp:
Feb 19, 2018 8:46:23 AM (6 years ago)
Author:
Ms2ger@igalia.com
Message:

Explicitly qualify some method calls on this in lamdas in Service Worker code.
https://bugs.webkit.org/show_bug.cgi?id=182875

Reviewed by Chris Dumez.

This is necessary for the code to build with GCC 5. Other code already
appears to have been adapted similarly.

Source/WebCore:

No change in functionality.

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::startLoadingMainResource):

  • workers/service/ServiceWorkerContainer.cpp:

(WebCore::ServiceWorkerContainer::ready):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):

  • workers/service/ServiceWorkerGlobalScope.cpp:

(WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet):

  • workers/service/server/SWServer.cpp:

(WebCore::SWServer::claim):
(WebCore::SWServer::Connection::resolveRegistrationReadyRequests):

  • workers/service/server/SWServerRegistration.cpp:

(WebCore::SWServerRegistration::updateRegistrationState):
(WebCore::SWServerRegistration::setUpdateViaCache):
(WebCore::SWServerRegistration::setLastUpdateTime):
(WebCore::SWServerRegistration::fireUpdateFoundEvent):

  • workers/service/server/SWServerWorker.cpp:

(WebCore::SWServerWorker::setState):

Source/WebKit:

  • StorageProcess/ServiceWorker/WebSWServerConnection.cpp:

(WebKit::WebSWServerConnection::startFetch):

Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r228683 r228691  
     12018-02-19  Ms2ger  <Ms2ger@igalia.com>
     2
     3        Explicitly qualify some method calls on this in lamdas in Service Worker code.
     4        https://bugs.webkit.org/show_bug.cgi?id=182875
     5
     6        Reviewed by Chris Dumez.
     7
     8        This is necessary for the code to build with GCC 5. Other code already
     9        appears to have been adapted similarly.
     10
     11        No change in functionality.
     12
     13        * loader/DocumentLoader.cpp:
     14        (WebCore::DocumentLoader::redirectReceived):
     15        (WebCore::DocumentLoader::startLoadingMainResource):
     16        * workers/service/ServiceWorkerContainer.cpp:
     17        (WebCore::ServiceWorkerContainer::ready):
     18        (WebCore::ServiceWorkerContainer::getRegistration):
     19        (WebCore::ServiceWorkerContainer::getRegistrations):
     20        (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
     21        * workers/service/ServiceWorkerGlobalScope.cpp:
     22        (WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet):
     23        * workers/service/server/SWServer.cpp:
     24        (WebCore::SWServer::claim):
     25        (WebCore::SWServer::Connection::resolveRegistrationReadyRequests):
     26        * workers/service/server/SWServerRegistration.cpp:
     27        (WebCore::SWServerRegistration::updateRegistrationState):
     28        (WebCore::SWServerRegistration::setUpdateViaCache):
     29        (WebCore::SWServerRegistration::setLastUpdateTime):
     30        (WebCore::SWServerRegistration::fireUpdateFoundEvent):
     31        * workers/service/server/SWServerWorker.cpp:
     32        (WebCore::SWServerWorker::setState):
     33
    1342018-02-19  Zalan Bujtas  <zalan@apple.com>
    235
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r228591 r228691  
    525525        }
    526526        auto url = request.url();
    527         matchRegistration(url, [request = WTFMove(request), isRedirectionFromServiceWorker, completionHandler = WTFMove(completionHandler), protectedThis = WTFMove(protectedThis), this] (auto&& registrationData) mutable {
     527        this->matchRegistration(url, [request = WTFMove(request), isRedirectionFromServiceWorker, completionHandler = WTFMove(completionHandler), protectedThis = WTFMove(protectedThis), this] (auto&& registrationData) mutable {
    528528            if (!m_mainDocumentError.isNull() || !m_frame) {
    529529                completionHandler({ });
     
    539539
    540540            // Service worker registration changed, we need to cancel the current load to restart a new one.
    541             clearMainResource();
     541            this->clearMainResource();
    542542            completionHandler({ });
    543543
    544544            m_serviceWorkerRegistrationData = WTFMove(registrationData);
    545             loadMainResource(WTFMove(request));
     545            this->loadMainResource(WTFMove(request));
    546546            return;
    547547        });
     
    16561656
    16571657            m_serviceWorkerRegistrationData = WTFMove(registrationData);
    1658             loadMainResource(WTFMove(request));
     1658            this->loadMainResource(WTFMove(request));
    16591659        });
    16601660#else
  • trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp

    r228101 r228691  
    9595            connection->whenRegistrationReady(topOrigin, clientURL, [this, contextIdentifier](auto&& registrationData) {
    9696                ScriptExecutionContext::postTaskTo(contextIdentifier, [this, registrationData = crossThreadCopy(registrationData)](auto&) mutable {
    97                     if (m_isStopped || !scriptExecutionContext()->sessionID().isValid())
     97                    if (m_isStopped || !this->scriptExecutionContext()->sessionID().isValid())
    9898                        return;
    9999
    100                     auto registration = ServiceWorkerRegistration::getOrCreate(*scriptExecutionContext(), *this, WTFMove(registrationData));
     100                    auto registration = ServiceWorkerRegistration::getOrCreate(*this->scriptExecutionContext(), *this, WTFMove(registrationData));
    101101                    m_readyPromise->resolve(WTFMove(registration));
    102102                });
     
    270270        connection->matchRegistration(topOrigin, parsedURL, [this, contextIdentifier, pendingPromiseIdentifier] (auto&& result) mutable {
    271271            ScriptExecutionContext::postTaskTo(contextIdentifier, [this, pendingPromiseIdentifier, result = crossThreadCopy(result)](ScriptExecutionContext&) mutable {
    272                 didFinishGetRegistrationRequest(pendingPromiseIdentifier, WTFMove(result));
     272                this->didFinishGetRegistrationRequest(pendingPromiseIdentifier, WTFMove(result));
    273273            });
    274274        });
     
    333333        connection->getRegistrations(topOrigin, contextURL, [this, contextIdentifier, pendingPromiseIdentifier] (auto&& registrationDatas) mutable {
    334334            ScriptExecutionContext::postTaskTo(contextIdentifier, [this, pendingPromiseIdentifier, registrationDatas = crossThreadCopy(registrationDatas)](ScriptExecutionContext&) mutable {
    335                 didFinishGetRegistrationsRequest(pendingPromiseIdentifier, WTFMove(registrationDatas));
     335                this->didFinishGetRegistrationsRequest(pendingPromiseIdentifier, WTFMove(registrationDatas));
    336336            });
    337337        });
     
    355355
    356356    auto registrations = WTF::map(WTFMove(registrationDatas), [&] (auto&& registrationData) {
    357         return ServiceWorkerRegistration::getOrCreate(*scriptExecutionContext(), *this, WTFMove(registrationData));
     357        return ServiceWorkerRegistration::getOrCreate(*this->scriptExecutionContext(), *this, WTFMove(registrationData));
    358358    });
    359359
  • trunk/Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp

    r226628 r228691  
    114114        m_extendedEvents.append(*newEvent);
    115115        newEvent->whenAllExtendLifetimePromisesAreSettled([this](auto&&) {
    116             updateExtendedEventsSet();
     116            this->updateExtendedEventsSet();
    117117        });
    118118        // Clear out the event's target as it is the WorkerGlobalScope and we do not want to keep it
  • trunk/Source/WebCore/workers/service/server/SWServer.cpp

    r228180 r228691  
    444444    auto& origin = worker.origin();
    445445    forEachClientForOrigin(origin, [&](auto& clientData) {
    446         auto* registration = doRegistrationMatching(origin.topOrigin, clientData.url);
     446        auto* registration = this->doRegistrationMatching(origin.topOrigin, clientData.url);
    447447        if (!(registration && registration->key() == worker.registrationKey()))
    448448            return;
     
    454454                return;
    455455            result.iterator->value = worker.identifier();
    456             if (auto* controllingRegistration = registrationFromServiceWorkerIdentifier(previousIdentifier))
     456            if (auto* controllingRegistration = this->registrationFromServiceWorkerIdentifier(previousIdentifier))
    457457                controllingRegistration->removeClientUsingRegistration(clientData.identifier);
    458458        }
     
    825825            return false;
    826826
    827         registrationReady(request.identifier, registration.data());
     827        this->registrationReady(request.identifier, registration.data());
    828828        return true;
    829829    });
  • trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp

    r228101 r228691  
    100100
    101101    forEachConnection([&](auto& connection) {
    102         connection.updateRegistrationStateInClient(identifier(), state, serviceWorkerData);
     102        connection.updateRegistrationStateInClient(this->identifier(), state, serviceWorkerData);
    103103    });
    104104}
     
    115115    m_updateViaCache = updateViaCache;
    116116    forEachConnection([&](auto& connection) {
    117         connection.setRegistrationUpdateViaCache(identifier(), updateViaCache);
     117        connection.setRegistrationUpdateViaCache(this->identifier(), updateViaCache);
    118118    });
    119119}
     
    123123    m_lastUpdateTime = time;
    124124    forEachConnection([&](auto& connection) {
    125         connection.setRegistrationLastUpdateTime(identifier(), time);
     125        connection.setRegistrationLastUpdateTime(this->identifier(), time);
    126126    });
    127127}
     
    130130{
    131131    forEachConnection([&](auto& connection) {
    132         connection.fireUpdateFoundEvent(identifier());
     132        connection.fireUpdateFoundEvent(this->identifier());
    133133    });
    134134}
  • trunk/Source/WebCore/workers/service/server/SWServerWorker.cpp

    r227696 r228691  
    180180    if (registration) {
    181181        registration->forEachConnection([&](auto& connection) {
    182             connection.updateWorkerStateInClient(identifier(), state);
     182            connection.updateWorkerStateInClient(this->identifier(), state);
    183183        });
    184184    }
  • trunk/Source/WebKit/ChangeLog

    r228605 r228691  
     12018-02-19  Ms2ger  <Ms2ger@igalia.com>
     2
     3        Explicitly qualify some method calls on this in lamdas in Service Worker code.
     4        https://bugs.webkit.org/show_bug.cgi?id=182875
     5
     6        Reviewed by Chris Dumez.
     7
     8        This is necessary for the code to build with GCC 5. Other code already
     9        appears to have been adapted similarly.
     10
     11        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
     12        (WebKit::WebSWServerConnection::startFetch):
     13
    1142018-02-18  Reza Abbasian  <rabbasian@apple.com>
    215
  • trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp

    r227989 r228691  
    159159            if (success) {
    160160                SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("startFetch: Starting fetch %llu via service worker %llu", fetchIdentifier, serviceWorkerIdentifier.toUInt64());
    161                 sendToContextProcess(contextConnection, Messages::WebSWContextManagerConnection::StartFetch { identifier(), fetchIdentifier, serviceWorkerIdentifier, request, options, formData, referrer });
     161                sendToContextProcess(contextConnection, Messages::WebSWContextManagerConnection::StartFetch { this->identifier(), fetchIdentifier, serviceWorkerIdentifier, request, options, formData, referrer });
    162162            } else {
    163163                SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %llu -> DidNotHandle because failed to run service worker", fetchIdentifier);
Note: See TracChangeset for help on using the changeset viewer.