Closed
Bug 711841
Opened 14 years ago
Closed 14 years ago
Add VoidString() or NullString() or NullDOMString()
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla12
People
(Reporter: smaug, Assigned: smaug)
Details
Attachments
(1 file)
|
9.29 KB,
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
Atm, one needs to explicitly call SetIsVoid(). Would be nice to have something
close to EmptyString()
| Assignee | ||
Comment 1•14 years ago
|
||
Something like
#define NullString() nsXPIDLString()
#define NullCString() nsXPIDLCString()
Assignee: nobody → bugs
| Assignee | ||
Comment 2•14 years ago
|
||
Or better to implement it like Empty(C)String
| Assignee | ||
Comment 3•14 years ago
|
||
Since nsXPIDLString has the behavior anyway, we should be able to reuse that.
https://tbpl.mozilla.org/?tree=Try&rev=ec49c8378fd2
Comment 4•14 years ago
|
||
SetDOMStringToNull exists.
| Assignee | ||
Comment 5•14 years ago
|
||
This is not about a method which sets a string to null, but having a null string, which can be easily passed as a parameter to methods, or used in ctor member initialization.
| Assignee | ||
Updated•14 years ago
|
Attachment #582680 -
Flags: review?(benjamin)
Comment 6•14 years ago
|
||
Comment on attachment 582680 [details] [diff] [review]
something like this
glandium, will this cause a static ctor to run, and do you think that's a profile? Otherwise I think this is fine.
Attachment #582680 -
Flags: review?(benjamin) → review?(mh+mozilla)
Comment 7•14 years ago
|
||
The patch as is won't cause a static ctor, but will cause a mutex being used each time NullString and NullCString are used.
| Assignee | ||
Comment 8•14 years ago
|
||
IRC:
glandium > smaug: mmm actually looking at the code gcc generates, it only acquires the lock if it the constant wasn't already initialized, so it's not as bad as i suggested
That doesn't sound bad to me, and EmptyString has the same behavior.
Comment 9•14 years ago
|
||
Comment on attachment 582680 [details] [diff] [review]
something like this
rs=me
Attachment #582680 -
Flags: review?(mh+mozilla) → review+
| Assignee | ||
Comment 10•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Target Milestone: --- → mozilla12
Updated•5 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•