Skip to content
Snippets Groups Projects
  1. Jan 30, 2023
  2. Jan 25, 2023
  3. Dec 14, 2022
  4. Nov 25, 2022
  5. Nov 24, 2022
  6. Nov 14, 2022
  7. Oct 20, 2022
  8. Sep 22, 2022
  9. Aug 09, 2022
    • Gabriele Svelto's avatar
      Bug 1771712 - Make it more likely for child processes to be killed under OOM... · a203b827
      Gabriele Svelto authored
      Bug 1771712 - Make it more likely for child processes to be killed under OOM conditions compared to the parent process on Linux r=jld
      
      This patch implements hal::SetProcessPriority() on Linux and leverages
      it to make it more likely that the parent process and foreground tab
      survive an OOM situation, letting Linux' OOM killer reap preallocated
      processes and background tabs first when reclaiming memory.
      
      This is achieved by setting the `oom_score_adj` values of said processes
      such that they will be killed in this order:
      
      * Preallocated processes will be the first to go, they don't contain
        user data and are not visible, so they're a good candidate to free up
        memory
      * Background tabs will be killed next, we don't generate crash reports
        for thoes nor do we inform the user, we just reload the tab, so in
        most cases one being killed will only be a small annoyance
      * Background tabs playing video come next, but only if they're not also
        playing or recording audio
      * Finally foreground tabs will be killed as a last resort, background
        tabs playing audio or with an active WebRTC session are also
        considered to be in the foreground as the user will immediately notice
        if they crash
      
      Note that this patch only implements the low-level plumbing. The process
      priority manager has not been enabled on Linux yet so that needs to
      happen before this actually works.
      
      Differential Revision: https://phabricator.services.mozilla.com/D153466
      a203b827
  10. Jul 25, 2022
  11. Jun 22, 2022
  12. May 20, 2022
  13. Mar 23, 2022
  14. Mar 02, 2022
  15. Feb 15, 2022
  16. Feb 14, 2022
  17. Feb 09, 2022
  18. Feb 03, 2022
  19. Jan 15, 2022
  20. Jan 14, 2022
  21. Jan 12, 2022
  22. Jan 09, 2022
  23. Dec 30, 2021
  24. Dec 15, 2021
  25. Dec 06, 2021
    • Cathy Lu's avatar
      Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida · 8348b23f
      Cathy Lu authored
      Previously, the screenOrientation.lock API was for Fennec and not supported for Fenix and multi-process use. The overall idea is to now allow apps to use the API through a delegate and make asynchronous calls to LockDeviceOrientation. This required replacing the existing code that returned a default false bool to calls that perform the requested orientation change and instead return a promise that contained either an allow or deny value.
      
      Returning a promise instead of a bool involved changing the API calls from the C++ side to Java. The new general control flow of screenOrientation lock follows: an app calls C++ ScreenOrientation.lock() which eventually dispatches LockOrientationTask to resolve the pending orientation promise. Hal.cpp sends an IPC call to the content process and RecvLockScreenOrientation retrieves the current instance of geckoRuntime and calls the java side LockScreenOrientation. Apps must create a delegate and override onOrientationLock to set the requested orientation. In geckoview's testing, this is done with the android API setRequestedOrientation. Once a device orientation change has been triggered, native OnOrientationChange calls to NotifyScreenConfigurationChange, which notifies all observers and dispatches a change event to resolve the pending orientation promise.
      
      Testing:
      I used a demo on the GeckoView Example (https://usefulangle.com/demos/105/screen.html) to test locking to landscape orientation. This required a change to the GVE to show the app from recreating the whole thing on orientation change. In the example AndroidManifest xml file, `orientation` prevents restart when orientation changes.
      
      The Junit/Kotlin tests were to verify that the expected orientation delegate was called with the expected new orientation value, in an orientation change, if the new orientation was the same as the current, and if the pre-lock conditions such as being fullscreen were not met.
      
      A static preference `dom.screenorientation.allow-lock` was added to the dom group, since it affects the ui dom) and is currently turned off. C++ can access it through its mirrored variable dom_screenorientation_allow_lock (same name but with underscores). The junit tests turn the preference on and test the lock feature.
      
      Reference:
      Orientation constant values:
          C++
              1 ScreenOrientation_PortraitPrimary); - vertical with button at bottom
              2 ScreenOrientation_PortraitSecondary); - vertical with button at top
              4 ScreenOrientation_LandscapePrimary); - horizational w button right
              8 ScreenOrientation_LandscapeSecondary); - horization button left
              16 ScreenOrientation_Default);
          Java
              1 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_PRIMARY.value
              2 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_SECONDARY.value
              4 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_PRIMARY.value
              8 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_SECONDARY.value
      
          Java public API
              0 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
              1 Activitynfo.SCREEN_ORIENTATION_PORTRAIT
      
          Android
              1 ORIENTATION_PORTRAIT
              2 ORIENTATION_LANDSCAPE
      
      Differential Revision: https://phabricator.services.mozilla.com/D129427
      8348b23f
  26. Dec 04, 2021
  27. Dec 03, 2021
    • Cathy Lu's avatar
      Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida · 3e9924d5
      Cathy Lu authored
      Previously, the screenOrientation.lock API was for Fennec and not supported for Fenix and multi-process use. The overall idea is to now allow apps to use the API through a delegate and make asynchronous calls to LockDeviceOrientation. This required replacing the existing code that returned a default false bool to calls that perform the requested orientation change and instead return a promise that contained either an allow or deny value.
      
      Returning a promise instead of a bool involved changing the API calls from the C++ side to Java. The new general control flow of screenOrientation lock follows: an app calls C++ ScreenOrientation.lock() which eventually dispatches LockOrientationTask to resolve the pending orientation promise. Hal.cpp sends an IPC call to the content process and RecvLockScreenOrientation retrieves the current instance of geckoRuntime and calls the java side LockScreenOrientation. Apps must create a delegate and override onOrientationLock to set the requested orientation. In geckoview's testing, this is done with the android API setRequestedOrientation. Once a device orientation change has been triggered, native OnOrientationChange calls to NotifyScreenConfigurationChange, which notifies all observers and dispatches a change event to resolve the pending orientation promise.
      
      Testing:
      I used a demo on the GeckoView Example (https://usefulangle.com/demos/105/screen.html) to test locking to landscape orientation. This required a change to the GVE to show the app from recreating the whole thing on orientation change. In the example AndroidManifest xml file, `orientation` prevents restart when orientation changes.
      
      The Junit/Kotlin tests were to verify that the expected orientation delegate was called with the expected new orientation value, in an orientation change, if the new orientation was the same as the current, and if the pre-lock conditions such as being fullscreen were not met.
      
      A static preference `dom.screenorientation.allow-lock` was added to the dom group, since it affects the ui dom) and is currently turned off. C++ can access it through its mirrored variable dom_screenorientation_allow_lock (same name but with underscores). The junit tests turn the preference on and test the lock feature.
      
      Reference:
      Orientation constant values:
          C++
              1 ScreenOrientation_PortraitPrimary); - vertical with button at bottom
              2 ScreenOrientation_PortraitSecondary); - vertical with button at top
              4 ScreenOrientation_LandscapePrimary); - horizational w button right
              8 ScreenOrientation_LandscapeSecondary); - horization button left
              16 ScreenOrientation_Default);
          Java
              1 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_PRIMARY.value
              2 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_SECONDARY.value
              4 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_PRIMARY.value
              8 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_SECONDARY.value
      
          Java public API
              0 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
              1 Activitynfo.SCREEN_ORIENTATION_PORTRAIT
      
          Android
              1 ORIENTATION_PORTRAIT
              2 ORIENTATION_LANDSCAPE
      
      Differential Revision: https://phabricator.services.mozilla.com/D129427
      3e9924d5
    • criss's avatar
    • Cathy Lu's avatar
      Bug 1697647 - Add screen orientation lock api r=ipc-reviewers,mccr8,agi,smaug,jonalmeida · 1e4d05e6
      Cathy Lu authored
      Previously, the screenOrientation.lock API was for Fennec and not supported for Fenix and multi-process use. The overall idea is to now allow apps to use the API through a delegate and make asynchronous calls to LockDeviceOrientation. This required replacing the existing code that returned a default false bool to calls that perform the requested orientation change and instead return a promise that contained either an allow or deny value.
      
      Returning a promise instead of a bool involved changing the API calls from the C++ side to Java. The new general control flow of screenOrientation lock follows: an app calls C++ ScreenOrientation.lock() which eventually dispatches LockOrientationTask to resolve the pending orientation promise. Hal.cpp sends an IPC call to the content process and RecvLockScreenOrientation retrieves the current instance of geckoRuntime and calls the java side LockScreenOrientation. Apps must create a delegate and override onOrientationLock to set the requested orientation. In geckoview's testing, this is done with the android API setRequestedOrientation. Once a device orientation change has been triggered, native OnOrientationChange calls to NotifyScreenConfigurationChange, which notifies all observers and dispatches a change event to resolve the pending orientation promise.
      
      Testing:
      I used a demo on the GeckoView Example (https://usefulangle.com/demos/105/screen.html) to test locking to landscape orientation. This required a change to the GVE to show the app from recreating the whole thing on orientation change. In the example AndroidManifest xml file, `orientation` prevents restart when orientation changes.
      
      The Junit/Kotlin tests were to verify that the expected orientation delegate was called with the expected new orientation value, in an orientation change, if the new orientation was the same as the current, and if the pre-lock conditions such as being fullscreen were not met.
      
      A static preference `dom.screenorientation.allow-lock` was added to the dom group, since it affects the ui dom) and is currently turned off. C++ can access it through its mirrored variable dom_screenorientation_allow_lock (same name but with underscores). The junit tests turn the preference on and test the lock feature.
      
      Reference:
      Orientation constant values:
          C++
              1 ScreenOrientation_PortraitPrimary); - vertical with button at bottom
              2 ScreenOrientation_PortraitSecondary); - vertical with button at top
              4 ScreenOrientation_LandscapePrimary); - horizational w button right
              8 ScreenOrientation_LandscapeSecondary); - horization button left
              16 ScreenOrientation_Default);
          Java
              1 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_PRIMARY.value
              2 GeckoScreenOrientation.ScreenOrientation.PORTRAIT_SECONDARY.value
              4 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_PRIMARY.value
              8 GeckoScreenOrientation.ScreenOrientation.LANDSCAPE_SECONDARY.value
      
          Java public API
              0 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
              1 Activitynfo.SCREEN_ORIENTATION_PORTRAIT
      
          Android
              1 ORIENTATION_PORTRAIT
              2 ORIENTATION_LANDSCAPE
      
      Differential Revision: https://phabricator.services.mozilla.com/D129427
      1e4d05e6
  28. Aug 25, 2021
    • Andi-Bogdan Postelnicu's avatar
      Bug 1725145 - Preparation for the hybrid build env.... · 2fc4f70e
      Andi-Bogdan Postelnicu authored
      Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
      
      Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
      when the module governed by the build config file is not buildable outside on the unified environment.
      
      This needs to be done in order to have a hybrid build system that adds the possibility of combing
      unified build components with ones that are built outside of the unified eco system.
      
      Differential Revision: https://phabricator.services.mozilla.com/D122345
      2fc4f70e
  29. Jul 22, 2021
  30. May 10, 2021
Loading