Commit Graph

1093 Commits

Author SHA1 Message Date
Gerald Squelart
06c4e95cd0 Bug 1316206 - Make RefPtr(decltype(nullptr)) MOZ_IMPLICIT - r=froydnj
Making this constructor non-explicit will permit automatic conversions from
'nullptr' into RefPtr types, which I think are not dangerous.

The one spot that this affects is in 'UserDataType nsBaseHashtable::Get(KeyType)',
which does a 'return 0;' into the UserDataType, which could be a bool, an int, a
RefPtr or other. I'm changing that into a C++11 "value initialization", which
falls back to "zero initialization" for PODs: 'return UserDataType{};'.

Also fixed the comment to clarify not-found return values, as Get(KeyType) was
not only used for pointers anyway.

MozReview-Commit-ID: F41VlvTNOZU

--HG--
extra : rebase_source : 71d5dacac75ca188e5c55d45f48a5fca76d953c6
2016-11-08 15:12:33 +11:00
Gerald Squelart
f71d8c43ff Bug 1316206 - RefPtr construction/assignment from nullptr - r=froydnj
Added constructor and operator= from a nullptr, bypassing the incoming pointer
check.
Note that the constructor is 'explicit', because one particular use in
nsBaseHashtable is doing a 'return 0' into a templated type that is a RefPtr in
many cases. Making this new constructor explicit removes it from consideration
in this case.
As it's not strictly necessary to have it MOZ_IMPLICIT (but could still be
nice), I will tackle that in the patch after next.

Also changed all zeroes into nullptr when relevant in RefPtr.h (other system-
wide affected files will be updated in following patch.)

MozReview-Commit-ID: Ds4CEv9hZWI

--HG--
extra : rebase_source : f4ec156b13ea3bdcf32b1a33d76ff9771ad6d1dc
2016-11-10 07:58:10 +11:00
Emanuel Hoogeveen
515f250ac5 Bug 1309573 - Part 1: Define the crash reason in MFBT to let everything use it. r=froydnj
--HG--
extra : rebase_source : 12eda091c0453e067a13a80261b814128d27c45c
2016-11-06 22:57:00 -05:00
Nathan Froyd
d585884d50 Bug 1315352 - follow-up - placate the static analysis to re-open this CLOSED TREE; r=me 2016-11-07 19:26:11 -05:00
Nathan Froyd
9238cab1b1 Bug 1315352 - enable Range<T> -> Range<const T> conversion; r=Waldo
Since |T*| converts into |const T*|, if we want to rewrite code such as:

  void DoSomething(const T*, size_t);

  void DoSomethingElse(T* x, size_t len)
  {
    ...
    DoSomething(x, len);
  }

to use ranges:

  void DoSomething(Range<const T>);

  void DoSomethingElse(Range<T> x)
  {
    ...
    DoSomething(x);
  }

we need to ensure this conversion works.  gsl::span<T> already provides
something like this as well.
2016-11-07 19:30:34 -04:00
Nathan Froyd
c8d4517ee9 Bug 1315004 - rename Range::start to Range::begin to match C++ conventions; r=botond
Among other things, this change means that you can use ranged-for syntax
with Range, which is more fitting and pleasant than the alternative.
2016-11-05 21:13:38 -04:00
Bill McCloskey
4c8471eb15 Bug 1310547 - Add removeAndGetNext/Previous methods to LinkedList (r=froydnj) 2016-10-30 22:04:01 -07:00
Bill McCloskey
c0d229e060 Bug 1310547 - Allow LinkedList to hold RefPtr elements (r=froydnj) 2016-10-30 22:04:00 -07:00
Sebastian Hengst
bff4ebdec8 Backed out changeset c41a71b1c24e (bug 1310547) for failing splitText-normalize.html in reftests on Windows 7 VM debug. r=backout on a CLOSED TREE 2016-10-29 13:48:56 +02:00
Sebastian Hengst
b063eb49cb Backed out changeset 721e3171510d (bug 1310547) 2016-10-29 13:45:28 +02:00
Sebastian Hengst
d8f4badbd6 Backed out changeset b15d4e773bdd (bug 1310547) 2016-10-29 13:44:48 +02:00
Bill McCloskey
5074379555 Bug 1310547 - LinkedList compiler fixes 2016-10-28 21:27:17 -07:00
Bill McCloskey
5a6e5a85cf Bug 1310547 - Add removeAndGetNext/Previous methods to LinkedList (r=froydnj) 2016-10-28 20:11:03 -07:00
Bill McCloskey
89ca6e236f Bug 1310547 - Allow LinkedList to hold RefPtr elements (r=froydnj) 2016-10-28 20:10:37 -07:00
Tooru Fujisawa
57db30aa76 Bug 1311088 - Part 1: Add mozilla::SpecificNaNBits and JS::detail::CanonicalizedNaNBits. r=jwalden 2016-10-29 01:47:30 +09:00
Tooru Fujisawa
0e8929a00e Bug 1301864 - Remove constexpr from mozilla::IsNaN. r=jwalden 2016-10-29 01:47:30 +09:00
Johannes Schulte
b7ccc22970 Bug 1312620 - Add IsPositiveZero function to mfbt and use it to replace MPhi by MNaNToZero iff c is +0.0. r=nbp, r=waldo
--HG--
extra : rebase_source : 7adefc3370c081e17b5e0b090a008e0de0507bb9
2016-10-26 17:47:42 +02:00
James Cheng
3bf8f58291 Bug 1309466 - Add Test for the init value by constructor. r=froydnj
MozReview-Commit-ID: 9BguTY6dlRD

--HG--
extra : rebase_source : 8aef83263e8a406f6a4bb54f7cac6368cb75d904
2016-10-19 18:12:11 +08:00
James Cheng
6178d3ca29 Bug 1309466 - Enable Array and EnumeratedArray to be brace-initialized with initial contents. r=froydnj
MozReview-Commit-ID: 9sD9Rg4qsy1

--HG--
extra : rebase_source : bef928bca14e6d1a0a207359acfa56ecd93d605b
2016-10-12 15:08:47 +08:00
Tom Tromey
f36057ea28 Bug 553032 - use MOZ_FORMAT_PRINTF, not explicit attribute; r=froydnj
MozReview-Commit-ID: FgGin8L5oTp

--HG--
extra : rebase_source : 67f6d7ed8fc56745c66bd339013d1e9b753ec780
2016-10-12 10:03:53 -06:00
Tom Tromey
06530c20e7 Bug 553032 - document MOZ_FORMAT_PRINTF; r=froydnj
MozReview-Commit-ID: 4qX1nltLBxf

--HG--
extra : rebase_source : 5d82dbe8108fc5d9926cc0586a78dc753251f896
2016-10-13 13:08:39 -06:00
Tom Tromey
4fa10fe6d8 Bug 553032 - move MOZ_FORMAT_PRINTF to mfbt; r=froydnj
MozReview-Commit-ID: 2aC4ZUOsGPK

--HG--
extra : rebase_source : ec936e8447624653980d9168587223694a9e10c7
2016-10-11 12:42:58 -06:00
Ting-Yu Lin
89db11bf5e Bug 1311277 Part 4 - Convert NodeKind to be an enum class. r=froydnj
MozReview-Commit-ID: 2APdWxa8rZ6

--HG--
extra : rebase_source : f4fa846c6bd063afd2d1868169b676ec12f1f19a
2016-10-20 17:01:11 +08:00
Ting-Yu Lin
96fcd3875f Bug 1311277 Part 2 - Add move assignment for LinkedListElement and LinkedList. r=froydnj
MozReview-Commit-ID: 7NjbxamX87U

--HG--
extra : rebase_source : 578c72ee7eff740f7e7dcfd95f38f3ca8d1045a8
2016-10-19 13:30:51 +08:00
Ting-Yu Lin
dcc36e9067 Bug 1311277 Part 1 - Convert |other| argument to Mozilla coding style. r=froydnj
MozReview-Commit-ID: JcEloAe5dlA

--HG--
extra : rebase_source : 8bc712551d1a0b8f4c1aec1dafc9e4fb2c5861e0
2016-10-19 13:24:23 +08:00
Nathan Froyd
d1108c1e52 Bug 1311068 - remove InitializerList.h; r=botond
We needed this polyfill for <initializer_list> when some of our C++
standard libraries did not support said header.  They all do now, so the
polyfill is redundant.
2016-10-19 00:33:14 -04:00
Tooru Fujisawa
19d7f7bb03 Bug 1290337 - Part 22: Add moz_non_param annotation. r=ehsan,jwalden 2016-09-11 18:23:11 +09:00
Jeff Walden
de8974994d Bug 1299284 - Remove js::IsPowerOfTwo in favor of mozilla::IsPowerOfTwo. r=sfink
--HG--
extra : rebase_source : c9d695c25c9e53d7b86d9718611718af9fea8598
2016-07-21 00:36:38 -07:00
Sebastian Hengst
cdcc9e20da Bug 1304829 - rename RELEASE_BUILD to RELEASE_OR_BETA: main part. r=ted,Mossop
MozReview-Commit-ID: 1lCt0xTMV5O
2016-10-08 11:14:49 +02:00
Kan-Ru Chen
3e934c8f5c Bug 1305791 - Clear result.mSegments if MoveFallible failed. r=billm
MozReview-Commit-ID: 8UaGt1OEfhh

--HG--
extra : rebase_source : c084812d2e4d8633d049638dcd55b0b97db2c603
2016-09-30 17:37:44 +08:00
Andi-Bogdan Postelnicu
8240adec88 Bug 1230311 - add annotation to enforce that if a method is overridden also base method is called. r=nfroyd
MozReview-Commit-ID: AQ3Kx2qidU0
2016-10-04 17:00:17 +03:00
Terrence Cole
76b800594e Backed out changeset d85334f696eb (bug 1285057) for implicitly depending on clang 3.8.
--HG--
extra : rebase_source : 472f9411c9d528d63d523c99f4842a1216bdd560
2016-09-23 15:59:55 -07:00
Terrence Cole
b605dece0c Bug 1285057 - Blacklist UBSan detection of the GC's generic interfaces; r=sfink
--HG--
extra : rebase_source : f5367a8685ec462edb7e30e5ed3d274b4a9bcd0f
2016-07-07 08:59:36 -07:00
Xidorn Quan
7d4ca9c88b Bug 1303302 - Add IsDestructible trait in TypeTraits and use it for refcounted type static check. r=froydnj
MozReview-Commit-ID: G3YFhrJngq0

--HG--
extra : rebase_source : da0aa325eb7772c1a156440ed46be9d0d429c91e
2016-09-16 17:23:55 +10:00
Tom Schuster
6fcfa1f00e Bug 1302233 - Introduce VsprintfLiteral to mfbt. r=froydnj 2016-09-14 20:48:45 +02:00
Mats Palmgren
28d8553d1d Bug 1299379 - Add MOZ_CONCAT for preprocessor token pasting. r=waldo 2016-09-11 15:49:50 +02:00
Wes Kocher
5cbc382303 Merge inbound to m-c a=merge 2016-09-07 17:54:24 -07:00
Michael Layzell
36e08437d0 Bug 1018486 - Part 8: Various other changes, r=smaug
MozReview-Commit-ID: B0dsomkWgEk
2016-09-07 10:50:45 -04:00
Jeremy Chen
722ad026a3 Bug 1297306 - part4:rename IsEnumFittingWithin with EnumTypeFitsWithin and move it to mfbt/EnumTypeTraits.h. r=froydnj
With this change, we could share this EnumTypeTraits between files easily.

MozReview-Commit-ID: 9Q2augati7l

--HG--
extra : rebase_source : b7d9fc95d9d7722ba3eb99ec9798a64ebdbeb484
2016-09-07 10:20:16 +08:00
Kan-Ru Chen
99748028a6 Bug 1051567 - Make sure we resend file descriptors for the first chunk of a message. r=billm
Check if the buffers iterator was never consumed. This is a regression
introduced when converting ipc to use BufferList in bug 1262671.

MozReview-Commit-ID: LWAoVlI5CKJ

--HG--
extra : rebase_source : c4f16f4f90f56153c10cf1d9113c4c55748595f0
2016-08-30 18:26:59 +08:00
Andi-Bogdan Postelnicu
5a1fd6c4d4 Bug 525063 - add attribute to mark functions that initialize member variables for their parent class, in order to be scanned by clang-plugin static analysis. r=froydnj
MozReview-Commit-ID: 5yTnTUVLpSC
2016-08-30 10:07:03 +03:00
Michelangelo De Simone
0b2d2c0e55 Bug 1120059 - Remove unnecessary MOZ_EXPLICIT_CONVERSION macros. r=jwalden
MozReview-Commit-ID: 7CX1VnBRDpk

--HG--
extra : rebase_source : 36be7e6c91d2767c5a610a2806f89efa69ff1c74
2016-07-13 15:07:52 -07:00
Honza Bambas
e4eacf065d Bug 956338 - Add checks to WeakPtr/nsWeakReference and related classes to assert single-thread usage. r=nfroyd
--HG--
extra : rebase_source : 140fa149eb94f027e9319a44be0bbee34648222a
2016-08-01 13:16:16 +02:00
Ryan VanderMeulen
1c0c6ec5d4 Merge m-c to inbound. a=merge 2016-08-29 12:56:19 -04:00
Kan-Ru Chen
c49f09db99 Bug 1297981 - Delete BufferList::FlattenBytes and Pickle::FlattenBytes. r=billm
MozReview-Commit-ID: G3a4DN4Lovi

--HG--
extra : rebase_source : 17818efb7578117b708636d06e6a2f5d14532c94
2016-08-25 17:15:38 +08:00
Jeff Walden
34e7d5b132 Bug 1296760 - Allow Some(nullptr) and Some(Derived*) to convert to Maybe<Base*>. r=froydnj
--HG--
extra : rebase_source : 478e825f476a671e07a94f483b88cbc2d4ae8d13
2016-08-24 11:12:48 -07:00
Kan-Ru Chen
b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Kan-Ru Chen
506dfe6ea3 Bug 1264642 - Part 4. Use BufferList to replace raw buffers in StructuredClone. r=baku r=billm r=jorendorff
In JS StructuredClone BufferList<SystemAllocPolicy> is typedef'd to
JSStructuredCloneData and use everywhere in gecko that stores structured
clone data.

This patch changed some raw pointers to UniquePtr<JSStructuredCloneData>
and some to stack allocated JSStructuredCloneData for better life time
management. Some parameters or methods are deleted because of changing
to the new data structure.

MessagePortMessage now has the exactly same structure with
ClonedMessageData. Maybe in the future they can be consolidated.

MozReview-Commit-ID: 1IY9p5eKLgv
2016-08-23 00:40:46 +08:00
Kan-Ru Chen
3dcef6a932 Bug 1264642 - Part 3. Add BufferList::MoveFallible. r=billm
It works like a move constructor but it's fallible. It can also move
data to different but compatible AllocPolicy.

MozReview-Commit-ID: LAbPWCwnrr6
2016-08-23 00:40:46 +08:00
Kan-Ru Chen
6f3e6b1234 Bug 1264642 - Part 2. Add BufferList::Extract and Pickle::ExtractBuffers. r=billm
These methods allow us to move some buffers out of a pickle with minimum
copying. It's useful when the IPC deserialized type uses BufferList to
store data and we want to take the buffers from IPC directly.

Borrowing is not suitable to use for IPC to hand out data because we
often want to store the data somewhere for processing after IPC has
released the underlying buffers.

MozReview-Commit-ID: F1K2ZMkACqq
2016-08-23 00:40:45 +08:00