Commit Graph

1356 Commits

Author SHA1 Message Date
Ryan VanderMeulen
0c7539ae17 Bug 1448472 - Remove a C5037 warning suppression xpcom/string/moz.build that is no longer needed. r=xidorn 2018-03-24 12:19:44 -04:00
L. David Baron
6570ba11eb Bug 1448138 - Rename string DataFlags::SHARED to REFCOUNTED to make it clearer to those reading the code. r=erahm
MozReview-Commit-ID: 1mJuwY5dQkj
2018-03-23 17:31:37 -07:00
Samuel Thibault
60e83973f3 Bug 1346535 - atk: Introduce U+FEFF characters to match AT-SPI offsets with DOM offsets. r=surkov, r=dbaron 2018-03-16 15:57:00 -04:00
Andrew McCreight
1e96623e9f Bug 1442295 - Add two missing includes in XPCOM. r=erahm
nsTArray.h needs mozalloc.h for moz_xmalloc

nsTStringRepr.h needs fallible.h for fallible

MozReview-Commit-ID: 9jz2pGPXMHk
2018-03-01 11:03:00 +02:00
Paul Bone
700c8d3a08 Bug 1440205 - Print the nsStringBuffer bad canary value in hex r=jonco 2018-02-22 15:32:42 +11:00
Jeff Walden
2d9c1567e9 Bug 1438750 - Remove mfbt/double-conversion.h, and change existing users to instead do #include "double-conversion/double-conversion.h" themselves. r=froydnj on a CLOSED TREE 2018-02-21 10:15:43 +02:00
Gurzau Raul
70475a4e45 Backed out changeset 66c1c1596bea (bug 1438750) for assertion failure at TestFloatingPoint.cpp on Windows platform 2018-02-21 08:29:50 +02:00
Jeff Walden
5f8f9b179a Bug 1438750 - Remove mfbt/double-conversion.h, and change existing users to instead do #include "double-conversion/double-conversion.h" themselves. r=froydnj 2018-02-15 21:02:53 -08:00
Nathan Froyd
fef98a6f6c Bug 1435916 - use a const array in nsTextFormatter::dosprintf; r=tromey
I don't know how this was not constant, but there you go.
2018-02-14 12:01:36 -05:00
Eric Rahm
28124ace61 Bug 1435924 - Part 2: Remove nsSubstring.h. r=dbaron 2018-02-05 14:51:18 -08:00
Eric Rahm
f4bb1d2f9a Bug 1435924 - Part 1: Switch from nsSubstring.h to nsAString.h. r=dbaron 2018-02-05 17:36:32 -08:00
Eric Rahm
dddcd641ba Bug 1434689 - Part 3: Annotate nsTSubstringTuple as MOZ_TEMPORARY_CLASS. r=froydnj
The documentation indicates nsTStringTuple is intended for internal use only
and is designed to be only be used as a temporary. This makes that fact
explicit by annotating the class for static analysis.
2018-01-31 15:45:04 -08:00
Eric Rahm
b0bae1f565 Bug 1434789 - Part 2: Remove nsSubstringTuple aliases. r=froydnj
This removes nsSubstringTuple.h and nsSubstringTuple.cpp in favor of
nsTSubstringTuple.
2018-01-31 16:45:34 -08:00
Noemi Erli
5318998849 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-01-19 12:15:59 +02:00
Anthony Ramine
45b78aa11c Bug 1431449 - Move nsTString::ToInteger* methods to nsTSubstring; r=bz
MozReview-Commit-ID: 8hCDfF8rLRC
2018-01-18 15:32:35 +01:00
Eric Rahm
2223997933 Bug 1431261 - Add nsTDependentString copy constructor. r=dbaron
This adds a copy constructor that uses Rebind to preserve the reference to
static data rather allocate a new shared buffer.
2018-01-18 14:16:19 -08:00
Makoto Kato
5e1b7a08d2 Bug 586838 - Add NEON versions of LossyConvertEncoding. r=erahm 2018-01-12 15:46:11 +09:00
Masatoshi Kimura
e0781ab0cf Bug 1426898 - Stop including Char16.h everywhere. r=Waldo
We had to force-include Char16.h to simulate char16_t on older MSVC versions.
But it is no longer the case. We should not rebuild the world whenever we
touch this file.

MozReview-Commit-ID: 1XY7tQD8LoK
2017-12-23 00:53:12 +09:00
Eric Rahm
165110812d Bug 1424120 - Part 9: Further cleanup of minor nits in ToInteger. r=njn
Final style cleanup:
  - Comment formatting
  - Move variable declarations to where they're used
  - Don't set NS_OK until we finish processing
  - Early exit for error conditions
2017-12-08 11:52:10 -08:00
Eric Rahm
27a70f75f5 Bug 1424120 - Part 8: clang-format ToInteger. r=njn 2017-12-08 11:43:15 -08:00
Eric Rahm
555a7332d9 Bug 1424120 - Part 7: Remove duplicated switch logic from ToInteger. r=njn 2017-12-08 11:17:55 -08:00
Eric Rahm
df26ab0076 Bug 1424120 - Part 6: Add early returns to ToInteger. r=njn
This reduces the indentation by removing the `if(cp)` and `if(done)` blocks
and just returning early. The `if(cp)` was unnecessary as `BeginReading` will
never return nullptr.
2017-12-08 10:15:53 -08:00
Eric Rahm
89bf1f49f2 Bug 1424120 - Part 5: Enforce support for only radix of 10 and 16. r=njn
In theory other radixes can be passed in but we don't actually handle them.
This asserts that the radix is supported and just switches over to using 10 and
16 directly.
2017-12-07 18:54:13 -08:00
Eric Rahm
6ae47d4034 Bug 1424120 - Part 4: Remove haveValue logic from ToInteger. r=njn
The `haveValue` logic is no longer necessary. If we don't have a value the
result will always be 0.
2017-12-07 18:44:03 -08:00
Eric Rahm
9b0dd1b7a0 Bug 1424120 - Part 3: Update error handling in ToInteger. r=njn 2017-12-07 17:51:26 -08:00
Eric Rahm
7e1b3b74f1 Bug 1424120 - Part 2: Remove kAutoDetect support from ToInteger. r=njn
kAutoDetect is never actually used in our codebase and makes ToInteger rather
convoluted. This removes the logic for it, the constant itself, and the
resulting dead code.
2017-12-07 15:40:15 -08:00
Eric Rahm
63d3b5ddd3 Bug 1424120 - Part 1: Combine logic for ToInteger impls. r=njn
Replaced the duplicated logic with a shared template implementation.
2017-12-07 15:18:44 -08:00
Eric Rahm
aa1c7019aa Bug 1423798 - Remove headers included for backwards compat in nsString.h. r=njn on a CLOSED TREE
Remove the headers included for "backwards compatibility" and just include them
where required.
2017-12-06 19:36:57 -08:00
Csoregi Natalia
1e8a0c5ae0 Backed out changeset e2beba7e6875 (bug 1423798) for failing Browser Chrome tests browser_temporary_permissions_expiry.js on Windows 7 debug. r=backout on a CLOSED TREE 2017-12-09 07:23:35 +02:00
Gurzau Raul
20f2689228 Merge mozilla-central to mozilla-inbound. r=merge a=merge CLOSED TREE 2017-12-09 00:57:59 +02:00
Eric Rahm
16586909f6 Bug 1423798 - Remove headers included for backwards compat in nsString.h. r=njn
Remove the headers included for "backwards compatibility" and just include them
where required.
2017-12-06 19:36:57 -08:00
Eric Rahm
b7d5ae7a89 Bug 1423781 - Remove nsVoidableString. r=njn 2017-12-06 17:33:23 -08:00
Eric Rahm
b80a434a68 Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.
2017-12-06 16:52:51 -08:00
Sylvestre Ledru
923049ccb3 Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 5orfnoude7h
2017-12-08 13:46:13 +01:00
Paul Bone
e6f4fe0467 Bug 1410276 - Add a canary field to nsStringBuffer r=bz
This version of the patch hopefully causes fewer performance regressions.
It might be good to apply this and catch some more assertions.
2017-11-09 15:17:35 +11:00
Sebastian Hengst
f0db8d092d Backout a3785ec9a48c / bug 1410276 on request from pbone - Add a canary field to nsStringBuffer. r=backout 2017-11-08 01:45:38 +02:00
Chris Peterson
cad9118fcb Bug 1412048 - Replace some NS_RUNTIMEABORT(var) calls with MOZ_CRASH_UNSAFE_PRINTF. r=froydnj data-review=francois
MOZ_CRASH_UNSAFE_PRINTF causes data collection because crash strings are annotated to crash-stats and are publicly visible. Firefox data stewards must do data review on usages of this macro. However, all the crash strings this patch collects with MOZ_CRASH_UNSAFE_PRINTF are already collected with NS_RUNTIMEABORT.

MozReview-Commit-ID: 5ujXa9MHH5Z
2017-10-26 00:49:00 -07:00
Andrew McCreight
f3a79a756e Bug 1412119 - Re-fix mode lines in xpcom. r=erahm 2017-10-26 14:39:00 -04:00
Paul Bone
37e0d1f533 Bug 1410276 - Add a canary field to nsStringBuffer. r=bz 2017-10-25 23:21:47 +11:00
Sylvestre Ledru
d9fb23feca Bug 1411034 - Remove the const to fix the -Wignored-qualifiers warning r=erahm
MozReview-Commit-ID: 8AvGwUQsdE8
2017-10-23 22:42:35 +02:00
Eric Rahm
bf49ee0a6a Bug 1403083 - Part 1: Properly disable string functions for invalid char types. r=froydnj
In order to properly disable template functions with `std::enable_if` we need
to use the resulting type. This only works if we use a dependent type in the
template params, hence the need to shadow the `T` param.

Proper usage is now of the form:

template<typename Q = T, typename EnableIfChar = CharOnlyT<Q>>
Foo();
2017-10-03 12:44:44 -07:00
Ryan VanderMeulen
018945acfe Merge inbound to m-c. a=merge 2017-10-18 21:01:34 -04:00
Andrew McCreight
3ef51d0bbf Bug 1403959, part 3 - Manually fix some xpcom/ eslint failures and enable it. r=froydnj
Renames are because another location also defined that
variable. Unused definitions are eliminated.

The .eslintrc.js file makes eslint expect XPCShell global variables.

MozReview-Commit-ID: Fafm5o45bme
2017-09-28 16:12:52 -07:00
Andrew McCreight
0d48d346a2 Bug 1403959, part 2 - Automatically generated eslint fixes. r=froydnj
These were generated with |./mach eslint --fix xpcom| with the
.eslintignore and xpcom/tests/unit/.eslintrc.js changes from the next
patch.

MozReview-Commit-ID: 8pKkICSK3JQ
2017-09-28 15:49:04 -07:00
Nika Layzell
c6aa5a36db Bug 1377351 - Part 5: Add a workaround for gcc 4.9 compiler bug, r=froydnj
MozReview-Commit-ID: CHywpZ4fvXf
2017-10-18 13:00:22 -04:00
Nika Layzell
2304941371 Bug 1377351 - Part 3: Expose nsA[C]String::Assign(nsA[C]String&&) overload as take_from to rust, r=froydnj
MozReview-Commit-ID: 4YNPi3iRo78
2017-10-18 13:00:15 -04:00
Nika Layzell
14617ca3b9 Bug 1377351 - Part 2: Add move overloads to nsA[C]String assignment and constructors, r=froydnj
MozReview-Commit-ID: 81U51pgshZI
2017-10-18 13:00:12 -04:00
Nika Layzell
c1e598b75c Bug 1377351 - Part 1: Add move overload to nsA[C]String::Assign, r=froydnj
MozReview-Commit-ID: 5bloaYcvpgr
2017-10-18 13:00:09 -04:00
Nicholas Nethercote
ef5c8c5260 Bug 1403506 - Remove nsTFixedString<T>. r=erahm.
(patch is actually r=erahm,mystor)

nsTFixedString<T> is only used as a base class for nsTAutoStringN<T, N>, so
this patch merges the former into the latter, cutting some code and simplifying
the string class hierarchy.

Because the "Fixed" name is now gone, the patch also renames
StringDataFlags::FIXED as INLINE and ClassDataFlags::FIXED as INLINE.

The patch also removes nsFixed[C]String and ns_auto_[c]string! from Rust code
because nsAutoString can't be implemented directly in Rust due to its move
semantics. There were only two uses of ns_auto_string! outside of tests so this
seems like a minor loss.

MozReview-Commit-ID: 8ntximghiut
2017-09-27 20:19:33 +10:00
Tom Ritter
cdd7039c6a Bug 1402328 Use a Dummy template parameter to avoid fully specializing structs inside of template classes r=froydnj
Full specialization is allowed in MSVC, but not in gcc.

MozReview-Commit-ID: 9QI6YWc5Rvr
2017-09-22 10:26:26 -05:00