[webkit-dev] Blob scheme implementation
darin at chromium.org
Wed Sep 15 09:15:52 PDT 2010
On Wed, Sep 15, 2010 at 8:58 AM, Alexey Proskuryakov <ap at webkit.org> wrote:
> 14.09.2010, в 22:15, Darin Fisher написал(а):
> > I think it makes sense to extend ResourceHandle.cpp to access the
> BlobRegistry singleton in order to support blob URLs.
> The problem I see with adding blob support to ResourceHandle is that it
> makes it too difficult to maintain. It used to be a platform abstraction,
> and it was hard enough to make sure it worked well across platforms. Adding
> a significant amount of cross-platform logic on top of that isn't going to
> make it easier - especially when it's done via subclassing.
I don't understand why this seems so complicated. ResourceHandle.cpp
contains some code that is shared by all WebKit ports that can access their
network stack directly from the WebKit main thread. It already has some
common code for handling certain error cases (invalid URL, bad port). This
is the best point in the code to integrate blob URL support.
Maybe subclassing ResourceHandle is not the best way to go about this. It
seems fairly clean to me, but then, I'm not sure what the alternative
proposals look like.
> An example that prompted me to look into this was <
> http://trac.webkit.org/changeset/67503>. Here, a static function that
> reported platform capabilities had to become virtual, so that it could take
> blob loading logic into account. There is nothing in common between "are we
> running on a version of Mac OS X that supports this" and "are we loading a
> blob", and remembering this twist won't be easy.
Perhaps the static function should remain but be renamed? That way it can
remain the function that reports platform capabilities. However, as this
patch demonstrates, from WebCore's point of view, this needs to be a
property of ResourceHandle.
Maybe it would help if we better formalized the abstraction to the network
stack and let ResourceHandle grow to be a smart (contains cross-platform
helper code) front-end to that.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev