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"
|
2013-10-29 08:12:45 +00:00
|
|
|
#include "nsXULAppAPI.h" // For XRE_GetProcessType
|
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 {
|
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();
|
|
|
|
|
|
|
|
private:
|
|
|
|
SystemWorkerManager();
|
|
|
|
~SystemWorkerManager();
|
|
|
|
|
|
|
|
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-01-09 23:18:23 +00:00
|
|
|
nsCOMPtr<nsIWorkerHolder> mWifiWorker;
|
|
|
|
|
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__
|