It will make easier to use it from the network process and we'll share more code with mac port.
I'm already working on this.
Created attachment 220164 [details]
$ WEBKIT_USE_NETWORK_PROCESS=1 Programs/WebKit2APITests/TestWebKitWebContext -p /webkit2/WebKitWebContext/uri-scheme
Comment on attachment 220164 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=220164&action=review
> +#if USE(SOUP)
> + // SoupRequest implementation.
> + void send(GTask*);
> + GInputStream* finish(GTask*, GError**);
Can you find a way to do this without putting SOUP specific functions in this file. If you need to refactor, that is fine, but please don't add to the #ifdef hell.
(In reply to comment #3)
> (From update of attachment 220164 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=220164&action=review
> > Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h:91
> > +#if USE(SOUP)
> > + // SoupRequest implementation.
> > + void send(GTask*);
> > + GInputStream* finish(GTask*, GError**);
> > +#endif
> Can you find a way to do this without putting SOUP specific functions in this file. If you need to refactor, that is fine, but please don't add to the #ifdef hell.
Thanks for looking at the patch. We need a way to make soup notify the custom protocol manager to start the load, passing the GTask associated, and that's very specific to soup. The only think I can think of is having an intermediate object entirely defined in platform specific code, so that we can also remove the mac ifdefs. Something like CustomProtocolManagerImpl or CustomProtocolManagerPrivate. However, since the header already contains mac #ifdefs, maybe it would be better to do the refactoring in a follow up patch to get rid of both mac and soup ifdefs there.
Created attachment 220296 [details]
Patch updated to not use any soup #ifdef in CustomProtocolManager header file. In the end I've added a CustomProtocolManagerImpl with all the soup specific implementation. This leaves CustomProtocolManagerSoup.cpp mostly cross-platform, so if mac switches to use their own CustomProtocolManagerImpl to remove also the mac #ifdefs, we could remove CustomProtocolManagerSoup.cpp and CustomProtocolManagerMac.cpp an use a common implementation for the cross-platform bits. I've also changed some uses of OwnPtr to use std::unique_ptr instead.
Created attachment 221351 [details]
I've removed the initiating page support for now until I figure out how to bring it back. And I've also removed the GTK specific part to try to make the patch easier to review.
Created attachment 221449 [details]
Created attachment 221459 [details]
Try to fix mac build
Committed r162449: <http://trac.webkit.org/changeset/162449>