Example #1
0
 internal static cef_read_handler_t* Alloc()
 {
     var ptr = (cef_read_handler_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_read_handler_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
Example #2
0
        internal static cef_read_handler_t *Alloc()
        {
            var ptr = (cef_read_handler_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_read_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
Example #3
0
        private UIntPtr read(cef_read_handler_t* self, void* ptr, UIntPtr size, UIntPtr n)
        {
            CheckSelf(self);

            var length = (long)size * (long)n;
            using (var stream = new UnmanagedMemoryStream((byte*)ptr, length, length, FileAccess.Write))
            {
                return (UIntPtr)Read(stream, length);
            }
        }
Example #4
0
 private void add_ref(cef_read_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
 private int release(cef_read_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
Example #6
0
        private long tell(cef_read_handler_t* self)
        {
            CheckSelf(self);

            return Tell();
        }
Example #7
0
        private int seek(cef_read_handler_t* self, long offset, int whence)
        {
            CheckSelf(self);

            return Seek(offset, (SeekOrigin)whence) ? 0 : -1;
        }
Example #8
0
        private int may_block(cef_read_handler_t* self)
        {
            CheckSelf(self);

            return MayBlock() ? 1 : 0;
        }
Example #9
0
        private int eof(cef_read_handler_t* self)
        {
            CheckSelf(self);

            return Eof() ? 1 : 0;
        }
Example #10
0
 internal static void Free(cef_read_handler_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Example #11
0
 private int get_refct(cef_read_handler_t* self)
 {
     return _refct;
 }
Example #12
0
 private void CheckSelf(cef_read_handler_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Example #13
0
 public static extern cef_stream_reader_t* create_for_handler(cef_read_handler_t* handler);
Example #14
0
 private int has_one_ref(cef_read_handler_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }