WebKit Bugzilla
Attachment 357979 Details for
Bug 192995
: Expand use of sourceApplicationAuditData
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192995-20181221140511.patch (text/plain), 6.68 KB, created by
Alex Christensen
on 2018-12-21 14:05:12 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-12-21 14:05:12 PST
Size:
6.68 KB
patch
obsolete
>Index: Source/WTF/ChangeLog >=================================================================== >--- Source/WTF/ChangeLog (revision 239507) >+++ Source/WTF/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2018-12-21 Alex Christensen <achristensen@webkit.org> >+ >+ Expand use of sourceApplicationAuditData >+ https://bugs.webkit.org/show_bug.cgi?id=192995 >+ <rdar://problem/46627875> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/Platform.h: >+ > 2018-12-21 Alex Christensen <achristensen@webkit.org> > > Revert r239503. >Index: Source/WTF/wtf/Platform.h >=================================================================== >--- Source/WTF/wtf/Platform.h (revision 239507) >+++ Source/WTF/wtf/Platform.h (working copy) >@@ -1359,6 +1359,10 @@ > #define HAVE_RSA_PSS 1 > #endif > >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY) >+#define USE_SOURCE_APPLICATION_AUDIT_DATA 1 >+#endif >+ > #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) || PLATFORM(IOSMAC) > #define HAVE_URL_FORMATTING 1 > #endif >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 239516) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,24 @@ >+2018-12-21 Alex Christensen <achristensen@webkit.org> >+ >+ Expand use of sourceApplicationAuditData >+ https://bugs.webkit.org/show_bug.cgi?id=192995 >+ <rdar://problem/46627875> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms. >+ I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer. >+ >+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm: >+ (WebKit::NetworkProcess::sourceApplicationAuditData const): >+ * Platform/IPC/Connection.h: >+ * Platform/IPC/mac/ConnectionMac.mm: >+ (IPC::Connection::getAuditToken): >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::initializeWebProcess): >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::WebProcess::sourceApplicationAuditData const): >+ > 2018-12-21 Keith Rollin <krollin@apple.com> > > Crash in com.apple.WebKit: WebKit::WebResourceLoader::willSendRequest + 223 >Index: Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (revision 239507) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (working copy) >@@ -133,12 +133,14 @@ void NetworkProcess::platformInitializeN > > RetainPtr<CFDataRef> NetworkProcess::sourceApplicationAuditData() const > { >-#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC) >- audit_token_t auditToken; >+#if USE(SOURCE_APPLICATION_AUDIT_DATA) > ASSERT(parentProcessConnection()); >- if (!parentProcessConnection() || !parentProcessConnection()->getAuditToken(auditToken)) >+ if (!parentProcessConnection()) > return nullptr; >- return adoptCF(CFDataCreate(nullptr, (const UInt8*)&auditToken, sizeof(auditToken))); >+ Optional<audit_token_t> auditToken = parentProcessConnection()->getAuditToken(); >+ if (!auditToken) >+ return nullptr; >+ return adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken))); > #else > return nullptr; > #endif >Index: Source/WebKit/Platform/IPC/Connection.h >=================================================================== >--- Source/WebKit/Platform/IPC/Connection.h (revision 239507) >+++ Source/WebKit/Platform/IPC/Connection.h (working copy) >@@ -137,7 +137,7 @@ public: > }; > static bool identifierIsValid(Identifier identifier) { return MACH_PORT_VALID(identifier.port); } > xpc_connection_t xpcConnection() const { return m_xpcConnection.get(); } >- bool getAuditToken(audit_token_t&); >+ Optional<audit_token_t> getAuditToken(); > pid_t remoteProcessID() const; > #elif OS(WINDOWS) > typedef HANDLE Identifier; >Index: Source/WebKit/Platform/IPC/mac/ConnectionMac.mm >=================================================================== >--- Source/WebKit/Platform/IPC/mac/ConnectionMac.mm (revision 239507) >+++ Source/WebKit/Platform/IPC/mac/ConnectionMac.mm (working copy) >@@ -603,13 +603,14 @@ IPC::Connection::Identifier Connection:: > return Identifier(m_isServer ? m_receivePort : m_sendPort, m_xpcConnection); > } > >-bool Connection::getAuditToken(audit_token_t& auditToken) >+Optional<audit_token_t> Connection::getAuditToken() > { > if (!m_xpcConnection) >- return false; >+ return WTF::nullopt; > >+ audit_token_t auditToken; > xpc_connection_get_audit_token(m_xpcConnection.get(), &auditToken); >- return true; >+ return WTFMove(auditToken); > } > > bool Connection::kill() >Index: Source/WebKit/WebProcess/WebProcess.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.cpp (revision 239507) >+++ Source/WebKit/WebProcess/WebProcess.cpp (working copy) >@@ -401,9 +401,8 @@ void WebProcess::initializeWebProcess(We > #endif > > #if ENABLE(REMOTE_INSPECTOR) && PLATFORM(COCOA) >- audit_token_t auditToken; >- if (parentProcessConnection()->getAuditToken(auditToken)) { >- RetainPtr<CFDataRef> auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&auditToken, sizeof(auditToken))); >+ if (Optional<audit_token_t> auditToken = parentProcessConnection()->getAuditToken()) { >+ RetainPtr<CFDataRef> auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken))); > Inspector::RemoteInspector::singleton().setParentProcessInformation(WebCore::presentingApplicationPID(), auditData); > } > #endif >Index: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >=================================================================== >--- Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (revision 239507) >+++ Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (working copy) >@@ -417,12 +417,14 @@ void WebProcess::platformTerminate() > > RetainPtr<CFDataRef> WebProcess::sourceApplicationAuditData() const > { >-#if PLATFORM(IOS_FAMILY) >- audit_token_t auditToken; >+#if USE(SOURCE_APPLICATION_AUDIT_DATA) > ASSERT(parentProcessConnection()); >- if (!parentProcessConnection() || !parentProcessConnection()->getAuditToken(auditToken)) >+ if (!parentProcessConnection()) >+ return nullptr; >+ Optional<audit_token_t> auditToken = parentProcessConnection()->getAuditToken(); >+ if (!auditToken) > return nullptr; >- return adoptCF(CFDataCreate(nullptr, (const UInt8*)&auditToken, sizeof(auditToken))); >+ return adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken))); > #else > return nullptr; > #endif
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 192995
:
357979
|
358658
|
358660
|
358662
|
358663
|
358671
|
358734
|
358736