michael@0: /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=40: */ michael@0: /* Copyright 2012 Mozilla Foundation and Mozilla contributors michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: #ifndef mozilla_dom_system_b2g_systemworkermanager_h__ michael@0: #define mozilla_dom_system_b2g_systemworkermanager_h__ michael@0: michael@0: #include "nsIInterfaceRequestor.h" michael@0: #include "nsISystemWorkerManager.h" michael@0: #include "nsIObserver.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsXULAppAPI.h" // For XRE_GetProcessType michael@0: michael@0: class nsIWorkerHolder; michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace ipc { michael@0: class KeyStore; michael@0: } michael@0: michael@0: namespace dom { michael@0: namespace gonk { michael@0: michael@0: class SystemWorkerManager : public nsIObserver, michael@0: public nsIInterfaceRequestor, michael@0: public nsISystemWorkerManager michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIOBSERVER michael@0: NS_DECL_NSIINTERFACEREQUESTOR michael@0: NS_DECL_NSISYSTEMWORKERMANAGER michael@0: michael@0: nsresult Init(); michael@0: void Shutdown(); michael@0: michael@0: static already_AddRefed michael@0: FactoryCreate(); michael@0: michael@0: static nsIInterfaceRequestor* michael@0: GetInterfaceRequestor(); michael@0: michael@0: private: michael@0: SystemWorkerManager(); michael@0: ~SystemWorkerManager(); michael@0: michael@0: nsresult InitWifi(JSContext *cx); michael@0: nsresult InitKeyStore(JSContext *cx); michael@0: michael@0: nsCOMPtr mWifiWorker; michael@0: michael@0: nsRefPtr mKeyStore; michael@0: michael@0: bool mShutdown; michael@0: }; michael@0: michael@0: } michael@0: } michael@0: } michael@0: michael@0: #endif // mozilla_dom_system_b2g_systemworkermanager_h__