diff -r 000000000000 -r 6474c204b198 media/webrtc/signaling/include/SharedPtr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media/webrtc/signaling/include/SharedPtr.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,44 @@ +/* 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/. */ + +#pragma once + +#include +#include "base/linked_ptr.h" +#include "nsAutoPtr.h" + +#ifndef DECLARE_PTR +#define DECLARE_PTR(className)\ + class className;\ + typedef linked_ptr className##Ptr; +#endif + + +#ifndef DECLARE_PTR_VECTOR +#define DECLARE_PTR_VECTOR(className)\ + DECLARE_PTR(className)\ + typedef std::vector className##Vtr;\ + typedef linked_ptr className##Vtr##Ptr; +#endif + + +#ifndef NULL_PTR +#define NULL_PTR(className) linked_ptr() +#endif + +// NSPR Variations of the above, to help with migration +// from linked_ptr to nsRefPtr +#ifndef DECLARE_NS_PTR +#define DECLARE_NS_PTR(className)\ + class className;\ + typedef nsRefPtr className##Ptr; +#endif + + +#ifndef DECLARE_NS_PTR_VECTOR +#define DECLARE_NS_PTR_VECTOR(className)\ + DECLARE_NS_PTR(className)\ + typedef std::vector className##Vtr;\ + typedef linked_ptr className##Vtr##Ptr; +#endif