private void CheckSelf(cef_string_visitor_t *self)
 {
     if (_self != self)
     {
         throw ExceptionBuilder.InvalidSelfReference();
     }
 }
Exemple #2
0
 public unsafe void GetText(cef_string_visitor_t *visitor)
 {
     fixed(cef_frame_t *self = &this)
     {
         ((delegate * unmanaged[Stdcall] < cef_frame_t *, cef_string_visitor_t *, void >)get_text)(self, visitor);
     }
 }
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_string_visitor_t.Free(_self);
         _self = null;
     }
 }
Exemple #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_string_visitor_t.Free(_self);
         _self = null;
     }
 }
Exemple #5
0
        public CefStringVisitor()
        {
            cef_string_visitor_t *self = this.NativeInstance;

                        #if NET_LESS_5_0
            self->visit = (void *)Marshal.GetFunctionPointerForDelegate(fnVisit);
                        #else
            self->visit = (delegate * unmanaged[Stdcall] < cef_string_visitor_t *, cef_string_t *, void >) & VisitImpl;
                        #endif
        }
Exemple #6
0
        private static unsafe void VisitImpl(cef_string_visitor_t *self, cef_string_t * @string)
        {
            var instance = GetInstance((IntPtr)self) as CefStringVisitor;

            if (instance == null || ((ICefStringVisitorPrivate)instance).AvoidVisit())
            {
                return;
            }
            instance.Visit(CefString.Read(@string));
        }
 private void add_ref(cef_string_visitor_t *self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
 private int release(cef_string_visitor_t *self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return(result);
     }
 }
Exemple #9
0
 protected CefStringVisitor()
 {
     _self = cef_string_visitor_t.Alloc();
 
     _ds0 = new cef_string_visitor_t.add_ref_delegate(add_ref);
     _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
     _ds1 = new cef_string_visitor_t.release_delegate(release);
     _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
     _ds2 = new cef_string_visitor_t.has_one_ref_delegate(has_one_ref);
     _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
     _ds3 = new cef_string_visitor_t.visit_delegate(visit);
     _self->_visit = Marshal.GetFunctionPointerForDelegate(_ds3);
 }
Exemple #10
0
        protected CefStringVisitor()
        {
            _self = cef_string_visitor_t.Alloc();

            _ds0 = new cef_string_visitor_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_string_visitor_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_string_visitor_t.has_one_ref_delegate(has_one_ref);
            _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3          = new cef_string_visitor_t.visit_delegate(visit);
            _self->_visit = Marshal.GetFunctionPointerForDelegate(_ds3);
        }
        public static void get_text(cef_frame_t *self, cef_string_visitor_t *visitor)
        {
            get_text_delegate d;
            var p = self->_get_text;

            if (p == _pd)
            {
                d = _dd;
            }
            else
            {
                d = (get_text_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_text_delegate));
                if (_pd == IntPtr.Zero)
                {
                    _dd = d; _pd = p;
                }
            }
            d(self, visitor);
        }
Exemple #12
0
 private int has_at_least_one_ref(cef_string_visitor_t *self)
 {
     lock (SyncRoot) { return(_refct != 0 ? 1 : 0); }
 }
Exemple #13
0
 private int has_one_ref(cef_string_visitor_t *self)
 {
     lock (SyncRoot) { return(_refct == 1 ? 1 : 0); }
 }
Exemple #14
0
 /// <summary>
 /// Retrieve this frame's HTML source as a string sent to the specified
 /// visitor.
 /// </summary>
 public void GetSource(cef_string_visitor_t *visitor)
 {
     throw new NotImplementedException(); // TODO: CefFrame.GetSource
 }
Exemple #15
0
        public CefStringVisitor()
        {
            cef_string_visitor_t *self = this.NativeInstance;

            self->visit = (void *)Marshal.GetFunctionPointerForDelegate(fnVisit);
        }
Exemple #16
0
 internal static void Free(cef_string_visitor_t *ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Exemple #17
0
        private void visit(cef_string_visitor_t *self, cef_string_t * @string)
        {
            CheckSelf(self);

            Visit(cef_string_t.ToString(@string));
        }
Exemple #18
0
 public unsafe extern void GetText(cef_string_visitor_t *visitor);
Exemple #19
0
 public unsafe extern void GetSource(cef_string_visitor_t *visitor);
 private int get_refct(cef_string_visitor_t *self)
 {
     return(_refct);
 }
Exemple #21
0
 public CefStringVisitor(cef_string_visitor_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
Exemple #22
0
 private void visit(cef_string_visitor_t *self, cef_string_t * @string)
 {
     CheckSelf(self);
     throw new NotImplementedException(); // TODO: CefStringVisitor.Visit
 }