media/webrtc/signaling/include/SharedPtr.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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