Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set sw=2 ts=8 et ft=cpp: */ |
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 |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | /* Copyright © 2013, Deutsche Telekom, Inc. */ |
michael@0 | 8 | |
michael@0 | 9 | #ifndef mozilla_ipc_Nfc_h |
michael@0 | 10 | #define mozilla_ipc_Nfc_h 1 |
michael@0 | 11 | |
michael@0 | 12 | #include <mozilla/dom/workers/Workers.h> |
michael@0 | 13 | #include <mozilla/ipc/UnixSocket.h> |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace ipc { |
michael@0 | 17 | |
michael@0 | 18 | class NfcConsumer : public mozilla::ipc::UnixSocketConsumer |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | virtual ~NfcConsumer() { } |
michael@0 | 22 | |
michael@0 | 23 | static nsresult Register(mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); |
michael@0 | 24 | static void Shutdown(); |
michael@0 | 25 | |
michael@0 | 26 | private: |
michael@0 | 27 | NfcConsumer(mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); |
michael@0 | 28 | |
michael@0 | 29 | virtual void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage); |
michael@0 | 30 | |
michael@0 | 31 | virtual void OnConnectSuccess(); |
michael@0 | 32 | virtual void OnConnectError(); |
michael@0 | 33 | virtual void OnDisconnect(); |
michael@0 | 34 | |
michael@0 | 35 | private: |
michael@0 | 36 | nsRefPtr<mozilla::dom::workers::WorkerCrossThreadDispatcher> mDispatcher; |
michael@0 | 37 | nsCString mAddress; |
michael@0 | 38 | bool mShutdown; |
michael@0 | 39 | }; |
michael@0 | 40 | |
michael@0 | 41 | } // namespace ipc |
michael@0 | 42 | } // namepsace mozilla |
michael@0 | 43 | |
michael@0 | 44 | #endif // mozilla_ipc_Nfc_h |