Summary: | [SOUP] Implement CUSTOM PROTOCOLS | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||||||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | andersca, ap, beidson, bunhere, cdumez, commit-queue, danw, gustavo, gyuyoung.kim, rakuco, svillar, zan | ||||||||||||
Priority: | P2 | Keywords: | Soup | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
Bug Depends on: | 126343 | ||||||||||||||
Bug Blocks: | 108832, 127091, 136705 | ||||||||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2013-12-11 09:24:56 PST
I'm already working on this. Created attachment 220164 [details]
Patch
$ WEBKIT_USE_NETWORK_PROCESS=1 Programs/WebKit2APITests/TestWebKitWebContext -p /webkit2/WebKitWebContext/uri-scheme
/webkit2/WebKitWebContext/uri-scheme: OK
Comment on attachment 220164 [details] Patch 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. (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]
Updated patch
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]
New patch
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]
Rebased patch
Created attachment 221459 [details]
Try to fix mac build
Committed r162449: <http://trac.webkit.org/changeset/162449> |