2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-08-28 00:54:51 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef WifiProxyService_h
|
|
|
|
#define WifiProxyService_h
|
|
|
|
|
|
|
|
#include "nsIWifiService.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsThread.h"
|
|
|
|
#include "mozilla/dom/WifiOptionsBinding.h"
|
2013-10-14 12:33:59 +04:00
|
|
|
#include "nsTArray.h"
|
2013-08-28 00:54:51 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class WifiProxyService final : public nsIWifiProxyService
|
2013-08-28 00:54:51 +04:00
|
|
|
{
|
2013-10-14 12:33:59 +04:00
|
|
|
private:
|
|
|
|
struct EventThreadListEntry
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIThread> mThread;
|
|
|
|
nsCString mInterface;
|
|
|
|
};
|
|
|
|
|
2013-08-28 00:54:51 +04:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIWIFIPROXYSERVICE
|
|
|
|
|
|
|
|
static already_AddRefed<WifiProxyService>
|
|
|
|
FactoryCreate();
|
|
|
|
|
2013-10-14 12:33:59 +04:00
|
|
|
void DispatchWifiEvent(const nsAString& aEvent, const nsACString& aInterface);
|
|
|
|
void DispatchWifiResult(const mozilla::dom::WifiResultOptions& aOptions,
|
|
|
|
const nsACString& aInterface);
|
2013-08-28 00:54:51 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
WifiProxyService();
|
|
|
|
~WifiProxyService();
|
|
|
|
|
2013-10-14 12:33:59 +04:00
|
|
|
nsTArray<EventThreadListEntry> mEventThreadList;
|
2013-08-28 00:54:51 +04:00
|
|
|
nsCOMPtr<nsIThread> mControlThread;
|
|
|
|
nsCOMPtr<nsIWifiEventListener> mListener;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // WifiProxyService_h
|