2012-01-09 23:18:23 +00:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=40: */
|
2012-07-20 09:10:44 +00:00
|
|
|
/* Copyright 2012 Mozilla Foundation and Mozilla contributors
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2011-12-05 07:58:27 +00:00
|
|
|
|
2012-01-09 23:18:23 +00:00
|
|
|
#ifndef mozilla_dom_system_b2g_systemworkermanager_h__
|
|
|
|
#define mozilla_dom_system_b2g_systemworkermanager_h__
|
2011-12-05 07:58:27 +00:00
|
|
|
|
2012-01-09 23:18:23 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2013-01-24 06:42:07 +00:00
|
|
|
#include "nsISystemWorkerManager.h"
|
2012-01-09 23:18:23 +00:00
|
|
|
#include "nsIObserver.h"
|
2012-03-14 22:43:26 +00:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsDebug.h"
|
|
|
|
#include "nsDOMEventTargetHelper.h"
|
2013-09-23 17:25:00 +00:00
|
|
|
#include "nsString.h"
|
2012-03-14 22:43:26 +00:00
|
|
|
#include "nsTArray.h"
|
2012-01-09 23:18:23 +00:00
|
|
|
|
|
|
|
class nsIWorkerHolder;
|
|
|
|
|
2012-03-14 22:43:26 +00:00
|
|
|
namespace mozilla {
|
2013-02-01 12:28:22 +00:00
|
|
|
|
|
|
|
namespace ipc {
|
|
|
|
class RilConsumer;
|
|
|
|
class UnixSocketRawData;
|
2013-10-01 04:09:57 +00:00
|
|
|
class KeyStore;
|
2013-02-01 12:28:22 +00:00
|
|
|
}
|
|
|
|
|
2012-03-14 22:43:26 +00:00
|
|
|
namespace dom {
|
|
|
|
namespace gonk {
|
2012-01-09 23:18:23 +00:00
|
|
|
|
|
|
|
class SystemWorkerManager : public nsIObserver,
|
2013-01-24 06:42:07 +00:00
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsISystemWorkerManager
|
2012-01-09 23:18:23 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2013-01-24 06:42:07 +00:00
|
|
|
NS_DECL_NSISYSTEMWORKERMANAGER
|
2012-01-09 23:18:23 +00:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
static already_AddRefed<SystemWorkerManager>
|
|
|
|
FactoryCreate();
|
|
|
|
|
|
|
|
static nsIInterfaceRequestor*
|
|
|
|
GetInterfaceRequestor();
|
|
|
|
|
2013-02-04 13:26:43 +00:00
|
|
|
static bool SendRilRawData(unsigned long aClientId,
|
|
|
|
ipc::UnixSocketRawData* aRaw);
|
2013-02-01 12:28:22 +00:00
|
|
|
|
2012-01-09 23:18:23 +00:00
|
|
|
private:
|
|
|
|
SystemWorkerManager();
|
|
|
|
~SystemWorkerManager();
|
|
|
|
|
2012-08-30 14:46:04 +00:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2012-08-29 20:35:53 +00:00
|
|
|
nsresult InitNetd(JSContext *cx);
|
2012-08-30 14:46:04 +00:00
|
|
|
#endif
|
2012-01-09 23:18:23 +00:00
|
|
|
nsresult InitWifi(JSContext *cx);
|
2013-10-01 04:09:57 +00:00
|
|
|
nsresult InitKeyStore(JSContext *cx);
|
2012-07-18 03:41:54 +00:00
|
|
|
|
2012-08-30 14:46:04 +00:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2012-08-29 20:35:53 +00:00
|
|
|
nsCOMPtr<nsIWorkerHolder> mNetdWorker;
|
2012-08-30 14:46:04 +00:00
|
|
|
#endif
|
2012-01-09 23:18:23 +00:00
|
|
|
nsCOMPtr<nsIWorkerHolder> mWifiWorker;
|
|
|
|
|
2013-02-04 13:26:43 +00:00
|
|
|
nsTArray<nsRefPtr<ipc::RilConsumer> > mRilConsumers;
|
2013-10-01 04:09:57 +00:00
|
|
|
nsRefPtr<ipc::KeyStore> mKeyStore;
|
2013-02-01 12:28:22 +00:00
|
|
|
|
2012-01-09 23:18:23 +00:00
|
|
|
bool mShutdown;
|
2011-12-05 07:58:27 +00:00
|
|
|
};
|
2012-01-09 23:18:23 +00:00
|
|
|
|
2012-03-14 22:43:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-01-09 23:18:23 +00:00
|
|
|
|
|
|
|
#endif // mozilla_dom_system_b2g_systemworkermanager_h__
|