Closed
Bug 1390428
Opened 7 years ago
Closed 7 years ago
Remove nsXPIDLCString
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(10 files)
50.95 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
65.57 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
5.46 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
8.83 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
11.63 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
3.96 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
4.25 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
965 bytes,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
70.93 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
929 bytes,
patch
|
jorgk-bmo
:
review+
|
Details | Diff | Splinter Review |
Let's remove nsXPIDLCString.
Assignee | ||
Comment 1•7 years ago
|
||
These are all easy cases where an nsXPIDLCString local variable is set via getter_Copies() and then is only used in ways that nsCStrings can also be used (i.e. no null checks or implicit conversions to |char*|). In every case the patch trivially replaces the nsXPIDLCString with an nsCString. (Also, there are a couple of unused nsXPIDLCString variables that the patch simply removes.)
Attachment #8897353 -
Flags: review?(erahm)
Assignee | ||
Comment 2•7 years ago
|
||
These are all easy cases where an nsXPIDLCString local variable is set via getter_Copies() and then is used in ways that rely on the implicit conversion to |char*|. The patch uses get() and EqualsLiteral() calls to replace the implicit conversions.
Attachment #8897355 -
Flags: review?(erahm)
Assignee | ||
Comment 3•7 years ago
|
||
Most of these fields are not using any nsXPIDLCString-specific features. The exceptions are mUserAgentOverride and mDefaultSocketType, which require a little more care.
Attachment #8897356 -
Flags: review?(erahm)
Assignee | ||
Comment 4•7 years ago
|
||
These are all easy cases where an nsXPIDLCString local variable is set via getter_Copies() and then is null checked. The patch uses IsVoid() to replace the null checks (and get() and EqualsLiteral() calls to replace any implicit conversions).
Attachment #8897358 -
Flags: review?(erahm)
Assignee | ||
Comment 5•7 years ago
|
||
These are all simple cases, with similarities to previous patches in this series.
Attachment #8897359 -
Flags: review?(erahm)
Updated•7 years ago
|
Attachment #8897353 -
Flags: review?(erahm) → review+
Updated•7 years ago
|
Attachment #8897355 -
Flags: review?(erahm) → review+
Updated•7 years ago
|
Attachment #8897356 -
Flags: review?(erahm) → review+
Updated•7 years ago
|
Attachment #8897358 -
Flags: review?(erahm) → review+
Comment 6•7 years ago
|
||
Comment on attachment 8897359 [details] [diff] [review] (part 5) - Remove more nsXPIDLCString uses Review of attachment 8897359 [details] [diff] [review]: ----------------------------------------------------------------- r+ with minor nits addressed ::: xpfe/components/directory/nsDirectoryViewer.cpp @@ +741,2 @@ > GetDestination(r, uri); > + return uri.get() && !strncmp(uri.get(), kFTPProtocol, sizeof(kFTPProtocol) - 1) && a) Should this be `!uri.IsVoid()`? I thought we always used empty string internally, but I'm might be recalling incorrectly b) We could just use `StringBeginsWith(uri, NS_LITERAL_CSTRING(kFTPProtocol)` now @@ +936,5 @@ > if (source) { > httpIndex->GetDestination(source, uri); > } > > + if (!uri.get()) { Same question about IsVoid
Attachment #8897359 -
Flags: review?(erahm) → review+
Assignee | ||
Comment 7•7 years ago
|
||
> > + return uri.get() && !strncmp(uri.get(), kFTPProtocol, sizeof(kFTPProtocol) - 1) && > > a) Should this be `!uri.IsVoid()`? I thought we always used empty string > internally, but I'm might be recalling incorrectly > b) We could just use `StringBeginsWith(uri, > NS_LITERAL_CSTRING(kFTPProtocol)` now Yes and yes! Good catches, thank you. > > + if (!uri.get()) { > > Same question about IsVoid Correct here, too.
Assignee | ||
Comment 8•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/822d7f1bc602f84332b13e258738aa3b95700691 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
Assignee | ||
Updated•7 years ago
|
Keywords: leave-open
Assignee | ||
Comment 9•7 years ago
|
||
These are all straightforward except for InternalLoadEvent::mTypeHint, which requires a bit of care to preserve existing behaviour.
Attachment #8898145 -
Flags: review?(erahm)
Assignee | ||
Comment 10•7 years ago
|
||
The existing comment was very helpful here.
Attachment #8898146 -
Flags: review?(erahm)
Assignee | ||
Comment 11•7 years ago
|
||
This change makes NullCString() work the same way as NullString().
Attachment #8898147 -
Flags: review?(erahm)
Assignee | ||
Comment 12•7 years ago
|
||
This is straightforward, with only two notable things. - `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"` throughout, because all nsXPIDLString.h did was include nsString.h. The exception is for files which already include nsString.h, in which case the patch just removes the nsXPIDLString.h inclusion. - The patch removes the |xpidl_string| gtest, but improves the |voided| test to cover some of its ground, e.g. testing Adopt(nullptr).
Attachment #8898148 -
Flags: review?(erahm)
Comment 13•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/822d7f1bc602
Assignee | ||
Comment 14•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/fbf0e8609abb4b978070dd0cbfcab6de7b2cda73 Bug 1390428 (part 2) - Remove more nsXPIDLCString local variables. r=erahm.
Comment 15•7 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #14) > https://hg.mozilla.org/integration/mozilla-inbound/rev/ > fbf0e8609abb4b978070dd0cbfcab6de7b2cda73 > Bug 1390428 (part 2) - Remove more nsXPIDLCString local variables. r=erahm. Backed out for various Windows clipboard test failures (Win7/Win8, all flavors). https://hg.mozilla.org/integration/mozilla-inbound/rev/d2571908d00cad44be3fc9dcc14426060b8b0a77 https://treeherder.mozilla.org/logviewer.html#?job_id=124096377&repo=mozilla-inbound
Flags: needinfo?(n.nethercote)
Updated•7 years ago
|
Attachment #8898145 -
Flags: review?(erahm) → review+
Updated•7 years ago
|
Attachment #8898146 -
Flags: review?(erahm) → review+
Updated•7 years ago
|
Attachment #8898147 -
Flags: review?(erahm) → review+
Comment 16•7 years ago
|
||
Comment on attachment 8898148 [details] [diff] [review] (part 9) - Remove nsXPIDLCString Review of attachment 8898148 [details] [diff] [review]: ----------------------------------------------------------------- \o/
Attachment #8898148 -
Flags: review?(erahm) → review+
Assignee | ||
Comment 17•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/cc8e481fd0e16fba17ab6786a3f5212ab814c0e9 Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm.
Comment 18•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cc8e481fd0e1
Assignee | ||
Comment 19•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/009055acb0b72b06f64570bd4c91eb6742975307 Bug 1390428 (part 3) - Remove nsXPIDLCString use in nsHttpHandler. r=erahm. https://hg.mozilla.org/integration/mozilla-inbound/rev/0db0af85307fc2458bf255661cc72bd6f6ff97ab Bug 1390428 (part 4) - Remove still more nsXPIDLCString local variables. r=erahm. https://hg.mozilla.org/integration/mozilla-inbound/rev/c6cd458e0634bc42e4dd8f1bf5dcc53fe701dcde Bug 1390428 (part 5) - Remove more nsXPIDLCString uses. r=erahm.
Comment 20•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/009055acb0b7 https://hg.mozilla.org/mozilla-central/rev/0db0af85307f https://hg.mozilla.org/mozilla-central/rev/c6cd458e0634
Assignee | ||
Comment 21•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d792b3bb3d98254f2ba3ea23d0bfeb3151c99aa5 Bug 1390428 (part 6) - Remove nsXPIDLCString class members. r=erahm. https://hg.mozilla.org/integration/mozilla-inbound/rev/eeab1b5748c568d30b7909a7eae2b8fceb3956cf Bug 1390428 (part 7) - Remove a tricky nsXPIDLCString variable. r=erahm. https://hg.mozilla.org/integration/mozilla-inbound/rev/63a6f7bcca059cffac8cd9e4320cb1b107b8dbda Bug 1390428 (part 8) - Remove nsXPIDLCString use in NullCString(). r=erahm. https://hg.mozilla.org/integration/mozilla-inbound/rev/e3e420a10be0c7b2037fab085aa7e25633b6242a Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm.
Assignee | ||
Comment 22•7 years ago
|
||
I updated https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Guide/Internal_strings to remove all mentions of nsXPIDL[C]String.
Flags: needinfo?(n.nethercote)
Keywords: leave-open
Should this still have the 'leave-open' keyword?
Flags: needinfo?(n.nethercote)
Assignee | ||
Comment 24•7 years ago
|
||
> Should this still have the 'leave-open' keyword?
I had already removed it. But thank you for paying attention :)
Flags: needinfo?(n.nethercote)
Comment 25•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d792b3bb3d98 https://hg.mozilla.org/mozilla-central/rev/eeab1b5748c5 https://hg.mozilla.org/mozilla-central/rev/63a6f7bcca05 https://hg.mozilla.org/mozilla-central/rev/e3e420a10be0
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Assignee | ||
Comment 26•7 years ago
|
||
Attachment #8900559 -
Flags: review?(jorgk)
Comment 27•7 years ago
|
||
Comment on attachment 8900559 [details] [diff] [review] Remove unused nsXPIDLString.h inclusion Thanks.
Attachment #8900559 -
Flags: review?(jorgk) → review+
Comment 28•7 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/56c3a9e0cbda Remove unused nsXPIDLString.h inclusion. r=jorgk
Updated•3 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•