service_access_type.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2015 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_KEYED_SERVICE_CORE_SERVICE_ACCESS_TYPE_H_
  5. #define COMPONENTS_KEYED_SERVICE_CORE_SERVICE_ACCESS_TYPE_H_
  6. // Some KeyedServices are accessed with the following parameter. This parameter
  7. // defines what the caller plans to do with the service.
  8. //
  9. // The caller is responsible for not performing any operation that would
  10. // result in persistent implicit records while using an OffTheRecord context.
  11. // This flag allows the context to perform an additional check.
  12. //
  13. // It also leaves an opportunity to perform further checks in the future. For
  14. // example an history service that only allow some specific methods could be
  15. // returned.
  16. enum class ServiceAccessType {
  17. // The caller plans to perform a read or write that takes place as a result
  18. // of the user input. Use this flag when the operation can be performed while
  19. // incognito (for example creating a bookmark).
  20. //
  21. // Since EXPLICIT_ACCESS means "as a result of a user action", this request
  22. // always succeeds.
  23. EXPLICIT_ACCESS,
  24. // The caller plans to call a method that will permanently change some data
  25. // in the context, as part of Chrome's implicit data logging. Use this flag
  26. // before performing an operation which is incompatible with the incognito
  27. // mode.
  28. IMPLICIT_ACCESS
  29. };
  30. #endif // COMPONENTS_KEYED_SERVICE_CORE_SERVICE_ACCESS_TYPE_H_