media/webrtc/signaling/include/SharedPtr.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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