Commit Graph

1473 Commits

Author SHA1 Message Date
Simon Giesecke
9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke
e3c223da3e Bug 1648010 - Fix uses of NS_LITERAL_STRING with C string literals. r=geckoview-reviewers,agi,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80861
2020-07-01 08:34:12 +00:00
Simon Giesecke
cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Simon Giesecke
017f9a1fc0 Bug 1648010 - Add user-defined string literals. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81125
2020-06-29 17:02:35 +00:00
Mihai Alexandru Michis
3e115816f2 Backed out changeset d1416483de0d (bug 1648010) for causing bustages in nsTLiteralString.h
CLOSED TREE
2020-06-29 17:53:38 +03:00
Simon Giesecke
62fd821c3a Bug 1648010 - Add user-defined string literals. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81125
2020-06-29 14:26:44 +00:00
Simon Giesecke
7b417b5ef3 Bug 1648391 - Use rhs-first optimization from IsDependentOn in IsDependentOnWithLength. r=froydnj
Depends on D81054

Differential Revision: https://phabricator.services.mozilla.com/D81055
2020-06-25 11:53:48 +00:00
Simon Giesecke
bebf92b951 Bug 1648391 - Use logical or rather than binary or to allow for short-circuit evaluation. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81054
2020-06-25 11:49:50 +00:00
Simon Giesecke
9a81912985 Bug 1644163 - Avoid traversing a nsTSubstring tuple twice to determine its length and dependency on a buffer in Replace. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78695
2020-06-18 08:03:02 +00:00
Simon Giesecke
c2985d448f Bug 1644163 - Avoid traversing a nsTSubstring tuple twice to determine its length and dependency on a buffer in Assign. r=froydnj
This also extracts new private member functions AssignOwned and AssignNonDependent.

Furthermore, it fixes an inconsistency for the dependent case: Formerly,
this caused the substring tuple to be materialized into a linear string
infallibly, although the function was a fallible one. It only assigned the
resulting string fallibly, but this would never have failed, since the
allocation already happened before.

Differential Revision: https://phabricator.services.mozilla.com/D78694
2020-06-18 08:03:09 +00:00
Simon Giesecke
1a9edbd8d5 Bug 1644163 - Avoid traversing a nsTSubstring tuple twice to determine its length and dependency on a buffer in Append. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78693
2020-06-18 08:02:52 +00:00
Cosmin Sabou
3b4176468a Backed out 3 changesets (bug 1644163) for mochitest asan failures. CLOSED TREE
Backed out changeset 954c49edcc76 (bug 1644163)
Backed out changeset 8d78185301f1 (bug 1644163)
Backed out changeset 338bd5525594 (bug 1644163)
2020-06-18 13:20:43 +03:00
Simon Giesecke
c852bfeee1 Bug 1644163 - Avoid traversing a nsTSubstring tuple twice to determine its length and dependency on a buffer in Replace. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78695
2020-06-18 08:03:02 +00:00
Simon Giesecke
b556d0f13b Bug 1644163 - Avoid traversing a nsTSubstring tuple twice to determine its length and dependency on a buffer in Assign. r=froydnj
This also extracts new private member functions AssignOwned and AssignNonDependent.

Furthermore, it fixes an inconsistency for the dependent case: Formerly,
this caused the substring tuple to be materialized into a linear string
infallibly, although the function was a fallible one. It only assigned the
resulting string fallibly, but this would never have failed, since the
allocation already happened before.

Differential Revision: https://phabricator.services.mozilla.com/D78694
2020-06-18 08:03:09 +00:00
Simon Giesecke
cdcb021cc4 Bug 1644163 - Avoid traversing a nsTSubstring tuple twice to determine its length and dependency on a buffer in Append. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78693
2020-06-18 08:02:52 +00:00
Sylvestre Ledru
63be8d152d Bug 1519636 - Reformat recent changes to the Google coding style r=necko-reviewers,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D77580
2020-05-30 09:55:27 +00:00
Emilio Cobos Álvarez
70ab539dc0 Bug 1641245 - Fix silly windows build bustage.
MANUAL PUSH: bustage on a CLOSED TREE.
2020-05-27 21:05:25 +02:00
Emilio Cobos Álvarez
54fd961a29 Bug 1641245 - Make string comparators not virtual. r=froydnj,necko-reviewers,geckoview-reviewers,jgilbert,agi,valentin
There's no use case for stateful comparators, so they can be just plain
function pointers.

This is used in some hot places like CSS selector matching.

Differential Revision: https://phabricator.services.mozilla.com/D77084
2020-05-27 18:11:12 +00:00
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