Commit Graph

176 Commits

Author SHA1 Message Date
Simon Giesecke
cfe83618aa Bug 1626570 - Improve handling of copying arrays in hal/. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D73637
2020-05-05 10:14:24 +00:00
Sylvestre Ledru
3a389404c5 Bug 1605934 - Use nested namespaces r=sg
Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files

Differential Revision: https://phabricator.services.mozilla.com/D58217
2020-01-18 13:48:34 +00:00
Dorel Luca
8cc61e1d4b Backed out changeset bbb39655cf71 (bug 1605934) for build bustage in widget/gtk/mozwayland/mozwayland.c 2020-01-18 15:39:55 +02:00
Sylvestre Ledru
8cc3e9bf3f Bug 1605934 - Use nested namespaces r=sg
Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files

Differential Revision: https://phabricator.services.mozilla.com/D58217
2020-01-18 13:16:39 +00:00
Gabriele Svelto
eeb9bfc398 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55443
2019-12-06 09:16:44 +00:00
Gabriele Svelto
652cb568da Bug 1585156 - Remove useless inclusions of nsIDOMWindow.h and nsIDOMWindowUtils.h r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D47678
2019-09-30 22:06:47 +00:00
Ryan Hunt
0ab69187a6 Bug 1534395 - Rename nsITabChild to nsIBrowserChild. r=nika,mconley
Similarly to nsITabParent, TabChild is exposed to frontend code via nsITabChild. It's not clear what the future of this interface will be, but for now we can just rename it to nsIBrowserChild.

Differential Revision: https://phabricator.services.mozilla.com/D28134
2019-04-09 18:15:02 -05:00
Ehsan Akhgari
498e2df734 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez
dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Gabriele Svelto
b40a76dd4a Bug 1488401 - Remove the remnants of the DiskSpaceWatcher r=asuth,janv,smaug
Differential Revision: https://phabricator.services.mozilla.com/D4933
2018-09-13 06:40:51 +00:00
Gabriele Svelto
5ba6ce6d43 Bug 1476250 - Simplify HAL initialization and shutdown to reduce the chance of leaks and UAFs r=froydnj
This patch initializes some HAL components greedily so that we can get rid of
lazy initializers within the code. Observers are still lazily initialized
because they can be instanced within content processes but that doesn't always
happen and we don't want to pay the memory price for structures we don't use.

Shutdown is now happening at a fixed time for all HAL components save
WakeLocks. This ensures that we don't destroy an object while still iterating
over it, something that could happen before.

Finally a workaround for a compiler limitation has been removed.

Differential Revision: https://phabricator.services.mozilla.com/D3100
2018-08-31 20:29:30 +00:00
Gabriele Svelto
b3b1ef307d Bug 1486772 - Refactor the screen-orientation types and headers r=smaug
This patch removes the 'ScreenOrientationInternal' type from
dom/base/ScreenOrientation.h and moves it into the
HalScreenConfiguration.h header, renaming it simply to 'ScreenOrientation'
in the process. This has several knock-off effects:

- It allows files that needed ScreenOrientationInternal to include a much
  smaller header than before

- It greatly reduces the number of headers pulled in when including Hal.h

- It clarifies the role of the type. The 'Internal' part in the name had
  nothing to do with it being part of the implementation. The type was public
  and called that way only to avoid clashing with the 'ScreenOrientation'
  class. Since we moved it into a different namespace it can be renamed
  safely.

- It allows a file that was manually re-declaring 'ScreenConfigurationInternal'
  type to use the original one

- Finally this fixes a few files which were missing headers they actually
  required but that would still build because unified compilation put them into
  units that already had those headers thanks to ScreenConfiguration.h

Differential Revision: https://phabricator.services.mozilla.com/D4458
2018-08-29 20:54:56 +00:00
Hiroyuki Ikezoe
591cb2ccb5 Bug 1482753 - Introduce two macros to implement HAL observers handy. r=gsvelto
If `ScreenConfiguration` were `ScreenInformation` we could integrate
notification functions into the macros too.

Differential Revision: https://phabricator.services.mozilla.com/D3182
2018-08-13 10:57:50 +09:00
Gabriele Svelto
daf770ed28 Bug 1469914 - Prevent the HAL from registering duplicate observers; r=froydnj
This also replaces the custom logic in ObserverList with an nsTObserverArray
which has all the necessary logic for stable iteration over a potentially
changing list of items. Unused dependencies were also removed.
2018-06-22 00:35:08 +02:00
Dorel Luca
577c93eec1 Backed out changeset cd857f86810c (bug 1469914) for causing leaks on multiple tests. CLOSED TREE 2018-07-02 13:14:18 +03:00
Gabriele Svelto
f1f6f2e5d0 Bug 1469914 - Prevent the HAL from registering duplicate observers; r=froydnj
This also replaces the custom logic in ObserverList with an nsTObserverArray
which has all the necessary logic for stable iteration over a potentially
changing list of items. Unused dependencies were also removed.
2018-06-22 00:35:08 +02:00
Gabriele Svelto
de62c159c3 Bug 1469309 - Remove an unused sensor type; r=agaynor 2018-06-19 09:18:09 +02:00
Gabriele Svelto
c7db2255be Bug 1465898 - Remove unused code for managing physical audio devices; r=agaynor
MozReview-Commit-ID: 7NsUfzJCUOB
2018-06-04 22:28:09 +02:00
Randell Jesup
481a5a2e04 Bug 1463494: delete the sensor observerlist array in a deferred manner r=froyd,jchen
clean up sensorlist if Dispatch fails
2018-05-25 21:16:28 -04:00
Noemi Erli
eaf3950357 Backed out changeset b837a2a32aeb (bug 1463494) for leak failures on a CLOSED TREE 2018-05-24 17:54:10 +03:00
Randell Jesup
067049848b Bug 1463494: delete the sensor observerlist array in a deferred manner r=froyd 2018-05-24 08:58:54 -04:00
Adrian Wielgosik
93eb294385 Bug 1460940 - Clean up most remaining C++-side uses of nsIDOMDocument. r=bz
MozReview-Commit-ID: LKRnyDPNlle
2018-05-11 19:46:15 +02:00
Ryan Hunt
87e6ba827d Bug 1455408 - Remove thread priority suppport from HAL as it isn't used any longer. r=gsvelto
MozReview-Commit-ID: KJ2byDuYWr9
2018-04-19 14:48:02 -05:00
Makoto Kato
f908b4f5c4 Bug 1447873 - Remove Time API backend in hal. r=gsvelto
Time API is already removed, so hal backend is unnecessary now.

MozReview-Commit-ID: 8R2VRYIX9Vs
2018-03-22 10:46:42 +09:00
Nicholas Nethercote
a017a9b988 Bug 1382955 (part 3) - Remove a bunch of unused HAL stuff. r=gsvelto,kanru. 2017-08-02 10:09:32 +10:00
Nicholas Nethercote
52785864e7 Bug 1382955 (part 2) - Remove nsIPowerManagerService::{powerOff,reboot,restart} and related things. r=gsvelto. 2017-08-02 10:09:26 +10:00
Nicholas Nethercote
1dde4c33d7 Bug 1382955 (part 1) - Remove MozPowerManager and related things. r=bz,gsvelto.
This includes the FactoryReset stuff.
2017-08-02 10:04:36 +10:00
Nicholas Nethercote
d0436bb1c9 Bug 1382099 - Remove MOZ_WIDGET_GONK from hal/. r=gsvelto. 2017-07-24 10:08:55 +10:00
Andrea Marchesini
bdb890d075 Bug 1366356 - Decrease the process priority of content processes that are not running a foreground tab - part 2 - enabled if the platform specific code is ready, r=smaug 2017-06-07 09:59:00 +02:00
Andrea Marchesini
381581d4f8 Bug 1368029 - Remove LRU priority support from ProcessPriorityManager, r=gsvelto 2017-05-26 17:50:17 +02:00
Makoto Kato
6991b3ae0c Bug 1350169 - Part 2. Remove Alarm API backend from HAL. r=gsvelto
By bug 130884, we removed alarm API, so we should remove alarm backend from HAL.

MozReview-Commit-ID: EBiMJSUfUHu
2017-03-24 10:45:10 +09:00
Gabor Krizsanits
4db23a5539 Bug 1324428 - Simplified preallocated process manager. r=billm 2017-02-01 13:34:24 +01:00
Andi-Bogdan Postelnicu
6184140a06 Bug 1319741 - Use C++11's override and remove virtual where applicable in hal/. r=gsvelto
MozReview-Commit-ID: 94CcvRoR6zQ
2016-11-23 13:21:06 +02:00
Ehsan Akhgari
aa367a9cdd Bug 1311149 - Remove the b2g preallocated app support; r=baku 2016-11-16 09:17:35 -05:00
Carsten "Tomcat" Book
979d51a6a3 Backed out changeset f1ff6d4dca5f (bug 1311149) 2016-11-16 14:50:40 +01:00
Ehsan Akhgari
a092a1aba9 Bug 1311149 - Remove the b2g preallocated app support; r=baku 2016-11-15 23:21:28 -05:00
Michelangelo De Simone
d7ed2cb820 Bug 1315798 - Remove FMRADIO support from HAL. r=mds
MozReview-Commit-ID: E6KGgMd8Cfg
2016-11-07 14:09:57 -08:00
Ehsan Akhgari
28b952324b Bug 1299493 - Remove Navigator.get/hasFeature(); r=baku 2016-08-31 18:02:46 -04:00
sajitk
d29778ad61 Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in various files.r=benjamin 2016-01-28 10:35:00 -08:00
Trevor Saunders
61214ccded bug 1249738 - make sSystemTimezoneChangeObservers a function static r=dhylands 2016-02-26 11:11:11 -05:00
Trevor Saunders
525ad93feb bug 1249738 - make sSystemClockChangeObservers a function static r=dhylands 2016-02-26 11:11:10 -05:00
Trevor Saunders
f6d25106fd bug 1249738 - make sWakeLockObservers a function static r=dhylands 2016-02-26 11:11:10 -05:00
Trevor Saunders
c6bd5b78af bug 1249738 - make sScreenConfigurationObservers a function static r=dhylands 2016-02-26 11:11:10 -05:00
Trevor Saunders
526a9bdb41 bug 1249738 - make sNetworkObservers a function static r=dhylands 2016-02-26 11:11:10 -05:00
Trevor Saunders
45411c606d bug 1249738 - make sBatteryObservers a function static r=dhylands 2016-02-26 11:11:09 -05:00
Mantaroh Yoshinaga
0704b2c0c9 Bug 1248339 - fix header sort order of hal. r=gsvelto 2016-02-15 07:33:00 +01:00
Kyle Huey
e95edb30a9 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Wes Kocher
a45876f1c0 Backed out changeset 2c56aed63687 (bug 1219482) to hopefully fix the intermittent hazard failures CLOSED TREE 2016-01-29 10:15:38 -08:00
sajitk
586c51b281 Bug 1219482 - Replace PRLogModuleInfo with LazyLogModule in various files. r=bsmedberg 2016-01-28 10:35:00 -05:00