dom/bluetooth/BluetoothSocketObserver.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 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     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
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_dom_bluetooth_BluetoothSocketObserver_h
     8 #define mozilla_dom_bluetooth_BluetoothSocketObserver_h
    10 #include "BluetoothCommon.h"
    11 #include "mozilla/ipc/UnixSocket.h"
    13 BEGIN_BLUETOOTH_NAMESPACE
    15 class BluetoothSocket;
    17 class BluetoothSocketObserver
    18 {
    19 public:
    20   virtual void ReceiveSocketData(
    21     BluetoothSocket* aSocket,
    22     nsAutoPtr<mozilla::ipc::UnixSocketRawData>& aMessage) = 0;
    24    /**
    25     * A callback function which would be called when a socket connection
    26     * is established successfully. To be more specific, this would be called
    27     * when socket state changes from CONNECTING/LISTENING to CONNECTED.
    28     */
    29   virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) = 0;
    31    /**
    32     * A callback function which would be called when BluetoothSocket::Connect()
    33     * fails.
    34     */
    35   virtual void OnSocketConnectError(BluetoothSocket* aSocket) = 0;
    37    /**
    38     * A callback function which would be called when a socket connection
    39     * is dropped. To be more specific, this would be called when socket state
    40     * changes from CONNECTED/LISTENING to DISCONNECTED.
    41     */
    42   virtual void OnSocketDisconnect(BluetoothSocket* aSocket) = 0;
    44 };
    46 END_BLUETOOTH_NAMESPACE
    48 #endif

mercurial