media/mtransport/transportlayerlog.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 #ifndef transportlayerlog_h__
    10 #define transportlayerlog_h__
    12 #include "m_cpp_utils.h"
    13 #include "transportflow.h"
    14 #include "transportlayer.h"
    16 namespace mozilla {
    18 class TransportLayerLogging : public TransportLayer {
    19 public:
    20   TransportLayerLogging() {}
    22   // Overrides for TransportLayer
    23   virtual TransportResult SendPacket(const unsigned char *data, size_t len);
    25   // Signals (forwarded to upper layer)
    26   void StateChange(TransportLayer *layer, State state);
    27   void PacketReceived(TransportLayer* layer, const unsigned char *data,
    28                       size_t len);
    30   TRANSPORT_LAYER_ID("log")
    32 protected:
    33   virtual void WasInserted();
    35 private:
    36   DISALLOW_COPY_ASSIGN(TransportLayerLogging);
    37 };
    40 }  // close namespace
    41 #endif

mercurial