[Webkit-unassigned] [Bug 54688] ThreadableLoaderClient needs willSendRequest method.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 17 21:40:56 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=54688





--- Comment #8 from David Levin <levin at chromium.org>  2011-02-17 21:40:56 PST ---
(In reply to comment #6)
> Is there a reason to pass the SubresourceLoader as a parameter to the client? It seems better to keep it an implementation detail. 

No, it was a copy/paste error.

(In reply to comment #7)
> Another question David: If we create this derived DocumentThreadableLoaderClient, why not change DocumentThreadableLoader to only accept this kind of client?

Not possible.

> Is there a use case for passing in a ThreadableLoaderClient? It would be nice to avoid the up-casting.
Yes and yes but unavoidable.

There are several places that create a ThreadableLoader (like XHR). They don't care if the underlying thing is a DocumentThreadableLoader or a WorkerThreadableLoader. It is totally transparent to them as it should be.

So they will pass in a ThreadableLoaderClient which is then passed to the DocumentThreadableLoader or WokerThreadableLoader. (The "Threadable" part of the name is a reference to the fact that the ThreadableLoader may be used on threads unlike all other loaders.)

Now, that I think about it, you could do make DocumentThreadableLoader only take a DocumentThreadableLoaderClient but you would have to make an adapter class which makes a ThreadableLoaderClient look like a DocumentThreadableLoaderClient (-- it would pass through all methods and ignore the willSendRequest). This feel uglier than the upcast (to me).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list