content_protection.mojom 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2021 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. module crosapi.mojom;
  5. // Status returned by a successful call to QueryWindowStatus.
  6. [Stable]
  7. struct ContentProtectionWindowStatus {
  8. // The type of connected output links, which is a bit-mask of the LinkType
  9. // values.
  10. uint32 link_mask@0;
  11. // The type of enabled protections, which is a bit-mask of the ProtectionType
  12. // values.
  13. uint32 protection_mask@1;
  14. };
  15. // Returned by a successful call to ChallengePlatform. The structure mirrors the
  16. // CdmDocumentService interface to avoid unnecessary conversions.
  17. [Stable]
  18. struct ChallengePlatformResult {
  19. // The data signed by the platform.
  20. string signed_data;
  21. // The signature of the signed data block.
  22. string signed_data_signature;
  23. // The device specific certificate for the requested service.
  24. string platform_key_certificate;
  25. };
  26. // This interface is implemented by Ash-Chrome.
  27. // This allows Lacros to support content protection.
  28. //
  29. // The bitfields in this struct use [Stable] enums defined in
  30. // media/mojo/mojom/output_protection.mojom.
  31. // The input parameter |window_id| should be obtained from
  32. // PlatformWindow::GetWindowUniqueId(). A typical format might be:
  33. // "org.chromium.lacros.9A82A161B2A0B9BADF75E9BB958B9FCB"
  34. //
  35. // Note that the Window abstraction, and its corresponding |window_id| are
  36. // communicated over Wayland IPC. There's no synchronization between Wayland and
  37. // Crosapi, so it's technically possible for Lacros to create a window, and
  38. // then call one of these methods, but for Ash to not yet know about the
  39. // |window_id|. As such, a failure in one of these methods is not considered
  40. // irrecoverable -- it's possible that calling the method again at a later point
  41. // in time will result in success.
  42. [Stable, Uuid="e3020766-dd9b-4cfe-b387-8ed677212b50"]
  43. interface ContentProtection {
  44. // Returns content-protection related status for a window. Returns null on
  45. // failure.
  46. QueryWindowStatus@0(string window_id) =>
  47. (ContentProtectionWindowStatus? status);
  48. // Enables content protection for a window.
  49. // - desired_protection_mask: The desired protection methods, which
  50. // is a bit-mask of the ProtectionType values.
  51. // - success: True when the protection request has been made. This may be
  52. // before the protection have actually been applied. Call
  53. // QueryWindowStatus() to get protection status. False if it failed to make
  54. // the protection request, and in this case there is no need to call
  55. // QueryStatus().
  56. EnableWindowProtection@1(string window_id, uint32 desired_protection_mask) =>
  57. (bool success);
  58. // Returns the system hash in hex encoded ascii. This may return an empty
  59. // string on error.
  60. // This intentionally mirrors the existing SystemSaltGetter API to avoid
  61. // unnecessary conversions on both sides of the crosapi interface.
  62. [MinVersion=1]
  63. GetSystemSalt@2() => (string salt);
  64. // Allows authorized services to verify that the underlying platform is
  65. // trusted. An example of a trusted platform is a Chrome OS device in
  66. // verified boot mode. This can be used for protected content playback.
  67. //
  68. // Input parameters:
  69. // - |service_id|: the service ID for the |challenge|.
  70. // - |challenge|: the challenge data.
  71. // The input parameters mirror the CdmDocumentService interface to avoid
  72. // unnecessary conversions.
  73. // Returns null on failure.
  74. [MinVersion=2]
  75. ChallengePlatform@3(string service_id, string challenge) =>
  76. (ChallengePlatformResult? result);
  77. // Returns true if Verified Access is enabled in settings, false otherwise.
  78. [MinVersion=3]
  79. IsVerifiedAccessEnabled@4() => (bool enabled);
  80. };