|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set sw=2 ts=8 et ft=cpp: */ |
|
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/. */ |
|
6 |
|
7 /* Copyright © 2013, Deutsche Telekom, Inc. */ |
|
8 |
|
9 #ifndef mozilla_ipc_Nfc_h |
|
10 #define mozilla_ipc_Nfc_h 1 |
|
11 |
|
12 #include <mozilla/dom/workers/Workers.h> |
|
13 #include <mozilla/ipc/UnixSocket.h> |
|
14 |
|
15 namespace mozilla { |
|
16 namespace ipc { |
|
17 |
|
18 class NfcConsumer : public mozilla::ipc::UnixSocketConsumer |
|
19 { |
|
20 public: |
|
21 virtual ~NfcConsumer() { } |
|
22 |
|
23 static nsresult Register(mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); |
|
24 static void Shutdown(); |
|
25 |
|
26 private: |
|
27 NfcConsumer(mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); |
|
28 |
|
29 virtual void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage); |
|
30 |
|
31 virtual void OnConnectSuccess(); |
|
32 virtual void OnConnectError(); |
|
33 virtual void OnDisconnect(); |
|
34 |
|
35 private: |
|
36 nsRefPtr<mozilla::dom::workers::WorkerCrossThreadDispatcher> mDispatcher; |
|
37 nsCString mAddress; |
|
38 bool mShutdown; |
|
39 }; |
|
40 |
|
41 } // namespace ipc |
|
42 } // namepsace mozilla |
|
43 |
|
44 #endif // mozilla_ipc_Nfc_h |