Closed
Bug 336699
Opened 19 years ago
Closed 19 years ago
[FIX]Use immutable uris in docshell and document if possible
Categories
(Core Graveyard :: Embedding: APIs, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
Patch coming up. I definitely want the nsDocShell::GetCurrentURI patch, but I kinda like the rest of it too... ;)
As usual, naming suggestions are welcome.
I added the nsINetUtil method because inlining that in a lot of places looked like a lot of code, but inlining the code to call it doesn't look like it's _all_ that much less. :(
Assignee | ||
Comment 1•19 years ago
|
||
Darin, I'll ask jst to sr and review the nsDocument changes, so just need your review on the netwerk and docshell bits.
Attachment #220884 -
Flags: review?(darin)
Assignee | ||
Updated•19 years ago
|
Assignee: nobody → bzbarsky
QA Contact: bzbarsky → apis
Assignee | ||
Comment 2•19 years ago
|
||
Attachment #220884 -
Attachment is obsolete: true
Attachment #220885 -
Flags: review?(darin)
Attachment #220884 -
Flags: review?(darin)
Comment 3•19 years ago
|
||
Comment on attachment 220885 [details] [diff] [review]
Patch I meant to post
>Index: netwerk/base/public/nsINetUtil.idl
>+ /**
>+ * Take aURI and produce an immutable version of it for the caller. If aURI
>+ * is immutable this will be aURI itself; otherwise this will be a clone,
>+ * marked immutable if possible. Passing null to this method is allowed; in
>+ * that case it will return null.
>+ */
>+ nsIURI makeURIImmutable(in nsIURI aURI);
Another possible name: toImmutableURI ?
"II" bugs me :)
>Index: docshell/base/nsDocShell.cpp
>+ mCurrentURI = NS_MakeURIImmutable(aURI);
I think this method should be named differently. The name implies that
it will succeed in making the URI immutable, but in reality it may not
succeed. This means that you cannot assume that mCurrentURI is immutable,
so you need to use NS_EnsureSafeToReturn when giving out a pointer to it.
That's not very obvious from reading the code. Maybe a name change would
help.
NS_ToImmutableURIIfSupported? NS_MaybeMakeURIImmutable?
Those names suck :(
r=darin w/ hope for a better name
Attachment #220885 -
Flags: review?(darin) → review+
Assignee | ||
Comment 4•19 years ago
|
||
Comment on attachment 220885 [details] [diff] [review]
Patch I meant to post
> Another possible name: toImmutableURI ?
Sure.
How about NS_TryToMakeImmutable for the other thing?
Attachment #220885 -
Flags: superreview?(jst)
Comment 5•19 years ago
|
||
Yeah, I like that.
Comment 6•19 years ago
|
||
Comment on attachment 220885 [details] [diff] [review]
Patch I meant to post
sr=jst
Attachment #220885 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 7•19 years ago
|
||
Attachment #220885 -
Attachment is obsolete: true
Assignee | ||
Comment 8•19 years ago
|
||
Fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•