Closed Bug 572151 Opened 14 years ago Closed 9 years ago

Remove calls to SetCookies from HttpChannelChild

Categories

(Core :: Networking: HTTP, defect, P2)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
e10s + ---
firefox42 --- fixed

People

(Reporter: stechz, Assigned: mayhemer)

References

Details

Attachments

(1 file, 1 obsolete file)

need to investigate
Blocks: old-e10s-m2
Assignee: nobody → mrbkap
Priority: -- → P2
This sounds related to bug 1043256, is it fixed now?
Flags: needinfo?(mrbkap)
Blocks: e10s-necko
No longer blocks: old-e10s-m2
Whiteboard: [e10s-m3]
Moving to M3 milestone. These bugs affect e10s dogfooding but Brad and Gavin did not think they were M2 blockers.
Flags: needinfo?(mrbkap)
This was actually fixed by bug 558624. We still waste some time calling SetCookie in the child, though. That's an easy fix.
Attached patch patch v1 (obsolete) (deleted) — Splinter Review
I left the call to SetCookie because it notifies observers about the cookie (via the http-on-response-set-cookie) notification. I wasn't sure by looking at who uses it whether we need to send the notification in the child or not. I'm leaving it in for now.
Attachment #8507255 - Flags: review?(jduell.mcbugs)
Jason, any ETA on Blake's review request? :)
Flags: needinfo?(jduell.mcbugs)
Whiteboard: [e10s-m3]
Comment on attachment 8507255 [details] [diff] [review] patch v1 Review of attachment 8507255 [details] [diff] [review]: ----------------------------------------------------------------- So I'm not sure if we can simply make SetCookie() a no-op like this in the child. We still have a couple places where we're explicitly calling it--so we should either remove those call sites, or if they're doing something important, do a different fix here: 1) https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/HttpChannelChild.cpp#472 2) https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/HttpChannelChild.cpp#1072 At this point we only call SetCookie in one place in nsHttpChannel: https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpChannel.cpp#1355 Honza, do you know if that call makes both #1 and #2 redundant to call in the child? #1 looks OK, but I'm less sure about the redirect case. ::: netwerk/protocol/http/HttpBaseChannel.cpp @@ +1408,5 @@ > > + bool useCookieService = > + (XRE_GetProcessType() == GeckoProcessType_Default); > + nsresult rv = NS_OK; > + if (useCookieService) { Nit: we could just use "if (!IsNeckoChild())" here.
Attachment #8507255 - Flags: review?(jduell.mcbugs) → review?(honzab.moz)
(In reply to Jason Duell [:jduell] (needinfo? me) from comment #7) > Comment on attachment 8507255 [details] [diff] [review] > patch v1 > > Review of attachment 8507255 [details] [diff] [review]: > ----------------------------------------------------------------- > > So I'm not sure if we can simply make SetCookie() a no-op like this in the > child. We still have a couple places where we're explicitly calling it--so > we should either remove those call sites, or if they're doing something > important, do a different fix here: > > 1) > https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/ > HttpChannelChild.cpp#472 > 2) > https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/ > HttpChannelChild.cpp#1072 > > At this point we only call SetCookie in one place in nsHttpChannel: > > > https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/ > nsHttpChannel.cpp#1355 > > Honza, do you know if that call makes both #1 and #2 redundant to call in > the child? #1 looks OK, but I'm less sure about the redirect case. Both are absolutely redundant. As I understand, SetCookie on HttpChannelChild only ends up sending PCookieService.SetCookieString that again sets the same (and maybe even older!) string on the parent. http://hg.mozilla.org/mozilla-central/annotate/2209a8de5d23/netwerk/cookie/CookieServiceParent.cpp#l104 Both can definitely go away. OTOH, I kinda don't follow title of this bug - what is it we actually need here? Auth is fully handled on the parent. Dialogs are popped on the parent. Cookies and auth cache is handled on the parent. Child only receives OnStart/etc after the auth cycle is done (succeeded or failed). If there is a Cookie request header set on the child prior AsyncOpen we send it up in the request head serialization. On the parent it merges with what has been stored in the cookie service. And child then gets the request headers in RecvOnStartRequest. So we do update (Cookie and Set-Cookies is gonna be there as well). The title should update IMO.
Comment on attachment 8507255 [details] [diff] [review] patch v1 Review of attachment 8507255 [details] [diff] [review]: ----------------------------------------------------------------- Please just remove calls to SetCookie from HttpChannelChild. Do we still need this? http://hg.mozilla.org/mozilla-central/annotate/2209a8de5d23/netwerk/cookie/PCookieService.ipdl#l98
Attachment #8507255 - Flags: review?(honzab.moz) → review-
> Do we still need this? > http://hg.mozilla.org/mozilla-central/annotate/2209a8de5d23/netwerk/cookie/PCookieService.ipdl#l98 I assume we still need this to support setting cookies from JS in the child. i.e the nsHTMLDocument::SetCookie() codepath.
Flags: needinfo?(jduell.mcbugs)
According info from Jason taking this bug.
Assignee: mrbkap → honzab.moz
Status: NEW → ASSIGNED
Attached patch v2 (deleted) — Splinter Review
Attachment #8507255 - Attachment is obsolete: true
Attachment #8573394 - Flags: review?(jduell.mcbugs)
Comment on attachment 8573394 [details] [diff] [review] v2 Review of attachment 8573394 [details] [diff] [review]: ----------------------------------------------------------------- My only question: do we have enough cookie test coverage to notice if this breaks anything?
Attachment #8573394 - Flags: review?(jduell.mcbugs) → review+
Summary: e10s: Propagate cookies from auth responses to subsequent auth request → Remove calls to SetCookies from HttpChannelChild
(In reply to Jason Duell [:jduell] (needinfo? me) from comment #13) > Comment on attachment 8573394 [details] [diff] [review] > v2 > > Review of attachment 8573394 [details] [diff] [review]: > ----------------------------------------------------------------- > > My only question: do we have enough cookie test coverage to notice if this > breaks anything? I'm not maintaining cookies, so I'm not the right one to ask. Maybe ehsan?
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: