tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PRemoteCDM.ipdl (3355B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3  * License, v. 2.0. If a copy of the MPL was not distributed with this
      4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 include "mozilla/dom/MediaIPCUtils.h";
      7 
      8 include protocol PRemoteMediaManager;
      9 
     10 using mozilla::CDMKeyInfo from "mozilla/CDMProxy.h";
     11 using mozilla::MediaResult from "MediaResult.h";
     12 using mozilla::dom::MediaKeyMessageType from "mozilla/dom/MediaKeyMessageEventBinding.h";
     13 using mozilla::dom::MediaKeySessionType from "mozilla/dom/MediaKeysBinding.h";
     14 using mozilla::dom::MediaKeyStatus from "mozilla/dom/MediaKeyStatusMapBinding.h";
     15 [RefCounted] using class mozilla::ArrayOfRemoteMediaRawData from "mozilla/RemoteMediaData.h";
     16 [RefCounted] using class mozilla::ArrayOfRemoteAudioData from "mozilla/RemoteMediaData.h";
     17 [RefCounted] using class mozilla::ArrayOfRemoteVideoData from "mozilla/RemoteMediaData.h";
     18 
     19 namespace mozilla {
     20 
     21 // For EME spec 'message' event
     22 // https://w3c.github.io/encrypted-media/#queue-message
     23 struct RemoteCDMKeyMessageIPDL
     24 {
     25   nsString sessionId;
     26   MediaKeyMessageType type;
     27   uint8_t[] message;
     28 };
     29 
     30 // For EME spec 'keystatuseschange' event
     31 // https://w3c.github.io/encrypted-media/#dom-evt-keystatuseschange
     32 struct RemoteCDMKeyStatusIPDL
     33 {
     34   nsString sessionId;
     35   CDMKeyInfo[] keyInfo;
     36 };
     37 
     38 // For EME spec Update Expiration algorithm
     39 // https://w3c.github.io/encrypted-media/#update-expiration
     40 struct RemoteCDMKeyExpirationIPDL
     41 {
     42   nsString sessionId;
     43   double expiredTimeMilliSecondsSinceEpoch;
     44 };
     45 
     46 struct RemoteCDMInitRequestIPDL
     47 {
     48   bool allowDistinctiveIdentifier;
     49   bool allowPersistentState;
     50 };
     51 
     52 struct RemoteCDMCreateSessionRequestIPDL
     53 {
     54   MediaKeySessionType sessionType;
     55   nsString initDataType;
     56   uint8_t[] initData;
     57 };
     58 
     59 struct RemoteCDMLoadSessionRequestIPDL
     60 {
     61   MediaKeySessionType sessionType;
     62   nsString sessionId;
     63 };
     64 
     65 struct RemoteCDMUpdateSessionRequestIPDL
     66 {
     67   nsString sessionId;
     68   uint8_t[] response;
     69 };
     70 
     71 union RemoteCDMSessionResponseIPDL
     72 {
     73   MediaResult;
     74   RemoteCDMKeyMessageIPDL;
     75 };
     76 
     77 struct RemoteCDMProvisionRequestIPDL
     78 {
     79   nsString serverUrl;
     80   uint8_t[] request;
     81 };
     82 
     83 union RemoteCDMProvisionResponseIPDL
     84 {
     85   MediaResult;
     86   uint8_t[];
     87 };
     88 
     89 // This protocol provides a way to use CDMProxy across processes.
     90 async protocol PRemoteCDM
     91 {
     92   manager PRemoteMediaManager;
     93 parent:
     94   async Init(RemoteCDMInitRequestIPDL request) returns (MediaResult result);
     95   async CreateSession(RemoteCDMCreateSessionRequestIPDL request) returns (RemoteCDMSessionResponseIPDL result);
     96   async LoadSession(RemoteCDMLoadSessionRequestIPDL request) returns (MediaResult result);
     97   async UpdateSession(RemoteCDMUpdateSessionRequestIPDL request) returns (MediaResult result);
     98   async RemoveSession(nsString sessionId) returns (MediaResult result);
     99   async CloseSession(nsString sessionId) returns (MediaResult result);
    100   async SetServerCertificate(uint8_t[] certificate) returns (MediaResult result);
    101 
    102   async __delete__();
    103 
    104 child:
    105   async Provision(RemoteCDMProvisionRequestIPDL request) returns (RemoteCDMProvisionResponseIPDL response);
    106   async OnSessionKeyStatus(RemoteCDMKeyStatusIPDL msg);
    107   async OnSessionKeyExpiration(RemoteCDMKeyExpirationIPDL msg);
    108   async OnSessionKeyMessage(RemoteCDMKeyMessageIPDL msg);
    109 };
    110 
    111 } // namespace mozilla