dom/bluetooth/ipc/BluetoothChild.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
michael@0 2 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef mozilla_dom_bluetooth_ipc_bluetoothchild_h__
michael@0 8 #define mozilla_dom_bluetooth_ipc_bluetoothchild_h__
michael@0 9
michael@0 10 #include "mozilla/dom/bluetooth/BluetoothCommon.h"
michael@0 11
michael@0 12 #include "mozilla/dom/bluetooth/BluetoothTypes.h"
michael@0 13 #include "mozilla/dom/bluetooth/PBluetoothChild.h"
michael@0 14 #include "mozilla/dom/bluetooth/PBluetoothRequestChild.h"
michael@0 15
michael@0 16 #include "mozilla/Attributes.h"
michael@0 17 #include "nsAutoPtr.h"
michael@0 18
michael@0 19 namespace mozilla {
michael@0 20 namespace dom {
michael@0 21 namespace bluetooth {
michael@0 22
michael@0 23 class BluetoothServiceChildProcess;
michael@0 24
michael@0 25 } // namespace bluetooth
michael@0 26 } // namespace dom
michael@0 27 } // namespace mozilla
michael@0 28
michael@0 29 BEGIN_BLUETOOTH_NAMESPACE
michael@0 30
michael@0 31 class BluetoothReplyRunnable;
michael@0 32
michael@0 33 /*******************************************************************************
michael@0 34 * BluetoothChild
michael@0 35 ******************************************************************************/
michael@0 36
michael@0 37 class BluetoothChild : public PBluetoothChild
michael@0 38 {
michael@0 39 friend class mozilla::dom::bluetooth::BluetoothServiceChildProcess;
michael@0 40
michael@0 41 enum ShutdownState
michael@0 42 {
michael@0 43 Running = 0,
michael@0 44 SentStopNotifying,
michael@0 45 ReceivedNotificationsStopped,
michael@0 46 Dead
michael@0 47 };
michael@0 48
michael@0 49 ShutdownState mShutdownState;
michael@0 50
michael@0 51 protected:
michael@0 52 BluetoothChild(BluetoothServiceChildProcess* aBluetoothService);
michael@0 53 virtual ~BluetoothChild();
michael@0 54
michael@0 55 void
michael@0 56 BeginShutdown();
michael@0 57
michael@0 58 virtual void
michael@0 59 ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
michael@0 60
michael@0 61 virtual bool
michael@0 62 RecvNotify(const BluetoothSignal& aSignal);
michael@0 63
michael@0 64 virtual bool
michael@0 65 RecvEnabled(const bool& aEnabled) MOZ_OVERRIDE;
michael@0 66
michael@0 67 virtual bool
michael@0 68 RecvBeginShutdown() MOZ_OVERRIDE;
michael@0 69
michael@0 70 virtual bool
michael@0 71 RecvNotificationsStopped() MOZ_OVERRIDE;
michael@0 72
michael@0 73 virtual PBluetoothRequestChild*
michael@0 74 AllocPBluetoothRequestChild(const Request& aRequest) MOZ_OVERRIDE;
michael@0 75
michael@0 76 virtual bool
michael@0 77 DeallocPBluetoothRequestChild(PBluetoothRequestChild* aActor) MOZ_OVERRIDE;
michael@0 78 };
michael@0 79
michael@0 80 /*******************************************************************************
michael@0 81 * BluetoothRequestChild
michael@0 82 ******************************************************************************/
michael@0 83
michael@0 84 class BluetoothRequestChild : public PBluetoothRequestChild
michael@0 85 {
michael@0 86 friend class mozilla::dom::bluetooth::BluetoothChild;
michael@0 87
michael@0 88 nsRefPtr<BluetoothReplyRunnable> mReplyRunnable;
michael@0 89
michael@0 90 public:
michael@0 91 BluetoothRequestChild(BluetoothReplyRunnable* aReplyRunnable);
michael@0 92
michael@0 93 protected:
michael@0 94 virtual ~BluetoothRequestChild();
michael@0 95
michael@0 96 virtual void
michael@0 97 ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
michael@0 98
michael@0 99 virtual bool
michael@0 100 Recv__delete__(const BluetoothReply& aReply) MOZ_OVERRIDE;
michael@0 101 };
michael@0 102
michael@0 103 END_BLUETOOTH_NAMESPACE
michael@0 104
michael@0 105 #endif // mozilla_dom_bluetooth_ipc_bluetoothchild_h__

mercurial