示例#1
0
        protected CefBrowserProcessHandler()
        {
            _self = cef_browser_process_handler_t.Alloc();

            _ds0 = new cef_browser_process_handler_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_browser_process_handler_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_browser_process_handler_t.has_one_ref_delegate(has_one_ref);
            _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_browser_process_handler_t.has_at_least_one_ref_delegate(has_at_least_one_ref);
            _self->_base._has_at_least_one_ref = Marshal.GetFunctionPointerForDelegate(_ds3);
            _ds4 = new cef_browser_process_handler_t.get_cookieable_schemes_delegate(get_cookieable_schemes);
            _self->_get_cookieable_schemes = Marshal.GetFunctionPointerForDelegate(_ds4);
            _ds5 = new cef_browser_process_handler_t.on_context_initialized_delegate(on_context_initialized);
            _self->_on_context_initialized = Marshal.GetFunctionPointerForDelegate(_ds5);
            _ds6 = new cef_browser_process_handler_t.on_before_child_process_launch_delegate(on_before_child_process_launch);
            _self->_on_before_child_process_launch = Marshal.GetFunctionPointerForDelegate(_ds6);
            _ds7 = new cef_browser_process_handler_t.get_print_handler_delegate(get_print_handler);
            _self->_get_print_handler = Marshal.GetFunctionPointerForDelegate(_ds7);
            _ds8 = new cef_browser_process_handler_t.on_schedule_message_pump_work_delegate(on_schedule_message_pump_work);
            _self->_on_schedule_message_pump_work = Marshal.GetFunctionPointerForDelegate(_ds8);
            _ds9 = new cef_browser_process_handler_t.get_default_client_delegate(get_default_client);
            _self->_get_default_client = Marshal.GetFunctionPointerForDelegate(_ds9);
        }
        private cef_print_handler_t *get_print_handler(cef_browser_process_handler_t *self)
        {
            CheckSelf(self);
            var result = GetPrintHandler();

            return(result != null?result.ToNative() : null);
        }
 private void CheckSelf(cef_browser_process_handler_t *self)
 {
     if (_self != self)
     {
         throw ExceptionBuilder.InvalidSelfReference();
     }
 }
        private cef_client_t *get_default_client(cef_browser_process_handler_t *self)
        {
            CheckSelf(self);

            var m_client = GetDefaultClient();

            return(m_client != null?m_client.ToNative() : null);
        }
示例#5
0
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_browser_process_handler_t.Free(_self);
         _self = null;
     }
 }
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_browser_process_handler_t.Free(_self);
         _self = null;
     }
 }
        public CefBrowserProcessHandler()
        {
            cef_browser_process_handler_t *self = FixedPtr;

            self->on_context_initialized         = holder_on_context_initialized;
            self->on_schedule_message_pump_work  = holder_on_schedule_message_pump_work;
            self->on_before_child_process_launch = holder_on_before_child_process_launch;
        }
        private void on_render_process_thread_created(cef_browser_process_handler_t *self, cef_list_value_t *extra_info)
        {
            CheckSelf(self);

            var mExtraInfo = CefListValue.FromNative(extra_info);

            OnRenderProcessThreadCreated(mExtraInfo);
            mExtraInfo.Dispose();
        }
示例#9
0
        public CefBrowserProcessHandler()
        {
            cef_browser_process_handler_t *self = this.NativeInstance;

            self->on_context_initialized         = (void *)Marshal.GetFunctionPointerForDelegate(fnOnContextInitialized);
            self->on_before_child_process_launch = (void *)Marshal.GetFunctionPointerForDelegate(fnOnBeforeChildProcessLaunch);
            self->get_print_handler             = (void *)Marshal.GetFunctionPointerForDelegate(fnGetPrintHandler);
            self->on_schedule_message_pump_work = (void *)Marshal.GetFunctionPointerForDelegate(fnOnScheduleMessagePumpWork);
        }
        private void on_before_child_process_launch(cef_browser_process_handler_t *self, cef_command_line_t *command_line)
        {
            CheckSelf(self);

            var m_commandLine = CefCommandLine.FromNative(command_line);

            OnBeforeChildProcessLaunch(m_commandLine);
            m_commandLine.Dispose();
        }
示例#11
0
        private static unsafe void OnScheduleMessagePumpWorkImpl(cef_browser_process_handler_t *self, long delay_ms)
        {
            var instance = GetInstance((IntPtr)self) as CefBrowserProcessHandler;

            if (instance == null || ((ICefBrowserProcessHandlerPrivate)instance).AvoidOnScheduleMessagePumpWork())
            {
                return;
            }
            instance.OnScheduleMessagePumpWork(delay_ms);
        }
        // void (*)(_cef_browser_process_handler_t* self)*
        private static unsafe void OnContextInitializedImpl(cef_browser_process_handler_t *self)
        {
            var instance = GetInstance((IntPtr)self) as CefBrowserProcessHandler;

            if (instance == null)
            {
                return;
            }
            instance.OnContextInitialized();
        }
示例#13
0
        private static unsafe void GetCookieableSchemesImpl(cef_browser_process_handler_t *self, cef_string_list_t schemes, int *include_defaults)
        {
            var instance = GetInstance((IntPtr)self) as CefBrowserProcessHandler;

            if (instance == null || ((ICefBrowserProcessHandlerPrivate)instance).AvoidGetCookieableSchemes())
            {
                return;
            }
            instance.GetCookieableSchemes(CefStringList.Wrap(schemes), ref *include_defaults);
        }
 private void add_ref(cef_browser_process_handler_t *self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
        // void (*)(_cef_browser_process_handler_t* self, _cef_command_line_t* command_line)*
        private static unsafe void OnBeforeChildProcessLaunchImpl(cef_browser_process_handler_t *self, cef_command_line_t *command_line)
        {
            var instance = GetInstance((IntPtr)self) as CefBrowserProcessHandler;

            if (instance == null || ((ICefBrowserProcessHandlerPrivate)instance).AvoidOnBeforeChildProcessLaunch())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)command_line);
                return;
            }
            instance.OnBeforeChildProcessLaunch(CefCommandLine.Wrap(CefCommandLine.Create, command_line));
        }
        // void (*)(_cef_browser_process_handler_t* self, _cef_list_value_t* extra_info)*
        private static unsafe void OnRenderProcessThreadCreatedImpl(cef_browser_process_handler_t *self, cef_list_value_t *extra_info)
        {
            var instance = GetInstance((IntPtr)self) as CefBrowserProcessHandler;

            if (instance == null || ((ICefBrowserProcessHandlerPrivate)instance).AvoidOnRenderProcessThreadCreated())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)extra_info);
                return;
            }
            instance.OnRenderProcessThreadCreated(CefListValue.Wrap(CefListValue.Create, extra_info));
        }
示例#17
0
 private int release(cef_browser_process_handler_t *self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return(result);
     }
 }
        private void get_cookieable_schemes(cef_browser_process_handler_t *self, cef_string_list *schemes, int *include_defaults)
        {
            CheckSelf(self);

            var m_schemes         = cef_string_list.ToList(schemes);
            var m_includeDefaults = *include_defaults != 0;

            GetCookieableSchemes(m_schemes, ref m_includeDefaults);

            libcef.string_list_clear(schemes);
            cef_string_list.AppendTo(schemes, m_schemes);

            *include_defaults = m_includeDefaults ? 1 : 0;
        }
示例#19
0
        public CefBrowserProcessHandler()
        {
            cef_browser_process_handler_t *self = this.NativeInstance;

                        #if NET_LESS_5_0
            self->on_context_initialized         = (void *)Marshal.GetFunctionPointerForDelegate(fnOnContextInitialized);
            self->on_before_child_process_launch = (void *)Marshal.GetFunctionPointerForDelegate(fnOnBeforeChildProcessLaunch);
            self->on_schedule_message_pump_work  = (void *)Marshal.GetFunctionPointerForDelegate(fnOnScheduleMessagePumpWork);
            self->get_default_client             = (void *)Marshal.GetFunctionPointerForDelegate(fnGetDefaultClient);
                        #else
            self->on_context_initialized         = (delegate * unmanaged[Stdcall] < cef_browser_process_handler_t *, void >) & OnContextInitializedImpl;
            self->on_before_child_process_launch = (delegate * unmanaged[Stdcall] < cef_browser_process_handler_t *, cef_command_line_t *, void >) & OnBeforeChildProcessLaunchImpl;
            self->on_schedule_message_pump_work  = (delegate * unmanaged[Stdcall] < cef_browser_process_handler_t *, long, void >) & OnScheduleMessagePumpWorkImpl;
            self->get_default_client             = (delegate * unmanaged[Stdcall] < cef_browser_process_handler_t *, cef_client_t * >) & GetDefaultClientImpl;
                        #endif
        }
        protected CefBrowserProcessHandler()
        {
            _self = cef_browser_process_handler_t.Alloc();

            _ds0 = new cef_browser_process_handler_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_browser_process_handler_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_browser_process_handler_t.get_refct_delegate(get_refct);
            _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_browser_process_handler_t.on_context_initialized_delegate(on_context_initialized);
            _self->_on_context_initialized = Marshal.GetFunctionPointerForDelegate(_ds3);
            _ds4 = new cef_browser_process_handler_t.on_before_child_process_launch_delegate(on_before_child_process_launch);
            _self->_on_before_child_process_launch = Marshal.GetFunctionPointerForDelegate(_ds4);
            _ds5 = new cef_browser_process_handler_t.on_render_process_thread_created_delegate(on_render_process_thread_created);
            _self->_on_render_process_thread_created = Marshal.GetFunctionPointerForDelegate(_ds5);
        }
示例#21
0
        protected CefBrowserProcessHandler()
        {
            _self = cef_browser_process_handler_t.Alloc();

            _ds0 = new cef_browser_process_handler_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_browser_process_handler_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_browser_process_handler_t.get_refct_delegate(get_refct);
            _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_browser_process_handler_t.on_context_initialized_delegate(on_context_initialized);
            _self->_on_context_initialized = Marshal.GetFunctionPointerForDelegate(_ds3);
            _ds4 = new cef_browser_process_handler_t.on_before_child_process_launch_delegate(on_before_child_process_launch);
            _self->_on_before_child_process_launch = Marshal.GetFunctionPointerForDelegate(_ds4);
            _ds5 = new cef_browser_process_handler_t.on_render_process_thread_created_delegate(on_render_process_thread_created);
            _self->_on_render_process_thread_created = Marshal.GetFunctionPointerForDelegate(_ds5);
        }
 public CefBrowserProcessHandler(cef_browser_process_handler_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
 private void on_schedule_message_pump_work(cef_browser_process_handler_t *self, long delay_ms)
 {
     CheckSelf(self);
     OnScheduleMessagePumpWork(delay_ms);
 }
 private void on_context_initialized(cef_browser_process_handler_t *self)
 {
     CheckSelf(self);
     throw new NotImplementedException(); // TODO: CefBrowserProcessHandler.OnContextInitialized
 }
 internal static void Free(cef_browser_process_handler_t *ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
 private int has_one_ref(cef_browser_process_handler_t *self)
 {
     lock (SyncRoot) { return(_refct == 1 ? 1 : 0); }
 }
        /// <summary>
        /// Called on the browser process UI thread immediately after the CEF context
        /// has been initialized.
        /// </summary>
        // protected abstract void OnContextInitialized();

        private void on_before_child_process_launch(cef_browser_process_handler_t *self, cef_command_line_t *command_line)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefBrowserProcessHandler.OnBeforeChildProcessLaunch
        }
        /// <summary>
        /// Called before a child process is launched. Will be called on the browser
        /// process UI thread when launching a render process and on the browser
        /// process IO thread when launching a GPU or plugin process. Provides an
        /// opportunity to modify the child process command line. Do not keep a
        /// reference to |command_line| outside of this method.
        /// </summary>
        // protected abstract void OnBeforeChildProcessLaunch(cef_command_line_t* command_line);

        private void on_render_process_thread_created(cef_browser_process_handler_t *self, cef_list_value_t *extra_info)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefBrowserProcessHandler.OnRenderProcessThreadCreated
        }
        private void on_context_initialized(cef_browser_process_handler_t *self)
        {
            CheckSelf(self);

            OnContextInitialized();
        }
        /// <summary>
        /// Called on the browser process IO thread after the main thread has been
        /// created for a new render process. Provides an opportunity to specify extra
        /// information that will be passed to
        /// CefRenderProcessHandler::OnRenderThreadCreated() in the render process. Do
        /// not keep a reference to |extra_info| outside of this method.
        /// </summary>
        // protected abstract void OnRenderProcessThreadCreated(cef_list_value_t* extra_info);

        private cef_print_handler_t *get_print_handler(cef_browser_process_handler_t *self)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefBrowserProcessHandler.GetPrintHandler
        }
示例#31
0
 private int get_refct(cef_browser_process_handler_t *self)
 {
     return(_refct);
 }