Ejemplo n.º 1
0
        private int get(cef_v8accessor_t* self, cef_string_t* name, cef_v8value_t* @object, cef_v8value_t** retval, cef_string_t* exception)
        {
            CheckSelf(self);

            var m_name = cef_string_t.ToString(name);
            var m_obj = CefV8Value.FromNative(@object);
            CefV8Value m_returnValue;
            string mException;

            var handled = Get(m_name, m_obj, out m_returnValue, out mException);

            if (handled)
            {
                if (mException != null)
                {
                    cef_string_t.Copy(mException, exception);
                }
                else if (m_returnValue != null)
                {
                    *retval = m_returnValue.ToNative();
                }
            }

            return handled ? 1 : 0;
        }
 internal static cef_v8accessor_t* Alloc()
 {
     var ptr = (cef_v8accessor_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_v8accessor_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
Ejemplo n.º 3
0
        internal static cef_v8accessor_t *Alloc()
        {
            var ptr = (cef_v8accessor_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_v8accessor_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
Ejemplo n.º 4
0
 private int release(cef_v8accessor_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
Ejemplo n.º 5
0
 private int add_ref(cef_v8accessor_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
Ejemplo n.º 6
0
        private int set(cef_v8accessor_t* self, cef_string_t* name, cef_v8value_t* @object, cef_v8value_t* value, cef_string_t* exception)
        {
            CheckSelf(self);

            var m_name = cef_string_t.ToString(name);
            var m_obj = CefV8Value.FromNative(@object);
            var m_value = CefV8Value.FromNative(value);
            string mException;

            var handled = this.Set(m_name, m_obj, m_value, out mException);

            if (handled)
            {
                if (mException != null)
                {
                    cef_string_t.Copy(mException, exception);
                }
            }

            return handled ? 1 : 0;
        }
Ejemplo n.º 7
0
 public static extern cef_v8value_t* create_object(cef_v8accessor_t* accessor);
Ejemplo n.º 8
0
 private void CheckSelf(cef_v8accessor_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Ejemplo n.º 9
0
 private int get_refct(cef_v8accessor_t* self)
 {
     return _refct;
 }
Ejemplo n.º 10
0
 internal static void Free(cef_v8accessor_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }