Closed Bug 1432519 Opened 6 years ago Closed 6 years ago

Make nsIURL attributes readonly

Categories

(Core :: Networking, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: valentin, Assigned: valentin)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

      No description provided.
Comment on attachment 8944773 [details]
Bug 1432519 - Make nsIURL attributes readonly

https://reviewboard.mozilla.org/r/214936/#review220750

::: commit-message-676a8:1
(Diff revision 1)
> +Bug 1432519 - Make nsIURI attributes readonly

Nit: nsIURL
Comment on attachment 8944773 [details]
Bug 1432519 - Make nsIURL attributes readonly

https://reviewboard.mozilla.org/r/214936/#review220886

::: commit-message-676a8:1
(Diff revision 1)
> +Bug 1432519 - Make nsIURI attributes readonly

actually quite important nit!! :)

::: netwerk/base/nsIURL.idl:65
(Diff revision 1)
>       * Some characters may be escaped.
>       */
> -    attribute AUTF8String fileName;
> +    readonly attribute AUTF8String fileName;
>  
> +    [noscript,notxpcom,nostdcall]
> +    nsresult setFileNameInternal(in ACString aFileName);

wasn't the whole purpose of this enterprise to remove public setters on all UR* interfaces?
(In reply to Honza Bambas (:mayhemer) from comment #7)
> ::: netwerk/base/nsIURL.idl:65
> > +    [noscript,notxpcom,nostdcall]
> > +    nsresult setFileNameInternal(in ACString aFileName);
> 
> wasn't the whole purpose of this enterprise to remove public setters on all
> UR* interfaces?

You're absolutely right. Initially I thought we might need these to be on the URI to use in GTests.
We actually don't need them. I'll make them private to the implementations.
Ignore the nsIFileURL changes in the latest diff. I rebased this patch on top of bug 1432602.
Comment on attachment 8944773 [details]
Bug 1432519 - Make nsIURL attributes readonly

https://reviewboard.mozilla.org/r/214936/#review222038

::: netwerk/base/nsStandardURL.h:457
(Diff revisions 1 - 2)
> +
> +            nsresult rv = uri->SetFile(aFile);
> +            if (NS_FAILED(rv)) {
> +                return rv;
> +            }
> +            BaseURIMutator<T>::mURI = uri;

nit: swap?
Attachment #8944773 - Flags: review?(honzab.moz) → review+
I plan to land this bug next week.
mailnews needs to implement changes similar to bug 1432320 by then.
Flags: needinfo?(jorgk)
Depends on: 1434687
Thanks, I filed bug 1434687 for that. If I find time, I might prepare a patch for C-C by applying the patch here locally. Or I'll just deal with the bustage which I don't expect to be large. I haven't taken a good look at how much JS code is affected.
Flags: needinfo?(jorgk)
Priority: -- → P3
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/178575b934ea
Make nsIURL attributes readonly r=mayhemer
https://hg.mozilla.org/mozilla-central/rev/178575b934ea
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: