WebKit Bugzilla
Attachment 362454 Details for
Bug 194841
: [MSVC] Fix compilation errors with lambdas in Service Workers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194841.diff (text/plain), 3.78 KB, created by
Don Olmstead
on 2019-02-19 17:04:27 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Don Olmstead
Created:
2019-02-19 17:04:27 PST
Size:
3.78 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c25dffb4f40..2757c3502d9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-02-19 Don Olmstead <don.olmstead@sony.com> >+ >+ [MSVC] Fix compilation errors with lambdas in Service Workers >+ https://bugs.webkit.org/show_bug.cgi?id=194841 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests. No change in behavior. >+ >+ MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is >+ referring to the enclosing lambda according to MSVC. This patch works around this behavior >+ through by using the `protectedThis` pattern in WebKit code. >+ >+ * workers/service/server/RegistrationDatabase.cpp: >+ (WebCore::RegistrationDatabase::openSQLiteDatabase): >+ > 2019-02-19 Ryosuke Niwa <rniwa@webkit.org> > > REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window >diff --git a/Source/WebCore/workers/service/server/RegistrationDatabase.cpp b/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >index 55c8fced298..41e80554339 100644 >--- a/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >+++ b/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >@@ -133,7 +133,7 @@ void RegistrationDatabase::openSQLiteDatabase(const String& fullFilename) > LOG(ServiceWorker, "ServiceWorker RegistrationDatabase opening file %s", fullFilename.utf8().data()); > > String errorMessage; >- auto scopeExit = makeScopeExit([&, errorMessage = &errorMessage] { >+ auto scopeExit = makeScopeExit([this, protectedThis = makeRef(*this), errorMessage = &errorMessage] { > ASSERT_UNUSED(errorMessage, !errorMessage->isNull()); > > #if RELEASE_LOG_DISABLED >@@ -143,7 +143,7 @@ void RegistrationDatabase::openSQLiteDatabase(const String& fullFilename) > #endif > > m_database = nullptr; >- callOnMainThread([protectedThis = makeRef(*this)] { >+ callOnMainThread([protectedThis = protectedThis.copyRef()] { > protectedThis->databaseFailedToOpen(); > }); > }); >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 91019bbd17a..7c7b4209342 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2019-02-19 Don Olmstead <don.olmstead@sony.com> >+ >+ [MSVC] Fix compilation errors with lambdas in Service Workers >+ https://bugs.webkit.org/show_bug.cgi?id=194841 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/Storage/ServiceWorkerClientFetch.cpp: >+ (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse): >+ > 2019-02-19 Antti Koivisto <antti@apple.com> > > Pass rootContentsLayer to Mac remote layer tree >diff --git a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >index f07473c855b..c9a3f34f291 100644 >--- a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >+++ b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >@@ -115,7 +115,7 @@ void ServiceWorkerClientFetch::didReceiveRedirectResponse(ResourceResponse&& res > } > response.setSource(ResourceResponse::Source::ServiceWorker); > >- m_loader->willSendRequest(m_loader->request().redirectedRequest(response, m_shouldClearReferrerOnHTTPSToHTTPRedirect), response, [protectedThis = makeRef(*this), this](ResourceRequest&& request) { >+ m_loader->willSendRequest(m_loader->request().redirectedRequest(response, m_shouldClearReferrerOnHTTPSToHTTPRedirect), response, [this, protectedThis = protectedThis.copyRef()](ResourceRequest&& request) { > if (!m_loader || request.isNull()) { > if (auto callback = WTFMove(m_callback)) > callback(Result::Succeeded);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194841
: 362454