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

            *ptr = new cef_domvisitor_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
Beispiel #3
0
        private void visit(cef_domvisitor_t* self, cef_domdocument_t* document)
        {
            CheckSelf(self);

            var m_document = CefDomDocument.FromNative(document);

            Visit(m_document);

            m_document.Dispose();
        }
Beispiel #4
0
 private void add_ref(cef_domvisitor_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
Beispiel #5
0
 private int release(cef_domvisitor_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return 1;
         }
         return 0;
     }
 }
Beispiel #6
0
 private int get_refct(cef_domvisitor_t* self)
 {
     return _refct;
 }
Beispiel #7
0
 private void CheckSelf(cef_domvisitor_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Beispiel #8
0
 public static void visit_dom(cef_frame_t* self, cef_domvisitor_t* visitor)
 {
     visit_dom_delegate d;
     var p = self->_visit_dom;
     if (p == _p1a) { d = _d1a; }
     else
     {
         d = (visit_dom_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(visit_dom_delegate));
         if (_p1a == IntPtr.Zero) { _d1a = d; _p1a = p; }
     }
     d(self, visitor);
 }
Beispiel #9
0
 internal static void Free(cef_domvisitor_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Beispiel #10
0
 private int has_one_ref(cef_domvisitor_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }