2012-01-09 15:18:23 -08: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 02:10:44 -07: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-04 23:58:27 -08:00
|
|
|
|
2012-01-09 15:18:23 -08:00
|
|
|
#ifndef mozilla_dom_system_b2g_systemworkermanager_h__
|
|
|
|
#define mozilla_dom_system_b2g_systemworkermanager_h__
|
2011-12-04 23:58:27 -08:00
|
|
|
|
2012-01-09 15:18:23 -08:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2013-01-23 22:42:07 -08:00
|
|
|
#include "nsISystemWorkerManager.h"
|
2012-01-09 15:18:23 -08:00
|
|
|
#include "nsIObserver.h"
|
2012-03-14 15:43:26 -07:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsDebug.h"
|
|
|
|
#include "nsDOMEventTargetHelper.h"
|
|
|
|
#include "nsStringGlue.h"
|
|
|
|
#include "nsTArray.h"
|
2012-01-09 15:18:23 -08:00
|
|
|
|
|
|
|
class nsIWorkerHolder;
|
|
|
|
|
2012-03-14 15:43:26 -07:00
|
|
|
namespace mozilla {
|
2013-02-01 04:28:22 -08:00
|
|
|
|
|
|
|
namespace ipc {
|
|
|
|
class RilConsumer;
|
|
|
|
class UnixSocketRawData;
|
|
|
|
}
|
|
|
|
|
2012-03-14 15:43:26 -07:00
|
|
|
namespace dom {
|
|
|
|
namespace gonk {
|
2012-01-09 15:18:23 -08:00
|
|
|
|
|
|
|
class SystemWorkerManager : public nsIObserver,
|
2013-01-23 22:42:07 -08:00
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsISystemWorkerManager
|
2012-01-09 15:18:23 -08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2013-01-23 22:42:07 -08:00
|
|
|
NS_DECL_NSISYSTEMWORKERMANAGER
|
2012-01-09 15:18:23 -08:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
static already_AddRefed<SystemWorkerManager>
|
|
|
|
FactoryCreate();
|
|
|
|
|
|
|
|
static nsIInterfaceRequestor*
|
|
|
|
GetInterfaceRequestor();
|
|
|
|
|
2013-02-02 00:01:25 -08:00
|
|
|
static bool SendRilRawData(ipc::UnixSocketRawData* aRaw);
|
2013-02-01 04:28:22 -08:00
|
|
|
|
2012-01-09 15:18:23 -08:00
|
|
|
private:
|
|
|
|
SystemWorkerManager();
|
|
|
|
~SystemWorkerManager();
|
|
|
|
|
2012-08-30 07:46:04 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2012-08-29 13:35:53 -07:00
|
|
|
nsresult InitNetd(JSContext *cx);
|
2012-08-30 07:46:04 -07:00
|
|
|
#endif
|
2012-01-09 15:18:23 -08:00
|
|
|
nsresult InitWifi(JSContext *cx);
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2012-08-30 07:46:04 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2012-08-29 13:35:53 -07:00
|
|
|
nsCOMPtr<nsIWorkerHolder> mNetdWorker;
|
2012-08-30 07:46:04 -07:00
|
|
|
#endif
|
2012-01-09 15:18:23 -08:00
|
|
|
nsCOMPtr<nsIWorkerHolder> mWifiWorker;
|
|
|
|
|
2013-02-02 00:01:25 -08:00
|
|
|
nsRefPtr<ipc::RilConsumer> mRilConsumer;
|
2013-02-01 04:28:22 -08:00
|
|
|
|
2012-01-09 15:18:23 -08:00
|
|
|
bool mShutdown;
|
2011-12-04 23:58:27 -08:00
|
|
|
};
|
2012-01-09 15:18:23 -08:00
|
|
|
|
2012-03-14 15:43:26 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-01-09 15:18:23 -08:00
|
|
|
|
|
|
|
#endif // mozilla_dom_system_b2g_systemworkermanager_h__
|