michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Original author: ekr@rtfm.com michael@0: michael@0: #ifndef transportlayerlog_h__ michael@0: #define transportlayerlog_h__ michael@0: michael@0: #include "m_cpp_utils.h" michael@0: #include "transportflow.h" michael@0: #include "transportlayer.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class TransportLayerLogging : public TransportLayer { michael@0: public: michael@0: TransportLayerLogging() {} michael@0: michael@0: // Overrides for TransportLayer michael@0: virtual TransportResult SendPacket(const unsigned char *data, size_t len); michael@0: michael@0: // Signals (forwarded to upper layer) michael@0: void StateChange(TransportLayer *layer, State state); michael@0: void PacketReceived(TransportLayer* layer, const unsigned char *data, michael@0: size_t len); michael@0: michael@0: TRANSPORT_LAYER_ID("log") michael@0: michael@0: protected: michael@0: virtual void WasInserted(); michael@0: michael@0: private: michael@0: DISALLOW_COPY_ASSIGN(TransportLayerLogging); michael@0: }; michael@0: michael@0: michael@0: } // close namespace michael@0: #endif