2015-01-07 02:19:59 -08:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
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
|
|
|
|
|
2015-07-17 03:10:01 -07:00
|
|
|
#include "nsAutoPtr.h"
|
2015-07-17 03:10:01 -07:00
|
|
|
#include "nsError.h"
|
2015-07-17 03:10:01 -07:00
|
|
|
#include "nsTArray.h"
|
2011-12-07 02:58:56 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
2015-07-17 03:10:01 -07:00
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
namespace workers {
|
|
|
|
|
|
|
|
class WorkerCrossThreadDispatcher;
|
|
|
|
|
|
|
|
} // namespace workers
|
|
|
|
} // namespace dom
|
|
|
|
|
2011-12-07 02:58:56 -08:00
|
|
|
namespace ipc {
|
|
|
|
|
2015-07-17 03:10:01 -07:00
|
|
|
class RilConsumer;
|
|
|
|
|
2015-07-17 03:10:01 -07:00
|
|
|
class RilWorker final
|
2011-12-07 02:58:56 -08:00
|
|
|
{
|
|
|
|
public:
|
2015-01-07 02:19:59 -08:00
|
|
|
static nsresult Register(
|
|
|
|
unsigned int aClientId,
|
|
|
|
mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher);
|
2015-07-15 09:53:28 -07:00
|
|
|
|
2015-07-17 03:10:01 -07:00
|
|
|
static void Shutdown();
|
2015-07-17 03:10:01 -07:00
|
|
|
|
|
|
|
private:
|
2015-07-17 03:10:01 -07:00
|
|
|
class RegisterConsumerTask;
|
|
|
|
class UnregisterConsumerTask;
|
|
|
|
|
2015-07-17 03:10:01 -07:00
|
|
|
RilWorker(mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher);
|
|
|
|
|
|
|
|
nsresult RegisterConsumer(unsigned int aClientId);
|
|
|
|
void UnregisterConsumer(unsigned int aClientId);
|
|
|
|
|
|
|
|
static nsTArray<nsAutoPtr<RilWorker>> sRilWorkers;
|
|
|
|
|
2015-10-17 22:24:48 -07:00
|
|
|
RefPtr<mozilla::dom::workers::WorkerCrossThreadDispatcher> mDispatcher;
|
2013-02-01 04:28:22 -08:00
|
|
|
};
|
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
|