author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Mon, 22 Dec 2014 22:12:16 -0800
changeset 221118 086a55e48cc3d1f8f9cd2259dc4871d7f07bf90c
parent 185108 5021d1337fa9bb5cca83ae0800c6ca1902167d2b
child 236371 0c030f97a04f4e34c138b878c4352423f5e920f9
permissions -rw-r--r--
Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/365250b33a9d Author: EragonJ (E.J.) <eragonj@eragonj.me> Desc: Merge pull request #26943 from EragonJ/bug-1112031 Bug 1112031 - Internet Sharing Settings is not scrollable if HotSpot det... ======== https://hg.mozilla.org/integration/gaia-central/rev/549af64ed2eb Author: EragonJ <eragonj@eragonj.me> Desc: Bug 1112031 - Internet Sharing Settings is not scrollable if HotSpot details panel closes with keyboard open

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_Vector_h
#define js_Vector_h

#include "mozilla/Vector.h"

/* Silence dire "bugs in previous versions of MSVC have been fixed" warnings */
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4345)

namespace js {

class TempAllocPolicy;

// If we had C++11 template aliases, we could just use this:
//   template <typename T,
//             size_t MinInlineCapacity = 0,
//             class AllocPolicy = TempAllocPolicy>
//   using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;
// ...and get rid of all the CRTP madness in mozilla::Vector(Base).  But we
// can't because compiler support's not up to snuff.  (Template aliases are in
// gcc 4.7 and clang 3.0 and are expected to be in MSVC 2013.)  Instead, have a
// completely separate class inheriting from mozilla::Vector, and throw CRTP at
// the problem til things work.
// This workaround presents a couple issues.  First, because js::Vector is a
// distinct type from mozilla::Vector, overload resolution, method calls, etc.
// are affected.  *Hopefully* this won't be too bad in practice.  (A bunch of
// places had to be fixed when mozilla::Vector was introduced, but it wasn't a
// crazy number.)  Second, mozilla::Vector's interface has to be made subclass-
// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one
// should use.  :-)  Third, we have to redefine the constructors and the non-
// inherited operators.  Blech.  Happily there aren't too many of these, so it
// isn't the end of the world.

template <typename T,
          size_t MinInlineCapacity = 0,
          class AllocPolicy = TempAllocPolicy>
class Vector
  : public mozilla::VectorBase<T,
                               Vector<T, MinInlineCapacity, AllocPolicy> >
    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;

    explicit Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}
    Vector(Vector &&vec) : Base(mozilla::Move(vec)) {}
    Vector &operator=(Vector &&vec) {
        return Base::operator=(mozilla::Move(vec));

} // namespace js

#endif /* js_Vector_h */