chore_introduce_blocking_api_for_electron.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: deepak1556 <[email protected]>
  3. Date: Tue, 15 Nov 2022 21:45:28 +0900
  4. Subject: chore: introduce blocking api for //electron
  5. This patch comes after Chromium removed the ScopedAllowIO API in favor
  6. of explicitly adding ScopedAllowBlocking calls as friends.
  7. diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
  8. index b88010ec63528497fc2ae0b7b3fc04c0fdd2e539..51565cbfe42bf17881c13d12facb3d982bbab335 100644
  9. --- a/base/threading/thread_restrictions.h
  10. +++ b/base/threading/thread_restrictions.h
  11. @@ -133,6 +133,7 @@ class FirefoxProfileLock;
  12. class KeyStorageLinux;
  13. class NativeBackendKWallet;
  14. class NativeDesktopMediaList;
  15. +class ProcessSingleton;
  16. class Profile;
  17. class ProfileImpl;
  18. class StartupTabProviderImpl;
  19. @@ -272,6 +273,9 @@ class BackendImpl;
  20. class InFlightIO;
  21. bool CleanupDirectorySync(const base::FilePath&);
  22. } // namespace disk_cache
  23. +namespace electron {
  24. +class ScopedAllowBlockingForElectron;
  25. +} // namespace electron
  26. namespace enterprise_connectors {
  27. class LinuxKeyRotationCommand;
  28. } // namespace enterprise_connectors
  29. @@ -582,6 +586,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
  30. friend class ::DesktopNotificationBalloon;
  31. friend class ::FirefoxProfileLock;
  32. friend class ::GaiaConfig;
  33. + friend class ::ProcessSingleton;
  34. friend class ::ProfileImpl;
  35. friend class ::ScopedAllowBlockingForProfile;
  36. friend class ::StartupTabProviderImpl;
  37. @@ -619,6 +624,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
  38. friend class crosapi::LacrosThreadTypeDelegate;
  39. friend class crypto::ScopedAllowBlockingForNSS; // http://crbug.com/59847
  40. friend class drive::FakeDriveService;
  41. + friend class electron::ScopedAllowBlockingForElectron;
  42. friend class extensions::InstalledLoader;
  43. friend class extensions::UnpackedInstaller;
  44. friend class font_service::internal::MappedFontFile;