[Webkit-unassigned] [Bug 183806] Create an assertion mechanism to ensure proper WebCore use in each WebKit Process

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 20 21:54:54 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=183806

--- Comment #2 from Brent Fulgham <bfulgham at webkit.org> ---
Usage:

In a method we want to protect, we can add an assertion describing the process privileges needed to execute the code:

For example, for cookie access we might use this:

    ASSERT(WTF::hasProcessPrivilege(WTF::ProcessPrivilege::CanAccessRawCookies));

At the launch of the UIProcess we would use this method to ensure all privileges are available:

    WTF::setProcessPrivileges(WTF::ProcessPrivilege::All);

In the network process, during platform initialization, we would use something like this:

    WTF::setProcessPrivileges(WTF::ProcessPrivilege::CanAccessRawCookies | WTF::ProcessPrivilege::CanAccessCredentials);

In the WebContent process, we would not set any privileges. We could just leave it as the default initialization, or use this:

    WTF::setProcessPrivileges(WTF::ProcessPrivilege::None);

Later, when we attempt to execute the initial code, we would expect an assertion for WebContent process, while Network and UIProcess pass the assertion.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180321/294c88cf/attachment-0001.html>


More information about the webkit-unassigned mailing list