WebBatteryManagerProxy.h [plain text]
#ifndef WebBatteryManagerProxy_h
#define WebBatteryManagerProxy_h
#if ENABLE(BATTERY_STATUS)
#include "APIObject.h"
#include "MessageReceiver.h"
#include "WebBatteryProvider.h"
#include "WebContextSupplement.h"
#include <wtf/Forward.h>
namespace WebKit {
class WebProcessPool;
class WebBatteryStatus;
class WebBatteryManagerProxy : public API::ObjectImpl<API::Object::Type::BatteryManager>, public WebContextSupplement, private IPC::MessageReceiver {
public:
static const char* supplementName();
static Ref<WebBatteryManagerProxy> create(WebProcessPool*);
virtual ~WebBatteryManagerProxy();
void initializeProvider(const WKBatteryProviderBase*);
void providerDidChangeBatteryStatus(const WTF::AtomicString&, WebBatteryStatus*);
void providerUpdateBatteryStatus(WebBatteryStatus*);
using API::Object::ref;
using API::Object::deref;
private:
explicit WebBatteryManagerProxy(WebProcessPool*);
virtual void processPoolDestroyed() override;
virtual void processDidClose(WebProcessProxy*) override;
virtual void refWebContextSupplement() override;
virtual void derefWebContextSupplement() override;
virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
void startUpdating();
void stopUpdating();
bool m_isUpdating;
WebBatteryProvider m_provider;
};
}
#endif // ENABLE(BATTERY_STATUS)
#endif // WebBatteryManagerProxy_h