dom/media/gmp/GMPUtils.h
author Mike Hommey <mh+mozilla@glandium.org>
Thu, 26 Mar 2015 12:07:17 +0900
changeset 258314 fc1e894eec2fbd34b745cd94f505080427d24705
parent 250203 e6af00cdcfe78d00a7684bc7a2b3ac515fe05eea
child 259044 6e95db92c8d46bc7e9d855c49ac92828f47c17b0
child 265832 3f5b3cfd2071a8c169863f058647d6d757cd5ff9
child 269821 32eb2077d4bad9b087e54e9152ce86606eae80ae
permissions -rw-r--r--
Bug 1147207 - Add a ComposedFinder class that acts like a FileFinder proxy over multiple FileFinders. r=gps, a=sledru

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 GMPUtils_h_
#define GMPUtils_h_

#include "mozilla/UniquePtr.h"

namespace mozilla {

template<typename T>
struct DestroyPolicy
{
  void operator()(T* aGMPObject) const {
    aGMPObject->Destroy();
  }
};

// Ideally, this would be a template alias, but GCC 4.6 doesn't support them.  See bug 1124021.
template<typename T>
struct GMPUnique {
  typedef mozilla::UniquePtr<T, DestroyPolicy<T>> Ptr;
};

} // namespace mozilla

#endif