keep_alive_types.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_KEEP_ALIVE_REGISTRY_KEEP_ALIVE_TYPES_H_
  5. #define COMPONENTS_KEEP_ALIVE_REGISTRY_KEEP_ALIVE_TYPES_H_
  6. #include <ostream>
  7. // Types here are used to register KeepAlives.
  8. // They Give indications about which kind of optimizations are allowed during
  9. // the KeepAlive's lifetime. This allows to have more info about the state of
  10. // the browser to optimize the resource consumption.
  11. // Refers to the what the KeepAlive's lifetime is tied to, to help debugging.
  12. enum class KeepAliveOrigin {
  13. // c/b
  14. APP_CONTROLLER,
  15. BROWSER,
  16. BROWSER_PROCESS_CHROMEOS,
  17. BROWSER_PROCESS_FUCHSIA,
  18. BROWSER_PROCESS_LACROS,
  19. SESSION_RESTORE,
  20. // c/b/background
  21. BACKGROUND_MODE_MANAGER,
  22. BACKGROUND_MODE_MANAGER_STARTUP,
  23. BACKGROUND_MODE_MANAGER_FORCE_INSTALLED_EXTENSIONS,
  24. // c/b/background_sync
  25. BACKGROUND_SYNC,
  26. // c/b/browsing_data
  27. BROWSING_DATA_LIFETIME_MANAGER,
  28. // c/b/chromeos
  29. LOGIN_DISPLAY_HOST_WEBUI,
  30. PIN_MIGRATION,
  31. // c/b/devtools
  32. REMOTE_DEBUGGING,
  33. DEVTOOLS_WINDOW,
  34. // c/b/extensions
  35. NATIVE_MESSAGING_HOST_ERROR_REPORT,
  36. // c/b/notifications
  37. NOTIFICATION,
  38. PENDING_NOTIFICATION_CLICK_EVENT,
  39. PENDING_NOTIFICATION_CLOSE_EVENT,
  40. // c/b/push_messaging
  41. IN_FLIGHT_PUSH_MESSAGE,
  42. // c/b/ui
  43. APP_LIST_SERVICE_VIEWS,
  44. APP_LIST_SHOWER,
  45. CHROME_APP_DELEGATE,
  46. CHROME_VIEWS_DELEGATE,
  47. PANEL,
  48. PANEL_VIEW,
  49. PROFILE_MANAGER,
  50. USER_MANAGER_VIEW,
  51. CREDENTIAL_PROVIDER_SIGNIN_DIALOG,
  52. WEB_APP_INTENT_PICKER,
  53. // c/b/ui/web_applications
  54. WEB_APP_UNINSTALL,
  55. // c/b/web_applications
  56. APP_MANIFEST_UPDATE,
  57. APP_START_URL_MIGRATION,
  58. APP_GET_INFO,
  59. // c/b/sessions
  60. SESSION_DATA_DELETER,
  61. };
  62. // Restart: Allow Chrome to restart when all the registered KeepAlives allow
  63. // restarts
  64. enum class KeepAliveRestartOption { DISABLED, ENABLED };
  65. std::ostream& operator<<(std::ostream& out, const KeepAliveOrigin& origin);
  66. std::ostream& operator<<(std::ostream& out,
  67. const KeepAliveRestartOption& restart);
  68. #endif // COMPONENTS_KEEP_ALIVE_REGISTRY_KEEP_ALIVE_TYPES_H_