1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/system/gonk/SystemWorkerManager.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,76 @@ 1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=40: */ 1.6 +/* Copyright 2012 Mozilla Foundation and Mozilla contributors 1.7 + * 1.8 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.9 + * you may not use this file except in compliance with the License. 1.10 + * You may obtain a copy of the License at 1.11 + * 1.12 + * http://www.apache.org/licenses/LICENSE-2.0 1.13 + * 1.14 + * Unless required by applicable law or agreed to in writing, software 1.15 + * distributed under the License is distributed on an "AS IS" BASIS, 1.16 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1.17 + * See the License for the specific language governing permissions and 1.18 + * limitations under the License. 1.19 + */ 1.20 + 1.21 +#ifndef mozilla_dom_system_b2g_systemworkermanager_h__ 1.22 +#define mozilla_dom_system_b2g_systemworkermanager_h__ 1.23 + 1.24 +#include "nsIInterfaceRequestor.h" 1.25 +#include "nsISystemWorkerManager.h" 1.26 +#include "nsIObserver.h" 1.27 +#include "nsAutoPtr.h" 1.28 +#include "nsCOMPtr.h" 1.29 +#include "nsXULAppAPI.h" // For XRE_GetProcessType 1.30 + 1.31 +class nsIWorkerHolder; 1.32 + 1.33 +namespace mozilla { 1.34 + 1.35 +namespace ipc { 1.36 + class KeyStore; 1.37 +} 1.38 + 1.39 +namespace dom { 1.40 +namespace gonk { 1.41 + 1.42 +class SystemWorkerManager : public nsIObserver, 1.43 + public nsIInterfaceRequestor, 1.44 + public nsISystemWorkerManager 1.45 +{ 1.46 +public: 1.47 + NS_DECL_ISUPPORTS 1.48 + NS_DECL_NSIOBSERVER 1.49 + NS_DECL_NSIINTERFACEREQUESTOR 1.50 + NS_DECL_NSISYSTEMWORKERMANAGER 1.51 + 1.52 + nsresult Init(); 1.53 + void Shutdown(); 1.54 + 1.55 + static already_AddRefed<SystemWorkerManager> 1.56 + FactoryCreate(); 1.57 + 1.58 + static nsIInterfaceRequestor* 1.59 + GetInterfaceRequestor(); 1.60 + 1.61 +private: 1.62 + SystemWorkerManager(); 1.63 + ~SystemWorkerManager(); 1.64 + 1.65 + nsresult InitWifi(JSContext *cx); 1.66 + nsresult InitKeyStore(JSContext *cx); 1.67 + 1.68 + nsCOMPtr<nsIWorkerHolder> mWifiWorker; 1.69 + 1.70 + nsRefPtr<ipc::KeyStore> mKeyStore; 1.71 + 1.72 + bool mShutdown; 1.73 +}; 1.74 + 1.75 +} 1.76 +} 1.77 +} 1.78 + 1.79 +#endif // mozilla_dom_system_b2g_systemworkermanager_h__