Bug 1383816 - Fixes several minor errors in Variant's IPC implementation. r=botond
authorJeff Hajewski <jeff.hajewski@gmail.com>
Sun, 03 Sep 2017 06:30:42 -0500
changeset 429321 0e9b01271d17bbc4fb5e31071fd18f3d38e7279c
parent 429320 bbed5063d5a1ead431993901a9cbdef9f86c4a53
child 429322 a61e73b332e19c17ad424254aa1b6de6411b7a89
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1383816
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1383816 - Fixes several minor errors in Variant's IPC implementation. r=botond * VariantWriter construction switched to use aggregate initialization * Call to AsVariant was inappropriately called via |paramType| when it should have been called via |mozilla| * |Next::Read| call in VariantReader specialization was missing the |result| argument MozReview-Commit-ID: Izany7iDX0k
ipc/glue/IPCMessageUtils.h
--- a/ipc/glue/IPCMessageUtils.h
+++ b/ipc/glue/IPCMessageUtils.h
@@ -917,17 +917,17 @@ struct ParamTraits<mozilla::Variant<Ts..
     void match(const T& t) {
       WriteParam(msg, t);
     }
   };
 
   static void Write(Message* msg, const paramType& param)
   {
     WriteParam(msg, param.tag);
-    param.match(VariantWriter(msg));
+    param.match(VariantWriter{msg});
   }
 
   // Because VariantReader is a nested struct, we need the dummy template
   // parameter to avoid making VariantReader<0> an explicit specialization,
   // which is not allowed for a nested class template
   template<size_t N, typename dummy = void>
   struct VariantReader
   {
@@ -940,22 +940,22 @@ struct ParamTraits<mozilla::Variant<Ts..
       // subtract one to look at N - 1, the first valid tag.  This means our
       // comparisons are off by 1.  If we get to N = 0 then we have failed to
       // find a match to the tag.
       if (tag == N - 1) {
         // Recall, even though the template parameter is N, we are
         // actually interested in the N - 1 tag.
         typename mozilla::detail::Nth<N - 1, Ts...>::Type val;
         if (ReadParam(msg, iter, &val)) {
-          *result = paramType::AsVariant(val);
+          *result = mozilla::AsVariant(val);
           return true;
         }
         return false;
       } else {
-        return Next::Read(msg, iter, tag);
+        return Next::Read(msg, iter, tag, result);
       }
     }
 
   }; // VariantReader<N>
 
   // Since we are conditioning on tag = N - 1 in the preceding specialization,
   // if we get to `VariantReader<0, dummy>` we have failed to find
   // a matching tag.