private void CheckSelf(cef_register_cdm_callback_t *self)
 {
     if (_self != self)
     {
         throw ExceptionBuilder.InvalidSelfReference();
     }
 }
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_register_cdm_callback_t.Free(_self);
         _self = null;
     }
 }
Ejemplo n.º 3
0
        // void (*)(_cef_register_cdm_callback_t* self, cef_cdm_registration_error_t result, const cef_string_t* error_message)*
        private static unsafe void OnCDMRegistrationCompleteImpl(cef_register_cdm_callback_t *self, CefCDMRegistrationError result, cef_string_t *error_message)
        {
            var instance = GetInstance((IntPtr)self) as CefRegisterCDMCallback;

            if (instance == null || ((ICefRegisterCDMCallbackPrivate)instance).AvoidOnCDMRegistrationComplete())
            {
                return;
            }
            instance.OnCDMRegistrationComplete(result, CefString.Read(error_message));
        }
Ejemplo n.º 4
0
        public CefRegisterCDMCallback()
        {
            cef_register_cdm_callback_t *self = this.NativeInstance;

                        #if NET_LESS_5_0
            self->on_cdm_registration_complete = (void *)Marshal.GetFunctionPointerForDelegate(fnOnCDMRegistrationComplete);
                        #else
            self->on_cdm_registration_complete = (delegate * unmanaged[Stdcall] < cef_register_cdm_callback_t *, CefCDMRegistrationError, cef_string_t *, void >) & OnCDMRegistrationCompleteImpl;
                        #endif
        }
 private void add_ref(cef_register_cdm_callback_t *self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
 private int release(cef_register_cdm_callback_t *self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return(1);
         }
         return(0);
     }
 }
Ejemplo n.º 7
0
        protected CefRegisterCdmCallback()
        {
            _self = cef_register_cdm_callback_t.Alloc();

            _ds0 = new cef_register_cdm_callback_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_register_cdm_callback_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_register_cdm_callback_t.has_one_ref_delegate(has_one_ref);
            _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_register_cdm_callback_t.on_cdm_registration_complete_delegate(on_cdm_registration_complete);
            _self->_on_cdm_registration_complete = Marshal.GetFunctionPointerForDelegate(_ds3);
        }
Ejemplo n.º 8
0
 public static extern void register_widevine_cdm(cef_string_t *path, cef_register_cdm_callback_t *callback);
Ejemplo n.º 9
0
 internal static void Free(cef_register_cdm_callback_t *ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Ejemplo n.º 10
0
 public CefRegisterCDMCallback(cef_register_cdm_callback_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
Ejemplo n.º 11
0
        public CefRegisterCDMCallback()
        {
            cef_register_cdm_callback_t *self = this.NativeInstance;

            self->on_cdm_registration_complete = (void *)Marshal.GetFunctionPointerForDelegate(fnOnCDMRegistrationComplete);
        }
 private int has_at_least_one_ref(cef_register_cdm_callback_t *self)
 {
     lock (SyncRoot) { return(_refct != 0 ? 1 : 0); }
 }
Ejemplo n.º 13
0
 private void on_cdm_registration_complete(cef_register_cdm_callback_t *self, CefCdmRegistrationError result, cef_string_t *error_message)
 {
     CheckSelf(self);
     OnCdmRegistrationComplete(result, cef_string_t.ToString(error_message));
 }