Backed out changeset bcbab342eed8 (bug 1889658) for causing wpt reftest failures...
[gecko.git] / hal / sandbox / PHal.ipdl
blob2b8ba990fbab77950956b8a8782565104570038c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et ft=cpp : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 include protocol PContent;
8 include protocol PBrowser;
10 include "mozilla/dom/ReferrerInfoUtils.h";
11 include "mozilla/GfxMessageUtils.h";
13 using mozilla::hal::ScreenOrientation from "mozilla/HalIPCUtils.h";
14 using mozilla::hal::SensorType from "mozilla/HalSensor.h";
15 using mozilla::hal::WakeLockControl from "mozilla/HalTypes.h";
16 using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
17 using nsIntRect from "nsRect.h";
18 using PRTime from "prtime.h";
20 namespace mozilla {
22 namespace hal {
23 struct BatteryInformation {
24   double level;
25   bool   charging;
26   double remainingTime;
29 struct SensorData {
30   SensorType sensor;
31   PRTime timestamp;
32   float[] values;
35 struct NetworkInformation {
36   uint32_t type;
37   bool   isWifi;
38   uint32_t dhcpGateway;
41 struct WakeLockInformation {
42   nsString topic;
43   uint32_t numLocks;
44   uint32_t numHidden;
45   uint64_t[] lockingProcesses;
48 } // namespace hal
50 namespace hal_sandbox {
52 [ManualDealloc, ChildImpl=virtual, ParentImpl=virtual]
53 sync protocol PHal {
54     manager PContent;
56 child:
57     async NotifyBatteryChange(BatteryInformation aBatteryInfo);
58     async NotifyNetworkChange(NetworkInformation aNetworkInfo);
59     async NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
61 parent:
62     async Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
63     async CancelVibrate(uint64_t[] id, PBrowser browser);
65     async EnableBatteryNotifications();
66     async DisableBatteryNotifications();
67     sync GetCurrentBatteryInformation()
68       returns (BatteryInformation aBatteryInfo);
70     async EnableNetworkNotifications();
71     async DisableNetworkNotifications();
72     sync GetCurrentNetworkInformation()
73       returns (NetworkInformation aNetworkInfo);
75     async ModifyWakeLock(nsString aTopic,
76                          WakeLockControl aLockAdjust,
77                          WakeLockControl aHiddenAdjust);
78     async EnableWakeLockNotifications();
79     async DisableWakeLockNotifications();
80     sync GetWakeLockInfo(nsString aTopic)
81       returns (WakeLockInformation aWakeLockInfo);
83     async LockScreenOrientation(ScreenOrientation aOrientation)
84       returns (nsresult result);
85     async UnlockScreenOrientation();
87 child:
88     async NotifySensorChange(SensorData aSensorData);
90 parent:
91     async EnableSensorNotifications(SensorType aSensor);
92     async DisableSensorNotifications(SensorType aSensor);
94     async __delete__();
97 } // namespace hal
98 } // namespace mozilla