Closed Bug 536283 Opened 15 years ago Closed 15 years ago

e10s HTTP: send full nsHttpResponseHead in OnStartRequest

Categories

(Core :: Networking: HTTP, defect)

Other Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jduell.mcbugs, Assigned: lusian)

References

Details

Attachments

(2 files)

HttpChannelParent should serialize mResponseHead to the child process's HttpChannelChild during SendOnStartRequest.  The child channel should pretty much be able to adopt it wholesale (use same name for member variable and everything, so we can potentially move methods that access it into a shared base class that nsHttpChannel can also use).
Assignee: nobody → lusian
Attached file a question (deleted) —
I have a question in line 25: how do I get 'nsHttpResponseHead *responseHead' here?
> how do I get 'nsHttpResponseHead *responseHead'?

So, responseHead is a private member variable of nsHttpChannel, and we need to expose a way to let HttpChannelParent get at it.

There's two ways to do this:  the way we used to do it, and the way we're going to start doing it.

The way we've done this in the past is to add a new function to the XPCOM interface, i.e. "GetResponseHead()".  Since the nsIHttpChannel is frozen, we have to use a different interface (nsIHttpChannelInternal) to dump new functions into.  So we QueryInterface the same nsHttpChannel into three different pointers--an nsIRequest, an nsIHttpChannel, and an nsIHttpChannelInternal--which we use to call different methods of nsHttpChannel.

The new way is to simply add a GetResponseHead() function to nsHttpChannel, get a direct pointer to the nsHttpChannel, and then call whatever we want directly.  No more XPCOM.

    nsHttpChannel *chan = static_cast<nsHttpChannel *>(aRequest);
    chan->GetResponseHead(...);

The reason to use the XPCOM goop is to guarantee that things work if an extension decides to override some or all of the HTTP protocol's classes with it's own code.   But we've decided (or at least bsmedberg has :) that no code we care about actually does this.   Of course we still need to use XPCOM whenever we need reference counting, and all our existing code uses it.  But for methods like OnStartRequest, where we're handed a pointer to an nsIRequest and don't need to worry about its lifetime, 

This patch implements GetResponseHead, and should get you started.
http://hg.mozilla.org/projects/electrolysis/rev/d56ce00d30e8
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: