Bug 1415466 - Part1 - Update content_decryption_module.h, there are no changes in the rest of headers. draft
authorJames Cheng <jacheng@mozilla.com>
Wed, 15 Nov 2017 10:33:28 +0800
changeset 697973 23295fe8cf724dbb7e86321c176b23bbd389ff55
parent 697972 dc4a8983892b69e8af2ca948e99945812223dfc7
child 697974 2367777383e80ae5a2dbd174fa3fb51404b031d4
push id89158
push userbmo:jacheng@mozilla.com
push dateWed, 15 Nov 2017 02:58:32 +0000
bugs1415466
milestone59.0a1
Bug 1415466 - Part1 - Update content_decryption_module.h, there are no changes in the rest of headers. MozReview-Commit-ID: HQUpqokQ3Eu
dom/media/gmp/widevine-adapter/content_decryption_module.h
--- a/dom/media/gmp/widevine-adapter/content_decryption_module.h
+++ b/dom/media/gmp/widevine-adapter/content_decryption_module.h
@@ -436,18 +436,19 @@ struct Policy {
 class CDM_CLASS_API FileIO {
  public:
   // Opens the file with |file_name| for read and write.
   // FileIOClient::OnOpenComplete() will be called after the opening
   // operation finishes.
   // - When the file is opened by a CDM instance, it will be classified as "in
   //   use". In this case other CDM instances in the same domain may receive
   //   kInUse status when trying to open it.
-  // - |file_name| must not contain forward slash ('/') or backslash ('\'), and
-  //   must not start with an underscore ('_').
+  // - |file_name| must only contain letters (A-Za-z), digits(0-9), or "._-".
+  //   It must not start with an underscore ('_'), and must be at least 1
+  //   character and no more than 256 characters long.
   virtual void Open(const char* file_name, uint32_t file_name_size) = 0;
 
   // Reads the contents of the file. FileIOClient::OnReadComplete() will be
   // called with the read status. Read() should not be called if a previous
   // Read() or Write() call is still pending; otherwise OnReadComplete() will
   // be called with kInUse.
   virtual void Read() = 0;
 
@@ -794,31 +795,31 @@ class CDM_CLASS_API ContentDecryptionMod
   virtual Status Decrypt(const InputBuffer& encrypted_buffer,
                          DecryptedBlock* decrypted_buffer) = 0;
 
   // Initializes the CDM audio decoder with |audio_decoder_config|. This
   // function must be called before DecryptAndDecodeSamples() is called.
   //
   // Returns kSuccess if the |audio_decoder_config| is supported and the CDM
   // audio decoder is successfully initialized.
-  // Returns kSessionError if |audio_decoder_config| is not supported. The CDM
-  // may still be able to do Decrypt().
+  // Returns kInitializationError if |audio_decoder_config| is not supported.
+  // The CDM may still be able to do Decrypt().
   // Returns kDeferredInitialization if the CDM is not ready to initialize the
   // decoder at this time. Must call Host::OnDeferredInitializationDone() once
   // initialization is complete.
   virtual Status InitializeAudioDecoder(
       const AudioDecoderConfig& audio_decoder_config) = 0;
 
   // Initializes the CDM video decoder with |video_decoder_config|. This
   // function must be called before DecryptAndDecodeFrame() is called.
   //
   // Returns kSuccess if the |video_decoder_config| is supported and the CDM
   // video decoder is successfully initialized.
-  // Returns kSessionError if |video_decoder_config| is not supported. The CDM
-  // may still be able to do Decrypt().
+  // Returns kInitializationError if |video_decoder_config| is not supported.
+  // The CDM may still be able to do Decrypt().
   // Returns kDeferredInitialization if the CDM is not ready to initialize the
   // decoder at this time. Must call Host::OnDeferredInitializationDone() once
   // initialization is complete.
   virtual Status InitializeVideoDecoder(
       const VideoDecoderConfig& video_decoder_config) = 0;
 
   // De-initializes the CDM decoder and sets it to an uninitialized state. The
   // caller can initialize the decoder again after this call to re-initialize
@@ -878,19 +879,26 @@ class CDM_CLASS_API ContentDecryptionMod
   // is a bit mask of OutputProtectionMethods. If |result| is kQueryFailed,
   // then |link_mask| and |output_protection_mask| are undefined and should
   // be ignored.
   virtual void OnQueryOutputProtectionStatus(
       QueryResult result,
       uint32_t link_mask,
       uint32_t output_protection_mask) = 0;
 
-  // Called by the host after a call to Host::RequestStorageId(). If the storage
-  // ID is not available, null/zero will be provided.
-  virtual void OnStorageId(const uint8_t* storage_id,
+  // Called by the host after a call to Host::RequestStorageId(). If the
+  // version of the storage ID requested is available, |storage_id| and
+  // |storage_id_size| are set appropriately. |version| will be the same as
+  // what was requested, unless 0 (latest) was requested, in which case
+  // |version| will be the actual version number for the |storage_id| returned.
+  // If the requested version is not available, null/zero will be provided as
+  // |storage_id| and |storage_id_size|, respectively, and |version| should be
+  // ignored.
+  virtual void OnStorageId(uint32_t version,
+                           const uint8_t* storage_id,
                            uint32_t storage_id_size) = 0;
 
   // Destroys the object in the same context as it was created.
   virtual void Destroy() = 0;
 
  protected:
   ContentDecryptionModule_9() {}
   virtual ~ContentDecryptionModule_9() {}
@@ -1171,21 +1179,24 @@ class CDM_CLASS_API Host_9 {
                                             Status decoder_status) = 0;
 
   // Creates a FileIO object from the host to do file IO operation. Returns NULL
   // if a FileIO object cannot be obtained. Once a valid FileIO object is
   // returned, |client| must be valid until FileIO::Close() is called. The
   // CDM can call this method multiple times to operate on different files.
   virtual FileIO* CreateFileIO(FileIOClient* client) = 0;
 
-  // Requests the storage ID. The ID will be returned by the host via
-  // ContentDecryptionModule::OnStorageId(). A storage ID is a stable, device
-  // specific ID used by the CDM to securely store persistent data. The CDM must
-  // not expose the ID outside the client device, even in encrypted form.
-  virtual void RequestStorageId() = 0;
+  // Requests a specific version of the storage ID. A storage ID is a stable,
+  // device specific ID used by the CDM to securely store persistent data. The
+  // ID will be returned by the host via ContentDecryptionModule::OnStorageId().
+  // If |version| is 0, the latest version will be returned. All |version|s
+  // that are greater than or equal to 0x80000000 are reserved for the CDM and
+  // should not be supported or returned by the host. The CDM must not expose
+  // the ID outside the client device, even in encrypted form.
+  virtual void RequestStorageId(uint32_t version) = 0;
 
  protected:
   Host_9() {}
   virtual ~Host_9() {}
 };
 
 // Represents a decrypted block that has not been decoded.
 class CDM_CLASS_API DecryptedBlock {