Closed Bug 808389 Opened 12 years ago Closed 12 years ago

nsIProtocolHandler uses same values for different flags

Categories

(Core :: Networking, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(2 files, 2 obsolete files)

const unsigned long URI_SYNC_LOAD_IS_OK = (1<<15);
const unsigned long URI_FORBIDS_COOKIE_ACCESS = (1<<15);

This looks really odd.
Blocks: 512566
Bug 557047 is also related since it added URI_FORBIDS_COOKIE_ACCESS, but that was before 
URI_SYNC_LOAD_IS_OK.
Ouch.  Yeah, that's broken, as is the fact that the flags are not in order on the interface.

We should switch URI_SYNC_LOAD_IS_OK to an empty bit.  Want to do it?
Yeah, I can do it.
Assignee: nobody → bugs
Attached patch simple (obsolete) — Splinter Review
Attachment #678159 - Flags: review?(bzbarsky)
Attached patch alternative, (obsolete) — Splinter Review
This makes the flags to be in order and also needs to switch the values
of URI_LOADABLE_BY_SUBSUMERS and URI_NON_PERSISTABLE.

Review the one you prefer. I'd take this patch.
Attachment #678160 - Flags: review?(bzbarsky)
I think you need to bump an iid for either patches because changing constatnt values will break binary compatibility.
indeed.
Attached patch simpleSplinter Review
Attachment #678159 - Attachment is obsolete: true
Attachment #678159 - Flags: review?(bzbarsky)
Attachment #678167 - Flags: review?(bzbarsky)
Attached patch alternativeSplinter Review
Attachment #678160 - Attachment is obsolete: true
Attachment #678160 - Flags: review?(bzbarsky)
Attachment #678168 - Flags: review?(bzbarsky)
Comment on attachment 678168 [details] [diff] [review]
alternative

I think I like this one.  r=me, but should get sr from biesi.
Attachment #678168 - Flags: superreview?(cbiesinger)
Attachment #678168 - Flags: review?(bzbarsky)
Attachment #678168 - Flags: review+
Comment on attachment 678167 [details] [diff] [review]
simple

This is fine by me too, would need an sr as well.
Attachment #678167 - Flags: review?(bzbarsky) → review+
Attachment #678168 - Flags: superreview?(cbiesinger) → superreview+
https://hg.mozilla.org/mozilla-central/rev/50cd5f7339f6
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
(In reply to Masatoshi Kimura [:emk] from comment #7)
> I think you need to bump an iid for either patches because changing
> constatnt values will break binary compatibility.

Actually, changing constants doesn't break binary compatibility.
(In reply to :Ms2ger from comment #14)
> (In reply to Masatoshi Kimura [:emk] from comment #7)
> > I think you need to bump an iid for either patches because changing
> > constatnt values will break binary compatibility.
> 
> Actually, changing constants doesn't break binary compatibility.

If a binary component had used the constant URI_NON_PERSISTABLE in the source code, only the value (1<<10) would be embeded in the binary. Now, Gecko expects (1<<14) as a value for URI_NON_PERSISTABLE. JavaScript components would have no trouble because they usually refer the constant using the symbol.
Doesn't it break binary compatibility?
_Adding_ constants does not change binary compat.

Changing the meaning of existing numeric values of course breaks binary compat...
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: