Commit Graph

1455 Commits

Author SHA1 Message Date
Nicklas Boman
4f2fa0cfa7 Bug 1515419 - fixing ToNewCString (and ToNewUnicode as well) xpcom/string/nsReadableUtils.cpp r=froydnj,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D17411
2020-05-17 06:58:48 +00:00
Simon Giesecke
74b75d282b Bug 1634023 - Add deduction guides for Span. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73040
2020-04-29 16:04:56 +00:00
Simon Giesecke
191a830575 Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
Tooru Fujisawa
8c0843c04c Bug 1432749 - Part 1: Add DefaultHasher for nsTString. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D67836

--HG--
extra : moz-landing-system : lando
2020-04-14 06:00:05 +00:00
Narcis Beleuzu
1783003a34 Backed out 3 changesets (bug 1624150, bug 1432749) for wpt failures at open-features-tokenization-top-left.html. CLOSED TREE
Backed out changeset ff061c8d9da9 (bug 1624150)
Backed out changeset 7e96d4acf317 (bug 1432749)
Backed out changeset a95f77732a1c (bug 1432749)
2020-04-13 22:51:48 +03:00
Tooru Fujisawa
c2e8f7014c Bug 1432749 - Part 1: Add DefaultHasher for nsTString. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D67836

--HG--
extra : moz-landing-system : lando
2020-04-13 15:42:06 +00:00
Cameron McCormack
396dcd374d Bug 1629342 - Print string stats on process exit only if there is a leak. r=erahm,mccr8
I don't think anyone particularly cares about these stats.

Differential Revision: https://phabricator.services.mozilla.com/D70638

--HG--
extra : moz-landing-system : lando
2020-04-12 17:23:12 +00:00
Eric Rahm
905929aa4e Bug 1627131 - Part 3: Move nsTString<T>::Contains implementation. r=xpcom-reviewers,sg
`kNotFound` isn't actually defined in `nsTStringRepr.h`.

Differential Revision: https://phabricator.services.mozilla.com/D69468

--HG--
extra : moz-landing-system : lando
2020-04-08 10:46:25 +00:00
Eric Rahm
2c52ea2bb0 Bug 1627131 - Part 2: Move template function instantiations to definitions. r=xpcom-reviewers,sg
The instantiations of the externed templates need to be in the same translation unit as the definitions. Currently they work due to building in unified mode.

Differential Revision: https://phabricator.services.mozilla.com/D69467

--HG--
extra : moz-landing-system : lando
2020-04-08 10:46:02 +00:00
Eric Rahm
034401e7e4 Bug 1627131 - Part 1: Add missing includes to xpcom/string. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D69466

--HG--
extra : moz-landing-system : lando
2020-04-03 21:08:13 +00:00
André Bargull
14ca007916 Bug 1625138 - Part 41: Remove no longer needed includes for mozilla/TypeTraits. r=froydnj
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.

Differential Revision: https://phabricator.services.mozilla.com/D68561

--HG--
extra : moz-landing-system : lando
2020-03-28 16:00:09 +00:00
André Bargull
f70fd1c1bd Bug 1625138 - Part 37: Replace mozilla::IsSame with std::is_same in xpcom/. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68556

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:21 +00:00
André Bargull
9ad58ea608 Bug 1625138 - Part 13: Replace mozilla::IsUnsigned with std::is_unsigned. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68368

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:14 +00:00
Chris Peterson
b1f54173e8 Bug 1624776 - Replace MOZ_MUST_USE with [[nodiscard]] in xpcom. r=xpcom-reviewers,KrisWright
Also move MOZ_MUST_USE before function declarations' specifiers and return type. While clang and gcc's __attribute__((warn_unused_result)) can appear before, between, or after function specifiers and return types, the [[nodiscard]] attribute must precede the function specifiers.

Also remove MOZ_MUST_USE from nsIMemoryReporter's function pointer typedefs. [[nodiscard]] is an attribute of a function's declaration, not the function's type, and thus can't be applied to function pointers or lambdas.

Differential Revision: https://phabricator.services.mozilla.com/D68138

--HG--
extra : moz-landing-system : lando
2020-03-27 17:21:48 +00:00
Andrew McCreight
4babb2b5ab Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 17:39:15 +00:00
Ciure Andrei
00dd87f6f4 Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG--
extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
2020-02-27 07:05:19 +02:00
Andrew McCreight
b197e1f783 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 04:43:48 +00:00
Masatoshi Kimura
a37fc61f17 Bug 1617415 - Remove nsTSubstring<T>::ReplaceASCII. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63775

--HG--
extra : moz-landing-system : lando
2020-02-23 01:01:33 +00:00
Kershaw Chang
26da4db75f Bug 1603504 - Use release_acquire in nsStringBuffer::IsReadonly for TSan build r=froydnj
TSan reports a benign race when accessing a string between main thread and IPDL background thread. The reason is that we use `memory_order_relaxed` to check the reference count of StringBuffer. To avoid the benign race, this patch uses `memory_order_acquire` to perform acquire memory synchronization only for TSan build.

Differential Revision: https://phabricator.services.mozilla.com/D57620

--HG--
extra : moz-landing-system : lando
2020-02-14 14:06:43 +00:00
Simon Giesecke
30984f7bab Bug 1613985 - Use default for equivalent-to-default constructors/destructors in xpcom. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62543

--HG--
extra : moz-landing-system : lando
2020-02-12 11:13:33 +00:00
Michael Forney
02f3747734 Bug 1611536 - Add stdint.h include for fixed-width integer types r=Ehsan
musl libc does not define these types through the other headers
included by this file, which causes errors when building RemoteUtils.cpp
(which indirectly includes nsCharTraits.h):

	error: unknown type name 'int32_t'

Differential Revision: https://phabricator.services.mozilla.com/D61040

--HG--
extra : moz-landing-system : lando
2020-01-25 00:40:51 +00:00
Andi-Bogdan Postelnicu
597ca4ed51 Bug 1605659 - fix some errors discovered with -Wdeprecated-copy. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D59296

--HG--
extra : moz-landing-system : lando
2020-01-09 16:42:15 +00:00
Emilio Cobos Álvarez
278b36aafb Bug 1607816 - Replace mozilla::{Max, Min}Value with std::numeric_limits. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59153

--HG--
extra : moz-landing-system : lando
2020-01-08 16:30:40 +00:00
Emilio Cobos Álvarez
400567dcde Bug 1606958 - Use FakeString for UTF8String. r=bzbarsky,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D58683

--HG--
extra : moz-landing-system : lando
2020-01-07 21:37:12 +00:00
Emilio Cobos Álvarez
c098b80e6c Bug 1607547 - nsTAutoString::mInlineCapacity should be const. r=froydnj
It shouldn't ever change.

Differential Revision: https://phabricator.services.mozilla.com/D59001

--HG--
extra : moz-landing-system : lando
2020-01-07 20:10:17 +00:00
Chris Peterson
406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Simon Giesecke
fec8c64d2a Bug 1602452 - Make member functions of nsTStringRepr defined in header constexpr. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D56369

--HG--
extra : moz-landing-system : lando
2019-12-10 08:40:48 +00:00
Mihai Alexandru Michis
f995448544 Backed out changeset bf906a905a26 (bug 1602452) for causing bustages in gtest/TestStrings.cpp
CLOSED TREE
2019-12-09 17:41:25 +02:00
Simon Giesecke
50cf008dd3 Bug 1602452 - Make member functions of nsTStringRepr defined in header constexpr. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D56369

--HG--
extra : moz-landing-system : lando
2019-12-09 15:01:22 +00:00
Paul Bone
93489fe04d Bug 1596198 - Remove the canary from nsStringBuffer r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D52961

--HG--
extra : moz-landing-system : lando
2019-11-14 22:50:31 +00:00
Mirko Brodesser
9997183bdd Bug 1591417: part 3) Add nsTStringRepr<T>::EqualsLatin1. r=froydnj
Needed to compare with `nsTextFragment::Get1b()` which returns latin1-encoded
characters. Used in a subsequent review.

Differential Revision: https://phabricator.services.mozilla.com/D52343

--HG--
extra : moz-landing-system : lando
2019-11-12 15:20:25 +00:00
Emilio Cobos Álvarez
fe10c35ad2 Bug 1591191 - Move compare and EqualsIgnoreAsciiCase to nsTStringRepr. r=erahm
Zibi is working on replacing some string based APIs with some things that return
substrings, so we could use this.

Alternatively he'd have to do something like:

  Compare(myCSubstring, nsDependentCSubstring(aTag, strlen(aTag)))

or something of that sort, which looks a bit uglier.

Differential Revision: https://phabricator.services.mozilla.com/D50523

--HG--
extra : moz-landing-system : lando
2019-11-04 11:27:05 +00:00
Dorel Luca
d8264bf6a7 Backed out changeset eb3d67637a9b (bug 1591191) for build bustage on build/src/xpcom/string/precompiled_templates.cpp. CLOSED TREE 2019-11-04 12:40:57 +02:00
Emilio Cobos Álvarez
7d302de427 Bug 1591191 - Move compare and EqualsIgnoreAsciiCase to nsTStringRepr. r=erahm
Zibi is working on replacing some string based APIs with some things that return
substrings, so we could use this.

Alternatively he'd have to do something like:

  Compare(myCSubstring, nsDependentCSubstring(aTag, strlen(aTag)))

or something of that sort, which looks a bit uglier.

Differential Revision: https://phabricator.services.mozilla.com/D50523

--HG--
extra : moz-landing-system : lando
2019-10-29 20:09:00 +00:00
Boris Zbarsky
40d45356a8 Bug 1591481 part 1. Make NormalizeUSVString fallible. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D50691

--HG--
extra : moz-landing-system : lando
2019-10-29 00:24:10 +00:00
Alex Henrie
599d6a6962 Bug 1589786 - Handle surrogate pairs in nsFind. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D49822

--HG--
extra : moz-landing-system : lando
2019-10-25 01:15:07 +00:00
Mihai Alexandru Michis
a5cac4d597 Backed out changeset 0063a5b2f5b3 (bug 1589786) for causing bustages in TestDLLBlocklist.obj and sandboxBroker.i_o CLOSED TREE 2019-10-24 19:41:56 +03:00
Alex Henrie
26a3356957 Bug 1589786 - Handle surrogate pairs in nsFind. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D49822

--HG--
extra : moz-landing-system : lando
2019-10-24 13:38:32 +00:00
Boris Zbarsky
17b508795a Bug 1589285 part 2. Add Span<const char> overloads of some XPCOM string methods. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D49532

--HG--
extra : moz-landing-system : lando
2019-10-17 22:09:46 +00:00
Henri Sivonen
c193518677 Bug 1490601 part 2 - Move C++ entry points to encoding_c_mem to mfbt/. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D43957

--HG--
extra : moz-landing-system : lando
2019-09-18 08:26:34 +00:00
Hiroyuki Ikezoe
2eec537348 Bug 1573648 - Introduce ToDoubleAllowTrailingChars and ToFloatAllowTrailingChars. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D42239

--HG--
extra : moz-landing-system : lando
2019-08-16 22:38:01 +00:00
Nathan Froyd
f21661fdf8 Bug 1571759 - add nsTArray::EmplaceBack; r=erahm
Much preferred to `AppendElement(T(...))`.

Differential Revision: https://phabricator.services.mozilla.com/D42024

--HG--
extra : moz-landing-system : lando
2019-08-16 00:18:57 +00:00
Henri Sivonen
c562792b2e Bug 1490593 - Move FFI for encoding_rs::mem to a vendored crate. r=froydnj
Also remove most C++-side optimizations for avoiding calls to Rust
for short strings now that we have LTO between C++ and Rust. Since
LTO still leaves the overhead of one function call layer, inlined
function call avoidance optimization is left in place in the
IsUTF8 and in the 8-bit IsASCII cases for which perfherder flags
the difference as significant for the length 15.

Differential Revision: https://phabricator.services.mozilla.com/D40999

--HG--
extra : moz-landing-system : lando
2019-08-14 07:53:34 +00:00
Henri Sivonen
a07d039783 Bug 1543693 - Add missing nsReadableUtils wrappers for conversions between UTF-8 and Latin1 XPCOM string. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D27234

--HG--
extra : moz-landing-system : lando
2019-04-12 17:49:11 +00:00
Cameron McCormack
ad0b101ef6 Bug 1543582 - Only include quotes around XPCOM strings in MOZ_DBG, not operator<<. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D27031

--HG--
extra : moz-landing-system : lando
2019-04-11 23:44:57 +00:00
Sylvestre Ledru
ef0bfc3822 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D24168

--HG--
extra : moz-landing-system : lando
2019-03-31 15:12:55 +00:00
Cameron McCormack
eedb6aebd4 Bug 1538081 - Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald
Depends on D25023

Differential Revision: https://phabricator.services.mozilla.com/D25024

--HG--
extra : moz-landing-system : lando
2019-03-30 04:26:26 +00:00
Ciure Andrei
615006146b Backed out 4 changesets (bug 1538081) for causing BaseElf.cpp bustages CLOSED TREE
Backed out changeset ced61a86c74c (bug 1538081)
Backed out changeset d6d331abbf0e (bug 1538081)
Backed out changeset 26df801e44db (bug 1538081)
Backed out changeset 113ac188a69e (bug 1538081)
2019-03-30 03:02:15 +02:00
Cameron McCormack
91e3ec9952 Bug 1538081 - Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald
Depends on D25023

Differential Revision: https://phabricator.services.mozilla.com/D25024

--HG--
extra : moz-landing-system : lando
2019-03-30 00:21:24 +00:00
Nathan Froyd
dc25b5a9dc Bug 1539605 - add fast paths for integer formatting on nsTSubstring; r=erahm
This way we don't have to go through a bunch of printf nonsense, and we
ought to be able to arrive at optimized routines that take advantage of
constant radices, etc.

Differential Revision: https://phabricator.services.mozilla.com/D25141

--HG--
extra : moz-landing-system : lando
2019-03-29 19:38:53 +00:00