Bug 105113 - [WebKit2] Register schemes with the network process if it is being used
Summary: [WebKit2] Register schemes with the network process if it is being used
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-15 15:29 PST by Andy Estes
Modified: 2012-12-15 16:04 PST (History)
0 users

See Also:


Attachments
Patch (13.76 KB, patch)
2012-12-15 15:35 PST, Andy Estes
andersca: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2012-12-15 15:29:07 PST
[WebKit2] Register schemes with the network process if it is being used
Comment 1 Andy Estes 2012-12-15 15:35:51 PST
Created attachment 179627 [details]
Patch
Comment 2 Anders Carlsson 2012-12-15 15:40:08 PST
Comment on attachment 179627 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=179627&action=review

> Source/WebKit2/NetworkProcess/NetworkProcess.h:78
> +    void registerSchemeForCustomProtocol(const WTF::String&);
> +    void unregisterSchemeForCustomProtocol(const WTF::String&);

No need for WTF:: here.

> Source/WebKit2/UIProcess/Network/mac/NetworkProcessProxyMac.mm:46
> +    NSArray *schemes = [[WKBrowsingContextController customSchemes] allObjects];
> +    for (size_t i = 0; i < [schemes count]; ++i)
> +        parameters.urlSchemesRegisteredForCustomProtocols.append([schemes objectAtIndex:i]);

You can just use fast enumeration here:

for (NSString *scheme in [WKBrowsingContextController customSchemes])

> Source/WebKit2/UIProcess/WebContext.cpp:1116
> +    if (m_usesNetworkProcess)
> +        NetworkProcessManager::shared().process()->send(Messages::NetworkProcess::RegisterSchemeForCustomProtocol(scheme), 0);
> +    else
> +        sendToAllProcesses(Messages::WebProcess::RegisterSchemeForCustomProtocol(scheme));
> +}

This is missing the #if ENABLE(NETWORK_PROCESS). I'd use an early return to avoid making the indentation look weird.

> Source/WebKit2/UIProcess/WebContext.cpp:1123
> +    if (m_usesNetworkProcess)
> +        NetworkProcessManager::shared().process()->send(Messages::NetworkProcess::UnregisterSchemeForCustomProtocol(scheme), 0);
> +    else
> +        sendToAllProcesses(Messages::WebProcess::UnregisterSchemeForCustomProtocol(scheme));

Ditto.

> Source/WebKit2/UIProcess/WebContext.h:329
> +    void registerSchemeForCustomProtocol(const WTF::String&);
> +    void unregisterSchemeForCustomProtocol(const WTF::String&);

No need for WTF::
Comment 3 Build Bot 2012-12-15 15:43:48 PST
Comment on attachment 179627 [details]
Patch

Attachment 179627 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15360229
Comment 4 Andy Estes 2012-12-15 16:04:48 PST
Committed r137818: <http://trac.webkit.org/changeset/137818>