Closed Bug 1271921 Opened 8 years ago Closed 8 years ago

Log Deprecation within ioService when calling NewChannel2() fails

Categories

(Core :: DOM: Security, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: ckerschb, Assigned: ckerschb)

References

(Blocks 1 open bug)

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file)

      No description provided.
Assignee: nobody → ckerschb
Blocks: 1006868
Status: NEW → ASSIGNED
Whiteboard: [domsecurity-active]
Comment on attachment 8751210 [details] [diff] [review]
bug_1271921_log_deprecation_warning_within_ioservice.patch

Review of attachment 8751210 [details] [diff] [review]:
-----------------------------------------------------------------

Actually, I don't think we should do this. I'm not convinced that I prefer addons implementing asyncOpen2 themselves. It seems quite easy for them to forget to do the proper security checks.
Attachment #8751210 - Flags: review?(jonas) → review-
(In reply to Jonas Sicking (:sicking) from comment #2)
> Actually, I don't think we should do this. I'm not convinced that I prefer
> addons implementing asyncOpen2 themselves. It seems quite easy for them to
> forget to do the proper security checks.

Well, at the moment we fall back to using AsyncOpen() in case AsyncOpen2() is not implemented. AsyncOpen() doesn't do any security checks at all, so no difference in my opinion. The reason why I would like to log a warning is, because we could really deprecate asyncOpen completely and move the logic from asyncOpen into asyncOpen2 at some point.
Flags: needinfo?(jonas)
> Well, at the moment we fall back to using AsyncOpen() in case AsyncOpen2() is not implemented.

No we don't. We implement AsyncOpen2 ourselves when newChannel2 is not implemented. No?
Flags: needinfo?(jonas)
(In reply to Jonas Sicking (:sicking) from comment #4)
> > Well, at the moment we fall back to using AsyncOpen() in case AsyncOpen2() is not implemented.
> 
> No we don't. We implement AsyncOpen2 ourselves when newChannel2 is not
> implemented. No?

Arrh, sorry for the confusion. Not AsyncOpen!!!
s/asyncOpen/newchannel in comment 3.

In case NewChannel2() is not implemented, we fall back to using NewChannel().
You confused me within comment 2. The deprecation warning is only about NewChannel.
When newChannel2 is not implemented, we don't fall back to using newChannel. We use newChannel but we *also* create a wrapper which properly implements AsyncOpen2. I think that's better than asking addon developers to implement AsyncOpen2 themselves.
Oh, sure, you are right, that is indeed the better solution. But that also means we can never really deprecate newChannel.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
We can deprecate IOService.newChannel. But we couldn't deprecate nsIProtocolHandler.newChannel indeed. But only nsIOService.cpp should be calling nsIProtocolHandler.newChannel.
(In reply to Jonas Sicking (:sicking) from comment #9)
> We can deprecate IOService.newChannel. But we couldn't deprecate
> nsIProtocolHandler.newChannel indeed. But only nsIOService.cpp should be
> calling nsIProtocolHandler.newChannel.

Sure, agreed. I am just worried if we don't clean up everything our code gets messy over time.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: