2011-12-07 02:58:56 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=8 et ft=cpp: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-12-07 02:58:56 -08:00
|
|
|
|
|
|
|
#ifndef mozilla_ipc_Ril_h
|
|
|
|
#define mozilla_ipc_Ril_h 1
|
|
|
|
|
2013-02-01 04:28:22 -08:00
|
|
|
#include <mozilla/dom/workers/Workers.h>
|
|
|
|
#include <mozilla/ipc/UnixSocket.h>
|
2011-12-07 02:58:56 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
|
2013-02-01 04:28:22 -08:00
|
|
|
class RilConsumer : public mozilla::ipc::UnixSocketConsumer
|
2011-12-07 02:58:56 -08:00
|
|
|
{
|
|
|
|
public:
|
2013-02-04 05:26:43 -08:00
|
|
|
RilConsumer(unsigned long aClientId,
|
|
|
|
mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher);
|
2013-02-01 04:28:22 -08:00
|
|
|
virtual ~RilConsumer() { }
|
2011-12-07 02:58:56 -08:00
|
|
|
|
2013-02-01 04:28:22 -08:00
|
|
|
void Shutdown();
|
2011-12-07 02:58:56 -08:00
|
|
|
|
2013-02-01 04:28:22 -08:00
|
|
|
private:
|
|
|
|
virtual void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage);
|
2011-12-07 02:58:56 -08:00
|
|
|
|
2013-02-01 04:28:22 -08:00
|
|
|
virtual void OnConnectSuccess();
|
|
|
|
virtual void OnConnectError();
|
|
|
|
virtual void OnDisconnect();
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsRefPtr<mozilla::dom::workers::WorkerCrossThreadDispatcher> mDispatcher;
|
2013-02-04 05:26:43 -08:00
|
|
|
unsigned long mClientId;
|
|
|
|
nsCString mAddress;
|
2013-02-01 04:28:22 -08:00
|
|
|
bool mShutdown;
|
|
|
|
};
|
2011-12-07 02:58:56 -08:00
|
|
|
|
|
|
|
} // namespace ipc
|
2013-02-01 04:28:22 -08:00
|
|
|
} // namespace mozilla
|
2011-12-07 02:58:56 -08:00
|
|
|
|
|
|
|
#endif // mozilla_ipc_Ril_h
|