예제 #1
0
 public unsafe void VisitDOM(cef_domvisitor_t *visitor)
 {
     fixed(cef_frame_t *self = &this)
     {
         ((delegate * unmanaged[Stdcall] < cef_frame_t *, cef_domvisitor_t *, void >)visit_dom)(self, visitor);
     }
 }
예제 #2
0
 private void CheckSelf(cef_domvisitor_t *self)
 {
     if (_self != self)
     {
         throw ExceptionBuilder.InvalidSelfReference();
     }
 }
예제 #3
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;
                }
            }
            try
            {
                d(self, visitor);
            }
            catch
            {
            }
        }
예제 #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_domvisitor_t.Free(_self);
         _self = null;
     }
 }
예제 #5
0
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_domvisitor_t.Free(_self);
         _self = null;
     }
 }
        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();
        }
예제 #7
0
        /// <summary>
        /// Method executed for visiting the DOM. The document object passed to
        /// this method represents a snapshot of the DOM at the time this method
        /// is executed. DOM objects are only valid for the scope of this method.
        /// Do not keep references to or attempt to access any DOM objects
        /// outside the scope of this method.
        /// </summary>
        private void visit(cef_domvisitor_t *self, cef_domdocument_t *document)
        {
            ThrowIfObjectDisposed();

            var m_document = CefDomDocument.From(document);

            this.Visit(m_document);

            m_document.Dispose();
        }
예제 #8
0
        public CefDOMVisitor()
        {
            cef_domvisitor_t *self = this.NativeInstance;

                        #if NET_LESS_5_0
            self->visit = (void *)Marshal.GetFunctionPointerForDelegate(fnVisit);
                        #else
            self->visit = (delegate * unmanaged[Stdcall] < cef_domvisitor_t *, cef_domdocument_t *, void >) & VisitImpl;
                        #endif
        }
예제 #9
0
        private static unsafe void VisitImpl(cef_domvisitor_t *self, cef_domdocument_t *document)
        {
            var instance = GetInstance((IntPtr)self) as CefDOMVisitor;

            if (instance == null || ((ICefDOMVisitorPrivate)instance).AvoidVisit())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)document);
                return;
            }
            instance.Visit(CefDOMDocument.Wrap(CefDOMDocument.Create, document));
        }
예제 #10
0
 private void add_ref(cef_domvisitor_t *self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
예제 #11
0
 private int release(cef_domvisitor_t *self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return(result);
     }
 }
예제 #12
0
        protected CefDomVisitor()
        {
            _self = cef_domvisitor_t.Alloc();

            _ds0 = new cef_domvisitor_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_domvisitor_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_domvisitor_t.get_refct_delegate(get_refct);
            _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3          = new cef_domvisitor_t.visit_delegate(visit);
            _self->_visit = Marshal.GetFunctionPointerForDelegate(_ds3);
        }
예제 #13
0
        protected CefDomVisitor()
        {
            _self = cef_domvisitor_t.Alloc();

            _ds0 = new cef_domvisitor_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_domvisitor_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_domvisitor_t.get_refct_delegate(get_refct);
            _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_domvisitor_t.visit_delegate(visit);
            _self->_visit = Marshal.GetFunctionPointerForDelegate(_ds3);
        }
예제 #14
0
 internal static void Free(cef_domvisitor_t *ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
예제 #15
0
 public CefDOMVisitor(cef_domvisitor_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
예제 #16
0
 private int has_at_least_one_ref(cef_domvisitor_t *self)
 {
     lock (SyncRoot) { return(_refct != 0 ? 1 : 0); }
 }
예제 #17
0
 private int get_refct(cef_domvisitor_t *self)
 {
     return(_refct);
 }
예제 #18
0
 public unsafe extern void VisitDOM(cef_domvisitor_t *visitor);
예제 #19
0
        public CefDOMVisitor()
        {
            cef_domvisitor_t *self = this.NativeInstance;

            self->visit = (void *)Marshal.GetFunctionPointerForDelegate(fnVisit);
        }
예제 #20
0
 /// <summary>
 /// Visit the DOM document. This method can only be called from the render
 /// process.
 /// </summary>
 public void VisitDOM(cef_domvisitor_t *visitor)
 {
     throw new NotImplementedException(); // TODO: CefFrame.VisitDOM
 }
 private void visit(cef_domvisitor_t *self, cef_domdocument_t *document)
 {
     CheckSelf(self);
     throw new NotImplementedException(); // TODO: CefDomVisitor.Visit
 }
예제 #22
0
 private int has_one_ref(cef_domvisitor_t *self)
 {
     lock (SyncRoot) { return(_refct == 1 ? 1 : 0); }
 }