Skip to content
Snippets Groups Projects
  1. May 03, 2022
  2. Apr 14, 2022
    • Bryce Seager van Dyk's avatar
      Bug 1762490 - Annotate mscom/Interceptor to silence warnings. r=Jamie,jesup · d83c5d26
      Bryce Seager van Dyk authored
      This adds enough annotations to get the code building locally for me with
      warnings as errors. However, this patch involves ignoring analysis for certain
      functions.
      
      My read of the code here is that it involves conditional unlocking. My
      understanding is this messes with the static analysis. Since I'm not familiar
      with this code, I decided it best I don't update the locking mechanisms, so went
      with the current approach.
      
      I'm happy for this patch to be stolen and extended, or superseded, or landed and
      then iterated on. Hopefully it's of some use as a starting point.
      
      Differential Revision: https://phabricator.services.mozilla.com/D142771
      d83c5d26
  3. Mar 16, 2022
  4. Mar 08, 2022
  5. Mar 04, 2022
  6. Mar 02, 2022
  7. Feb 28, 2022
  8. Feb 11, 2022
  9. Nov 05, 2021
  10. Nov 09, 2021
  11. Nov 05, 2021
  12. Sep 28, 2021
  13. Sep 20, 2021
  14. Sep 15, 2021
  15. 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
  16. Aug 09, 2021
  17. Aug 04, 2021
    • Aaron Klotz's avatar
      Bug 1723837: Improve mscom::ProcessRuntime idempotency; r=Jamie,handyman · 5df7df28
      Aaron Klotz authored
      `mscom::ProcessRuntime` supports multiple instances because Reasons (TM).
      To make this happen, we store some information in `mozglue` that enforces
      serialization between instances and also informs an instance as to whether
      any other instances have successfully completed initialization.
      
      Unfortunately it is possible for us to encounter situations where one instance
      manages to *partially* but not *completely* finish initialization. Since our
      shared information is currently a simple `bool`, we cannot really capture this
      case.
      
      Furthermore, APIs such as `CoInitializeSecurity` will actually fail if called
      again after previous activity, so we should guard against multiple invocations
      within the same process.
      
      To improve this situation, I'd like to replace the shared `bool` with a typed
      enum that can provide finer-grained information as to how far a previous
      instance actually managed to get.
      
      Differential Revision: https://phabricator.services.mozilla.com/D121672
      5df7df28
  18. Jul 15, 2021
  19. Jul 07, 2021
  20. Jun 26, 2021
  21. Jun 17, 2021
  22. Jun 14, 2021
    • Aaron Klotz's avatar
      Bug 1707954: Part 3 - Add eager MTA creation to mscom::EnsureMTA; r=Jamie · 93f41e21
      Aaron Klotz authored
      * We make `EnsureMTA`'s default constructor `private`, and `ProcessRuntime` a friend.
        `ProcessRuntime` calls this to eagerly create the MTA.
      * The default constructor uses the new-ish `CoIncrementMTAUsage` to create the
        MTA without requiring a dedicated thread (when available). Otherwise we
        fall back to the traditional method. In the latter case, we synchronously
        wait for the initialization to complete so that we are guaranteed to have
        an MTA when we return.
      * Some minor refactoring to make it easier to do the sync wait in the
        default constructor. I also renamed a couple of things just to make them
        more clear.
      
      Differential Revision: https://phabricator.services.mozilla.com/D113562
      93f41e21
    • Aaron Klotz's avatar
      Bug 1707954: Part 1 - Change mscom::ProcessRuntime to ensure MTA creation during startup; r=Jamie · 07854385
      Aaron Klotz authored
      This patch does the following:
      
      * General cleanup:
        * More explicit restrictions of how/when the various constructors are available.
        * `InitializeSecurity` is made `static`, since it doesn't really manipulate instance variables.
        * We move some logic for resolving `CoInitializeEx` flags into `GetDesiredApartmentType`.
      * Addition of `PostInit`:
        * This doesn't do anything at the moment, but since I'm already making a bunch
          of changes, I wanted to add this too. `PostInit` is a static method that
          is invoked once the `ProcessRuntime` is finished initializing, and, when
          present, the sandbox is fully enabled.
      * We call `EnsureMTA`'s default constructor to eagerly bring up the MTA. This
        causes all background threads to implicitly become members of the MTA, which
        means that we can eliminate `CoInitializeEx` calls throughout our codebase,
        since they're slow and most developers do not have a clear understanding of
        what those functions actually do.
        * This also simplifies the COM initialization in sandboxed content processes
          with Win32K lockdown, since if our main thread is in the implicit MTA, we
          can immediately initialize ourselves without needing to punt that work
          over to the persistent MTA thread.
      
      Differential Revision: https://phabricator.services.mozilla.com/D113560
      07854385
  23. Jun 10, 2021
  24. Jun 09, 2021
    • Aaron Klotz's avatar
      Bug 1707954: Part 3 - Add eager MTA creation to mscom::EnsureMTA; r=Jamie · b16f77c6
      Aaron Klotz authored
      * We make `EnsureMTA`'s default constructor `private`, and `ProcessRuntime` a friend.
        `ProcessRuntime` calls this to eagerly create the MTA.
      * The default constructor uses the new-ish `CoIncrementMTAUsage` to create the
        MTA without requiring a dedicated thread (when available). Otherwise we
        fall back to the traditional method. In the latter case, we synchronously
        wait for the initialization to complete so that we are guaranteed to have
        an MTA when we return.
      * Some minor refactoring to make it easier to do the sync wait in the
        default constructor. I also renamed a couple of things just to make them
        more clear.
      
      Differential Revision: https://phabricator.services.mozilla.com/D113562
      b16f77c6
    • Aaron Klotz's avatar
      Bug 1707954: Part 1 - Change mscom::ProcessRuntime to ensure MTA creation during startup; r=Jamie · 6ff70a37
      Aaron Klotz authored
      This patch does the following:
      
      * General cleanup:
        * More explicit restrictions of how/when the various constructors are available.
        * `InitializeSecurity` is made `static`, since it doesn't really manipulate instance variables.
        * We move some logic for resolving `CoInitializeEx` flags into `GetDesiredApartmentType`.
      * Addition of `PostInit`:
        * This doesn't do anything at the moment, but since I'm already making a bunch
          of changes, I wanted to add this too. `PostInit` is a static method that
          is invoked once the `ProcessRuntime` is finished initializing, and, when
          present, the sandbox is fully enabled.
      * We call `EnsureMTA`'s default constructor to eagerly bring up the MTA. This
        causes all background threads to implicitly become members of the MTA, which
        means that we can eliminate `CoInitializeEx` calls throughout our codebase,
        since they're slow and most developers do not have a clear understanding of
        what those functions actually do.
        * This also simplifies the COM initialization in sandboxed content processes
          with Win32K lockdown, since if our main thread is in the implicit MTA, we
          can immediately initialize ourselves without needing to punt that work
          over to the persistent MTA thread.
      
      Differential Revision: https://phabricator.services.mozilla.com/D113560
      6ff70a37
Loading