Closed Bug 306015 Opened 19 years ago Closed 8 years ago

Expose more information about redirects in STATE_REDIRECTING events [was: pass onChannelRedirect notifications to nsIWebProgressListeners that impl nsIChannelEventSink]

Categories

(Core Graveyard :: Embedding: APIs, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: timeless, Assigned: timeless)

Details

Attachments

(1 file)

we need a way to get redirect notifications for stuff we observe. biesi
suggested allowing nsIWebProgressListener implementations to also implement
nsIChannelEventSink and forwarding notifications there.
Attached patch pass it alongSplinter Review
Attachment #193897 - Flags: superreview?(darin)
Attachment #193897 - Flags: review?(cbiesinger)
Comment on attachment 193897 [details] [diff] [review]
pass it along

this'd be simpler if you forwarded OnChannelRedirect before calling
OnStateChange...

I'm not sure it's a good idea to foward to the parent... it certainly has the
downside that the listener can't tell whether the parent itself or a child of
it was redirected...
Comment on attachment 193897 [details] [diff] [review]
pass it along

hrm, this patch also doesn't tell you whether the redirect was the document
itself or an image or something...
Comment on attachment 193897 [details] [diff] [review]
pass it along

I think we decided that this patch is not sufficient, right?
Attachment #193897 - Flags: superreview?(darin) → superreview-
So, IIRC.. a better solution would be to stash a reference to the new channel on
the old channel that is passed to onStateChange(STATE_REDIRECTING).  We could
also stash the redirect flags as well.  We could either make the channel do this
for us or we could make DocLoader::OnChannelRedirect do it before issuing the
onStateChange call.
Summary: pass onChannelRedirect notifications to nsIWebProgressListeners that impl nsIChannelEventSink → Expose more information about redirects in STATE_REDIRECTING events [was: pass onChannelRedirect notifications to nsIWebProgressListeners that impl nsIChannelEventSink]
Comment on attachment 193897 [details] [diff] [review]
pass it along

note that what darin said would have the interesting property that one could
follow the entire redirect chain up to the original channel. (if only I
remembered what I wanted to do with that information last time I wanted it...)
Attachment #193897 - Flags: review?(cbiesinger) → review-
biesi: actually, because we pass the old channel in the onStateChange
notification, you'd only be able to learn about the new channel.
oh, hrm. I guess that's true. we could also store the previous channel on the
new channel though :-) (although, we better don't do this, due to ref cycles...)
QA Contact: apis
Marking a bunch of bugs in the "Embedding: APIs" component INCOMPLETE in preparation to archive that component. If I have done this incorrectly, please reopen the bugs and move them to a more correct component as we don't have "embedding" APIs any more.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: