[Webkit-unassigned] [Bug 188843] NetworkCache::Storage::lastStableVersion should be a developer-only feature

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 22 15:51:55 PDT 2018


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

--- Comment #9 from Michael Catanzaro <mcatanzaro at igalia.com> ---
Well the thesis is straightforward: sometimes you really do need to do things differently for developers. For instance, the title of this changelog:

"NetworkCache::Storage::lastStableVersion should be a developer-only feature"

Normally we use it for loading content from the source directory rather than the install prefix. E.g. in developer mode, hyphenation dictionaries, secondary processes, and the InjectedBundle are all loaded from the source directory instead of the install prefix. It would not be very good for developers if the UI process were to try launching the system WebKitWebProcess, for example.

Anyway, you don't need to enable it for Cocoa here, but you should use it here for other ports, because this is exactly the sort of thing it's intended for. E.g.:

bool ChildProcess::isSystemWebKit()
{
#if ENABLE(DEVELOPER_MODE)
    return false;
#elif PLATFORM(MAC)
    static bool isSystemWebKit = [] {
        return [[webKit2Bundle() bundlePath] hasPrefix:@"/System/"];
    }();

    return isSystemWebKit;
#else
    return true;
#endif
}

and then you can remove the other PLATFORM(MAC) guards:

#if PLATFORM(MAC)
    /// Allow the last stable version of the cache to co-exist with the latest development one.
    static const unsigned lastStableVersion = 12;
#endif

#if PLATFORM(MAC)
            if (directoryVersion == lastStableVersion)
                return;
#endif

since clearly there's nothing really platform-specific there.

-- 
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/20180822/541ee1ff/attachment-0001.html>


More information about the webkit-unassigned mailing list