media/mtransport/transportlayerice.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 // Original author: ekr@rtfm.com
     9 // This is a wrapper around the nICEr ICE stack
    10 #ifndef transportlayerice_h__
    11 #define transportlayerice_h__
    13 #include <vector>
    15 #include "sigslot.h"
    17 #include "mozilla/RefPtr.h"
    18 #include "mozilla/Scoped.h"
    19 #include "nsCOMPtr.h"
    20 #include "nsIEventTarget.h"
    21 #include "nsITimer.h"
    23 #include "m_cpp_utils.h"
    25 #include "nricemediastream.h"
    26 #include "transportflow.h"
    27 #include "transportlayer.h"
    29 // An ICE transport layer -- corresponds to a single ICE
    30 namespace mozilla {
    32 class TransportLayerIce : public TransportLayer {
    33  public:
    34   TransportLayerIce(const std::string& name,
    35                     RefPtr<NrIceCtx> ctx,
    36                     RefPtr<NrIceMediaStream> stream,
    37                     int component);
    38   virtual ~TransportLayerIce();
    40   // Transport layer overrides.
    41   virtual TransportResult SendPacket(const unsigned char *data, size_t len);
    43   // Slots for ICE
    44   void IceCandidate(NrIceMediaStream *stream, const std::string&);
    45   void IceReady(NrIceMediaStream *stream);
    46   void IceFailed(NrIceMediaStream *stream);
    47   void IcePacketReceived(NrIceMediaStream *stream, int component,
    48                          const unsigned char *data, int len);
    50   TRANSPORT_LAYER_ID("ice")
    52  private:
    53   DISALLOW_COPY_ASSIGN(TransportLayerIce);
    55   const std::string name_;
    56   RefPtr<NrIceCtx> ctx_;
    57   RefPtr<NrIceMediaStream> stream_;
    58   int component_;
    59 };
    61 }  // close namespace
    62 #endif

mercurial