Граф коммитов

240 Коммитов

Автор SHA1 Сообщение Дата
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
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
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 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
Igor 175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor a57972337d Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Daniel Holbert 489e357178 Bug 1291423: Explicitly qualify the destructor call that we invoke in Maybe::reset. r=Waldo
MozReview-Commit-ID: 6vQouBSxnsZ
2016-08-02 21:19:08 -07:00
Chris Peterson 9fc9590608 Bug 1289990 - Remove VS2013 workaround for TestTuple.cpp crash. r=froydnj
--HG--
extra : rebase_source : c5138bb0ea6a77b04030074ecebd85ba0808afa3
2016-07-27 23:13:08 -07:00
Chris Peterson b0efbe0ef8 Bug 1288603 - Remove NumericLimits.h because all platforms have numeric_limits<char16_t>. r=froydnj 2016-07-22 22:05:45 -07:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Terrence Cole 1fe18b25cf Bug 1232686 - Use decltype to infer Variant::match return type; r=fitzgen
--HG--
extra : rebase_source : 38f280cc3014b2285a79e377f1fa8edf4c5f4661
2015-12-15 07:45:22 -08:00
Seth Fowler a2712d4b0e Bug 1255632 - Make Maybe::map and Maybe::apply support lambdas. r=waldo,njn 2016-06-22 16:32:40 -07:00
Carsten "Tomcat" Book c46c20b362 Backed out changeset 7b03f23fdde5 (bug 1255632) for bustage on a CLOSED TREE 2016-06-22 08:48:25 +02:00
Seth Fowler 358b410aaa Bug 1255632 - Make Maybe::map and Maybe::apply support lambdas. r=waldo,njn 2016-06-21 22:15:27 -07:00
Andi-Bogdan Postelnicu c735dfa442 Bug 1278201 - prevent writing |mRefCnt| after it's freed. r=Ms2ger
MozReview-Commit-ID: G7fZzrGWHmW

--HG--
extra : rebase_source : 6f311948a8d2222358aec860f2c6d6223862e814
2016-06-06 17:23:10 +03:00
Nicholas Nethercote b3d842431f Bug 1272203 (part 1) - Add mozilla::NotNull to MFBT. r=froydnj.
This patch implements mozilla::NotNull, which is similar but not identicial to
gsl::not_null.

The current draft(?) implementation of gsl::not_null is at
https://github.com/Microsoft/GSL/blob/master/include/gsl.h.

The main difference is that not_null allows implicit conversion from T to
not_null<T>. In contrast, NotNull only allows explicit conversion from T to
NotNull<T> via WrapNotNull().

The rationale for this is that when converting from a less-constrained type to
a more constrained type, implicit conversion is undesirable. For example, if I
changed a function f from this:

  f(int* aPtr);

to this:

  f(gsl::not_null<int*> aPtr);

no call sites would have to be modified. But if I changed it to this:

  f(mozilla::NotNull<int*> aPtr);

call sites *would* need to be modified. This is a good thing! It forces the
author to audit the call sites for non-nullness, and encourages them to
back-propagate NotNull throughout the code.

The other difference between not_null and NotNull is that not_null disables
pointer arithmetic, which means it cannot be used with array pointers. I have
not implemented this restriction for NotNull because it seems arbitrary and
unnecessary.
2016-05-12 14:21:16 +10:00
Chris Peterson 11ef78ae89 Bug 1275016 - Rename Endian.h to EndianUtils.h to avoid #include confusion with Android's endian.h stdlib header. r=froydnj
--HG--
rename : mfbt/Endian.h => mfbt/EndianUtils.h
2016-05-22 13:31:11 -07:00
Bill McCloskey 308608ab39 Bug 1262671 - Introduce MFBT BufferList class (r=froydnj) 2016-05-27 09:57:40 -07:00
Chris Peterson 353ee65255 Bug 1272513 - Part 1: Suppress -Wshadow warnings-as-errors in some directories. r=glandium 2016-05-11 00:00:01 -07:00
Nicholas Nethercote 2511b2c327 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX

--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
2016-04-27 14:16:50 +10:00
Jon Coppeard b0359cb30b Bug 1266404 - Allow construction of an EnumSet<T> using an initializer list r=Waldo 2016-04-28 14:25:05 +01:00
Jon Coppeard 7dd2771dd7 Bug 1266402 - Add iteration to EnumSet<T> so that it can be used in range-based for loops r=Waldo 2016-04-28 14:25:05 +01:00
Jon Coppeard 99cbfbd0dc Bug 1259021 - Add Vector::extractRawBuffer method that doesn't copy the buffer r=Waldo 2016-04-25 13:41:25 +01:00
Chris Peterson 1999c10d91 Bug 1266294 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in mfbt. r=froydnj 2016-04-17 17:08:10 -07:00
Carsten "Tomcat" Book 558930f4e9 Backed out changeset e673dbc9848f (bug 1232686) for breaking VS2013 Builds 2016-04-16 10:57:53 +02:00
Terrence Cole 2177cca5cd Bug 1232686 - Use decltype to infer Variant::match return type; r=fitzgen 2015-12-15 07:45:22 -08:00
Benoit Girard 52f227c58b Bug 1253678 - Rename mozilla::Function to mozilla::function. r=froydnj
MozReview-Commit-ID: 60RPmEsYDN2

--HG--
extra : rebase_source : 9d0bebc7362af2778d123425c56ac20553d9303b
2016-03-11 16:49:13 -05:00
Ehsan Akhgari 30ce323e87 Bug 1255857 - Allow mozilla::UniquePtr's deleter template argument to customize the pointer type; r=froydnj 2016-03-11 15:35:43 -05:00
Nick Fitzgerald 3508cf5f6a Bug 1254565 - Allow passing matchers as rvalues to Variant::match. r=froydnj
--HG--
extra : rebase_source : 9863e7cde9ff918af22de94ca7ec29988c154bbd
2016-03-10 13:35:00 -05:00
Nathan Froyd d75c1bad6a Bug 1170045 - part 1 - add bulk pop support to SegmentedVector; r=erahm
Writing PopLastN in this way is probably a bit of a micro-optimization,
but at least it comes with tests and some comments for verifying the
goodness of the code.
2016-03-04 12:02:24 -05:00
Nathan Froyd 10eb1a5af3 Bug 1170045 - part 0 - modify TestSegmentedVectors to use explicitly-updated counts; r=erahm
The scheme in TestSegmentedVectors to use manually-annotated points and
magic numbers corresponding to those annotations works OK for small
numbers of operations.  But for testing bulk push and pop, we're going
to be doing many more operations, so let's move to recording explicitly
in code the operations we expect to see, and checking those instead.
2016-03-04 12:00:33 -05:00
Ehsan Akhgari 9f38f2d1e0 Bug 1250196 - Part 2: Rename UniquePtr::getDeleter() to get_deleter() in order to make it compatible with std::unique_ptr; r=froydnj 2016-02-22 15:51:59 -05:00
Nick Fitzgerald 6f93fd8916 Bug 1247412 - Add a `reverse` method to `mozilla::Vector`; r=Waldo 2016-02-11 08:33:00 +01:00
Ehsan Akhgari 0afa44b210 Bug 1232765 - Remove the workaround added in bug 1022050 2016-02-07 14:50:50 -05:00
Thomas Zimmermann ad6d42d817 Bug 1194721: Add |Saturate| template for saturation arithmetics, r=nfroyd
|Saturate<T>| implements saturation arithmetics for arbitrary basic
types. Operations on its value won't over- or underflow the type's
range.
2016-02-04 12:35:12 +01:00
Carsten "Tomcat" Book 4ff72292de Backed out changeset 8d6c228ef008 (bug 1194721) on developers request 2016-02-03 16:25:00 +01:00
Thomas Zimmermann 3d9f64bb3e Bug 1194721: Add |Saturate| template for saturation arithmetics, r=nfroyd
|Saturate<T>| implements saturation arithmetics for arbitrary basic
types. Operations on its value won't over- or underflow the type's
range.
2016-02-03 15:16:00 +01:00
Xidorn Quan 9668b6f572 Bug 1241901 part 3 - Add IsMemberPointer and IsScalar type traits. r=froydnj
--HG--
extra : source : 02269acc78bfde8d3171bf6023a5dda4cac9df3c
2016-01-30 10:33:41 +11:00
Jeff Muizelaar b29099ae6d Bug 1228641. Add a polyfill of std::initializer_list. r=froydnj 2016-01-06 22:06:35 -05:00
Jan de Mooij 36e21ef4d9 Bug 1231224 part 10 - Make various Vector calls check for OOM. r=terrence
--HG--
extra : rebase_source : fae86eb928fc510c3d5c7a895675cf218fc15b3a
2016-01-06 21:06:25 +01:00
Botond Ballo 1a83097cba Bug 1221680 - Avoid hard errors when testing convertibility using the IsConvertible type trait. r=froydnj
--HG--
extra : source : ea11bb67c3510671a501724d17d9872c3455891d
2015-11-06 17:47:36 -05:00
Bill McCloskey 47b5adaa34 Bug 1221368 - Change MakeTuple to decay the types of its arguments (r=froydnj) 2015-11-09 10:21:11 -08:00
Jeff Walden fe5445d030 Bug 1220693 - Make mozilla::Atomic<enum class> work even on compilers that don't have <atomic>. r=froydnj
--HG--
extra : rebase_source : 2eb167a1b86a1a93527761a9541ea30ad213785a
2015-11-03 13:03:26 -08:00
Birunthan Mohanathas 9985829ecc Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00