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); } }
private void CheckSelf(cef_domvisitor_t *self) { if (_self != self) { throw ExceptionBuilder.InvalidSelfReference(); } }
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 { } }
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(); }
/// <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(); }
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 }
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)); }
private void add_ref(cef_domvisitor_t *self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } } }
private int release(cef_domvisitor_t *self) { lock (SyncRoot) { var result = --_refct; if (result == 0) { lock (_roots) { _roots.Remove((IntPtr)_self); } } return(result); } }
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); }
internal static void Free(cef_domvisitor_t *ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
public CefDOMVisitor(cef_domvisitor_t *instance) : base((cef_base_ref_counted_t *)instance) { }
private int has_at_least_one_ref(cef_domvisitor_t *self) { lock (SyncRoot) { return(_refct != 0 ? 1 : 0); } }
private int get_refct(cef_domvisitor_t *self) { return(_refct); }
public unsafe extern void VisitDOM(cef_domvisitor_t *visitor);
public CefDOMVisitor() { cef_domvisitor_t *self = this.NativeInstance; self->visit = (void *)Marshal.GetFunctionPointerForDelegate(fnVisit); }
/// <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 }
private int has_one_ref(cef_domvisitor_t *self) { lock (SyncRoot) { return(_refct == 1 ? 1 : 0); } }