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

309 Коммитов

Автор SHA1 Сообщение Дата
Xidorn Quan 3cead98957 Bug 1325351 part 3 - Make Maybe accept value from different Maybe type when the inner type is convertible. r=froydnj
MozReview-Commit-ID: 2kYTncYh1Or

--HG--
extra : rebase_source : 2d15fb3c252f1c0505d739d9540079ceb9296b39
2016-12-23 11:49:33 +11:00
Nick Fitzgerald a19333ea56 Bug 1324829 - Add the `mozilla::Result::andThen` method; r=froydnj 2016-12-21 13:05:56 -08:00
Nick Fitzgerald f40c749727 Bug 1324828 - Add the `mozilla::Result::map` method; r=froydnj 2016-12-21 13:05:56 -08:00
Nathan Froyd 2ebbd09068 Bug 1320752 - remove mozilla/Function.h; r=gerald
We have std::function available now, which is likely to be somewhat more
efficient.
2016-11-28 11:03:53 -05:00
Jan de Mooij 2975885bae Bug 1283562 - Add mozilla::Result<V, E> for fallible return values. r=jwalden 2016-11-21 12:52:03 +01:00
Ting-Yu Lin d60ec2b4d6 Bug 1315624 - Delete operator&& and operator|| for CastableTypedEnumResult. r=froydnj
Defining these two overloading functions destroys short-circuit evaluation.

MozReview-Commit-ID: Ac7zPtAGOiE

--HG--
extra : rebase_source : 4b3906b5162c1214b9814166f7d0d7de9cb0a7f9
2016-11-07 15:00:16 +08: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
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
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
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
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
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
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
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
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
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Nathan Froyd 583afa0965 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Steve Fink 2fac3971ef Bug 1212624 - Tests for LinkedList, r=Waldo
--HG--
extra : rebase_source : 39cb2bc90342da5d5fc1379f805b1dd701a108df
2015-10-07 12:36:00 -07:00
Steve Fink 833a3ce77b Backed out 5 changesets (bug 1212624) for breaking stuff.
Backed out changeset cf5ffa45a4a2
Backed out changeset 0d7a968d2d64 (bug 1212624)
Backed out changeset 379edefa8e47 (bug 1212624)
Backed out changeset f73fca35daad (bug 1212624)
Backed out changeset 4f499d30a0e0 (bug 1212624)
2015-10-14 16:49:12 -07:00
Steve Fink c860330eec Bug 1212624 - Tests for LinkedList, r=Waldo
--HG--
extra : rebase_source : f44eac4762baa6cc47e5ea370fe19ea35aaf9c88
2015-10-07 12:36:00 -07:00
James Cheng bf740b75f1 Bug 1212745 - Part 1 - Make mozilla::Function support pointer to member function. r=nfroyd 2015-10-11 19:53:00 +02:00
Jim Blandy cd209ab0b5 Bug 1206357: Add mfbt/FastBernoulliTrial.h, implementing efficient random sampling. r=waldo
--HG--
extra : rebase_source : 63de57cd3fb3317c752f58fb7a0a71f050f198a3
2015-10-08 13:05:31 -07:00
Wes Kocher 0eeafe1fa4 Merge inbound to central, a=merge 2015-09-24 16:46:34 -07:00
Jared Wein 71808b231d Bug 1205020 - Disable optimizations in TestTuple.cpp since it breaks the build on VS2013 Windows 10. r=froydnj
--HG--
extra : rebase_source : f209cc4dd8051562a4ef87313d0636f9dbee2132
2015-09-23 13:53:07 -04:00
Nathan Froyd 5761751aa3 Bug 1207245 - part 1 - move RefCounted<T> to its own file
Various bits depend on RefPtr.h to provide RefCounted<T> and RefPtr<T>.
It will be easier to manage an automatic conversion from RefPtr<T> to
nsRefPtr<T> if we split out the dependency on RefCounted<T> first.
2015-09-22 21:27:34 -04:00
Nathan Froyd d3552d7e39 Bug 1207245 - part 0 - fix why-did-we-allow-that tests in TestRefPtr.cpp
RefPtr.h's byref permits callees to see the incoming value of the
outparam; XPCOM's getter_AddRefs zeros outparams prior to the call, so
information doesn't leak through inadvertently.  Given this difference,
we need to eliminate tests that depended on this (arguably dangerous)
behavior.  The numerous assertion fixups are required because we're
removing construction and destruction of objects along the way.
2015-09-23 23:07:29 -04:00
Jim Blandy e1252e4e42 Bug 1206356: Add mfbt/Random.h, implementing the xorshift128+ random number generator. r=waldo
--HG--
extra : rebase_source : 3eb009156765b341e6a2dcee9f0287ce198c439f
2015-09-23 13:59:28 -07:00
Botond Ballo 78627e8b5d Bug 1198451 - Tests for mozilla::Function. r=froydnj
--HG--
extra : source : 11a2cd3e5c1e051c6bef843b45fe3701364e826a
2015-09-06 21:43:34 -04:00
Phil Ringnalda dba9d5afc5 Back out 835853a88b03 (bug 1206356) for at least Android/B2G bustage
CLOSED TREE
2015-09-22 18:21:32 -07:00
Jim Blandy 68cb70e9c4 Bug 1206356: Add mfbt/Random.h, implementing the xorshift128+ random number generator. r=waldo
--HG--
extra : rebase_source : 8694eae8a75a1b56be81826e3d9567d33a9fcdfe
2015-09-22 16:34:51 -07:00
Jeff Gilbert f9055a2c4d Bug 1193600 - Add Clamp and IsPowerOfTwo to MFBT. - r=waldo 2015-09-04 13:33:10 -07:00
Nicholas Nethercote f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Kan-Ru Chen 2c0adde7a0 Bug 1199068 - Soothe a unused variable warning in TestSplayTree.cpp. r=nfroyd 2015-08-28 11:24:47 +08:00
Nick Fitzgerald 26eaf483ae Bug 1186693 - Add exhaustive matching to mozilla::Variant; r=Waldo 2015-08-08 16:43:35 -07:00
Liang-Heng Chen 2d9863ad53 Bug 1185706 - support Tie() for mozilla::Pair. r=froydnj 2015-07-24 00:42:00 +02:00
Liang-Heng Chen 5a9d777bf3 Bug 1186315 - Fix TestTuple error and add it into testing list. r=nfroyd 2015-07-21 22:54:00 +02:00
Botond Ballo f1d4fcd69b Bug 1184385 - Add a Tie() utility function for tuples (the equivalent of std::tie()) to MFBT. r=froydnj
--HG--
extra : rebase_source : 5d6ce0668782e4f3339dbca0d15e2202b566c6b3
extra : source : 9f736422e7903a20560bb83d1832f85a28b89880
2015-07-18 03:48:39 -04:00
Nick Fitzgerald f3f20427ee Bug 1184235 - Add mozilla::Vector::emplaceBack; r=froydnj 2015-07-20 11:13:28 -07:00
Nick Fitzgerald bdd6b06c87 Bug 1184839 - Provide an overloaded == operator for mozilla::Variant; r=Waldo 2015-07-19 16:32:00 +02:00
Steve Fink fda6cabeb6 Bug 1180299 - Implement ScopeExit for running actions at the end of a scope, r=Waldo
--HG--
extra : commitid : JVZx97WUQxy
extra : rebase_source : 5cef069fd3071ad305a3e3f04e0addff577b1093
2015-07-03 14:20:55 -07:00
Xidorn Quan 5ebb867d28 Bug 1175485 part 4 - Add unit test for integer range. r=waldo
--HG--
extra : source : 2fb0dd6ca01c21b9282e0d7637ac09c2e8539a02
2015-07-02 13:31:07 +10:00
Nathan Froyd 974d8120f2 Bug 1161627 - part 2 - machine-convert TemporaryRef<T> to already_AddRefed<T>; r=ehsan
This conversion was done with the script:

  find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl' | \
    egrep -v 'cairo-win32-refptr.h|RefPtr.h|TestRefPtr.cpp' | \
    xargs sed -i -e 's/mozilla::TemporaryRef</already_AddRefed</g' \
                 -e 's/TemporaryRef</already_AddRefed</g'

Manual fixups were performed in the following instances:

- We handled mfbt/RefPtr.h manually so as to not convert TemporaryRef itself
  into already_AddRefed.

- The following files had explicit Move() calls added to make up for the lack
  of a copy constructor on already_AddRefed:

  dom/base/ImageEncoder.cpp
  dom/media/MediaTaskQueue.{h,cpp}
  dom/media/webaudio/PannerNode.cpp

- A redundant overload for MediaTaskQueue::Dispatch was deleted.

- A few manual fixups were required in mfbt/tests/TestRefPtr.cpp.

- Comments, using declarations, and forward declarations relating to
  TemporaryRef in dom/canvas/ and gfx/layers/ were changed to refer to
  already_AddRefed.
2015-06-17 10:00:52 -04:00
Nick Fitzgerald 474c4d36e3 Bug 1174906 - Add a mozilla::Variant<T1, T2, ...> template class; r=Waldo 2015-06-30 10:01:00 -07:00
Bobby Holley 868aa56b18 Bug 1168008 - Make IsConvertible handle void. r=gerald 2015-05-28 16:03:08 -07:00
Botond Ballo 2e2a504271 Bug 1119980 - Use 'snprintf' instead of 'sprintf' to avoid a warning on Lollipop-based builds. r=froydnj
--HG--
extra : source : 7468f9a3aa03520a29e138d4df431f0b5d90967c
2015-05-26 14:33:55 -04:00
Phil Ringnalda 49dd872168 Back out 3 changesets (bug 1119980) for emulator-l bustage
CLOSED TREE

Backed out changeset 12ce98475c6e (bug 1119980)
Backed out changeset bdb8d05f8870 (bug 1119980)
Backed out changeset a68a18840492 (bug 1119980)
2015-05-25 18:48:51 -07:00