2012-01-10 03:18:23 +04: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 13:10:44 +04: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 11:58:27 +04:00
|
|
|
|
2012-01-10 03:18:23 +04:00
|
|
|
#ifndef mozilla_dom_system_b2g_systemworkermanager_h__
|
|
|
|
#define mozilla_dom_system_b2g_systemworkermanager_h__
|
2011-12-05 11:58:27 +04:00
|
|
|
|
2012-01-10 03:18:23 +04:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2013-01-24 10:42:07 +04:00
|
|
|
#include "nsISystemWorkerManager.h"
|
2012-01-10 03:18:23 +04:00
|
|
|
#include "nsIObserver.h"
|
2012-03-15 02:43:26 +04:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2013-10-29 12:12:45 +04:00
|
|
|
#include "nsXULAppAPI.h" // For XRE_GetProcessType
|
2012-01-10 03:18:23 +04:00
|
|
|
|
|
|
|
class nsIWorkerHolder;
|
|
|
|
|
2012-03-15 02:43:26 +04:00
|
|
|
namespace mozilla {
|
2013-02-01 16:28:22 +04:00
|
|
|
|
|
|
|
namespace ipc {
|
2013-10-01 08:09:57 +04:00
|
|
|
class KeyStore;
|
2013-02-01 16:28:22 +04:00
|
|
|
}
|
|
|
|
|
2012-03-15 02:43:26 +04:00
|
|
|
namespace dom {
|
|
|
|
namespace gonk {
|
2012-01-10 03:18:23 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SystemWorkerManager final : public nsIObserver,
|
2015-03-27 21:52:19 +03:00
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsISystemWorkerManager
|
2012-01-10 03:18:23 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2013-01-24 10:42:07 +04:00
|
|
|
NS_DECL_NSISYSTEMWORKERMANAGER
|
2012-01-10 03:18:23 +04:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
static already_AddRefed<SystemWorkerManager>
|
|
|
|
FactoryCreate();
|
|
|
|
|
|
|
|
static nsIInterfaceRequestor*
|
|
|
|
GetInterfaceRequestor();
|
|
|
|
|
|
|
|
private:
|
|
|
|
SystemWorkerManager();
|
|
|
|
~SystemWorkerManager();
|
|
|
|
|
|
|
|
nsresult InitWifi(JSContext *cx);
|
2013-10-01 08:09:57 +04:00
|
|
|
nsresult InitKeyStore(JSContext *cx);
|
2012-07-18 07:41:54 +04:00
|
|
|
|
2012-01-10 03:18:23 +04:00
|
|
|
nsCOMPtr<nsIWorkerHolder> mWifiWorker;
|
|
|
|
|
2013-10-01 08:09:57 +04:00
|
|
|
nsRefPtr<ipc::KeyStore> mKeyStore;
|
2013-02-01 16:28:22 +04:00
|
|
|
|
2012-01-10 03:18:23 +04:00
|
|
|
bool mShutdown;
|
2011-12-05 11:58:27 +04:00
|
|
|
};
|
2012-01-10 03:18:23 +04:00
|
|
|
|
2012-03-15 02:43:26 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-01-10 03:18:23 +04:00
|
|
|
|
|
|
|
#endif // mozilla_dom_system_b2g_systemworkermanager_h__
|