RESOLVED FIXED 125379
Refactor the CFURLConnectionClient to be the synchronous implementation of an abstract network delegate
https://bugs.webkit.org/show_bug.cgi?id=125379
Summary Refactor the CFURLConnectionClient to be the synchronous implementation of an...
Benjamin Poulain
Reported 2013-12-06 21:47:09 PST
Refactor the CFURLConnectionClient to be the synchronous implementation of an abstract network delegate
Attachments
Patch (68.38 KB, patch)
2013-12-06 21:54 PST, Benjamin Poulain
no flags
Patch (68.39 KB, patch)
2013-12-06 22:57 PST, Benjamin Poulain
no flags
Patch (68.67 KB, patch)
2013-12-08 21:57 PST, Benjamin Poulain
no flags
Patch (69.68 KB, patch)
2013-12-08 22:40 PST, Benjamin Poulain
no flags
Patch (69.91 KB, patch)
2013-12-09 01:33 PST, Benjamin Poulain
ap: review+
Benjamin Poulain
Comment 1 2013-12-06 21:54:31 PST
Build Bot
Comment 2 2013-12-06 22:36:11 PST
Benjamin Poulain
Comment 3 2013-12-06 22:57:05 PST
Build Bot
Comment 4 2013-12-06 23:37:44 PST
Benjamin Poulain
Comment 5 2013-12-08 21:57:24 PST
Build Bot
Comment 6 2013-12-08 22:40:11 PST
Benjamin Poulain
Comment 7 2013-12-08 22:40:46 PST
Build Bot
Comment 8 2013-12-08 23:24:10 PST
Benjamin Poulain
Comment 9 2013-12-09 01:33:08 PST
Alexey Proskuryakov
Comment 10 2013-12-09 09:43:36 PST
Comment on attachment 218737 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=218737&action=review > Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:37 > +} > +ResourceHandleCFURLConnectionDelegate::~ResourceHandleCFURLConnectionDelegate() Missing empty line here. > Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:239 > +#if PLATFORM(WIN) > + if (m_handle->client() && !m_handle->client()->shouldCacheResponse(m_handle, cachedResponse)) > + return 0; > +#else > + CFCachedURLResponseRef newResponse = m_handle->client()->willCacheResponse(m_handle, cachedResponse); > + if (newResponse != cachedResponse) > + return newResponse; > +#endif Why are these different? Strange that we only null check on Windows too. > Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:35 > +class SynchronousResourceHandleCFURLConnectionDelegate FINAL : public ResourceHandleCFURLConnectionDelegate { Thinking about the naming more, I'm still not a fan. This sounds as if it was about synchronous and asynchronous requests, which it is not. Also, both sync and (future) async delegates actually use the same API, the only difference is that one of these is meant to be used on a secondary thread, and has built-in thread hopping. But I don't have a better suggestion. > Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:46 > + > + Two empty lines.
Benjamin Poulain
Comment 11 2013-12-09 15:41:09 PST
(In reply to comment #10) > > Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:239 > > +#if PLATFORM(WIN) > > + if (m_handle->client() && !m_handle->client()->shouldCacheResponse(m_handle, cachedResponse)) > > + return 0; > > +#else > > + CFCachedURLResponseRef newResponse = m_handle->client()->willCacheResponse(m_handle, cachedResponse); > > + if (newResponse != cachedResponse) > > + return newResponse; > > +#endif > > Why are these different? > > Strange that we only null check on Windows too. Probably historical reasons. The whole API on Windows is different here. > > Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:35 > > +class SynchronousResourceHandleCFURLConnectionDelegate FINAL : public ResourceHandleCFURLConnectionDelegate { > > Thinking about the naming more, I'm still not a fan. This sounds as if it was about synchronous and asynchronous requests, which it is not. Also, both sync and (future) async delegates actually use the same API, the only difference is that one of these is meant to be used on a secondary thread, and has built-in thread hopping. I'll land with the current name. It is not a big deal changing that afterwards (or hopefully getting rid of the classes eventually).
Benjamin Poulain
Comment 12 2013-12-09 15:42:13 PST
Note You need to log in before you can comment on or make changes to this bug.