media/webrtc/signaling/include/SharedPtr.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #pragma once
     7 #include <vector>
     8 #include "base/linked_ptr.h"
     9 #include "nsAutoPtr.h"
    11 #ifndef DECLARE_PTR
    12 #define DECLARE_PTR(className)\
    13     class className;\
    14     typedef linked_ptr<className> className##Ptr;
    15 #endif
    18 #ifndef DECLARE_PTR_VECTOR
    19 #define DECLARE_PTR_VECTOR(className)\
    20     DECLARE_PTR(className)\
    21     typedef std::vector<className##Ptr> className##Vtr;\
    22     typedef linked_ptr<className##Vtr> className##Vtr##Ptr;
    23 #endif
    26 #ifndef NULL_PTR
    27 #define NULL_PTR(className) linked_ptr<className>()
    28 #endif
    30 // NSPR Variations of the above, to help with migration
    31 // from linked_ptr to nsRefPtr
    32 #ifndef DECLARE_NS_PTR
    33 #define DECLARE_NS_PTR(className)\
    34     class className;\
    35     typedef nsRefPtr<className> className##Ptr;
    36 #endif
    39 #ifndef DECLARE_NS_PTR_VECTOR
    40 #define DECLARE_NS_PTR_VECTOR(className)\
    41     DECLARE_NS_PTR(className)\
    42     typedef std::vector<className##Ptr> className##Vtr;\
    43     typedef linked_ptr<className##Vtr> className##Vtr##Ptr;
    44 #endif

mercurial