Closed
Bug 243213
Opened 21 years ago
Closed 21 years ago
Don't waste time/space with a per-docshell reference to the nsIURIFixup service.
Categories
(Core :: DOM: Navigation, defect)
Core
DOM: Navigation
Tracking
()
RESOLVED
FIXED
People
(Reporter: jst, Assigned: adamlock)
Details
Attachments
(1 file)
15.67 KB,
patch
|
bzbarsky
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
For every docshell we create (2 per window, generally) we end up looking up the
nsIURIFixup service only to store it in a docshell member when we could just
keep a single static member reference to it. Patch coming up.
Reporter | ||
Comment 1•21 years ago
|
||
... and also move some members around to save a bit of memory on some 64-bit
platforms.
Reporter | ||
Updated•21 years ago
|
Attachment #148128 -
Flags: superreview?(darin)
Attachment #148128 -
Flags: review?(bzbarsky)
![]() |
||
Comment 2•21 years ago
|
||
Comment on attachment 148128 [details] [diff] [review]
Make nsDocShell::mURIFixup a static member.
>Index: docshell/base/nsDocShell.cpp
>+ if (gDocShellCount++ == 0) {
Assert that sURIFixup is null here?
r=bzbarsky, though it may be worthwhile to change that slew of PRPackedBools
into a bitfield....
Attachment #148128 -
Flags: review?(bzbarsky) → review+
Comment 3•21 years ago
|
||
Comment on attachment 148128 [details] [diff] [review]
Make nsDocShell::mURIFixup a static member.
sr=darin
Attachment #148128 -
Flags: superreview?(darin) → superreview+
Reporter | ||
Comment 4•21 years ago
|
||
Assertion added. It might be worth making those PRPackedBool's into bitfields,
yes, but I'll wipe that under the hopefully upcoming major nsDocShell cleanup
carpet for now :-)
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
jst, looks like there is an oversight in the dangling |else| below. The first
consumer will miss sURIFixup. Shouldn't it be:
if (!sURIFixup) {
...create it
}
if (sURIFixup) {
...use it
}
=====================
+ if (!sURIFixup) {
+ // No fixup service so try and create a URI and see what happens
+ nsAutoString uriString(aURI);
+ // Cleanup the empty spaces that might be on each end.
+ uriString.Trim(" ");
+ // Eliminate embedded newlines, which single-line text fields now allow:
+ uriString.StripChars("\r\n");
+ NS_ENSURE_TRUE(!uriString.IsEmpty(), NS_ERROR_FAILURE);
- rv = NS_NewURI(getter_AddRefs(uri), uriString);
- }
- }
- if (mURIFixup) {
+ rv = NS_NewURI(getter_AddRefs(uri), uriString);
+ } else {
Reporter | ||
Comment 6•21 years ago
|
||
Um, looks right to me. Am I missing something obvious here?
Ah, ok. I now see that's what you meant.
http://bugzilla.mozilla.org/attachment.cgi?id=148128&action=diff#mozilla/docshell/base/nsDocShell.cpp_sec3
You need to log in
before you can comment on or make changes to this bug.
Description
•