private int on_before_popup(cef_life_span_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_string_t* target_url, cef_string_t* target_frame_name, cef_popup_features_t* popupFeatures, cef_window_info_t* windowInfo, cef_client_t** client, cef_browser_settings_t* settings, int* no_javascript_access)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_frame = CefFrame.FromNative(frame);
            var m_targetUrl = cef_string_t.ToString(target_url);
            var m_targetFrameName = cef_string_t.ToString(target_frame_name);
            var m_popupFeatures = new CefPopupFeatures(popupFeatures);
            var m_windowInfo = CefWindowInfo.FromNative(windowInfo);
            var m_client = CefClient.FromNative(*client);
            var m_settings = new CefBrowserSettings(settings);
            var m_noJavascriptAccess = (*no_javascript_access) != 0;

            var o_client = m_client;
            var result = OnBeforePopup(m_browser, m_frame, m_targetUrl, m_targetFrameName, m_popupFeatures, m_windowInfo, ref m_client, m_settings, ref m_noJavascriptAccess);

            if ((object)o_client != m_client && m_client != null)
            {
                *client = m_client.ToNative();
            }

            *no_javascript_access = m_noJavascriptAccess ? 1 : 0;

            m_popupFeatures.Dispose();
            m_windowInfo.Dispose();
            m_settings.Dispose();

            return result ? 1 : 0;
        }
 internal static cef_life_span_handler_t* Alloc()
 {
     var ptr = (cef_life_span_handler_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_life_span_handler_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
        private int run_modal(cef_life_span_handler_t* self, cef_browser_t* browser)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);

            return RunModal(m_browser) ? 1 : 0;
        }
        private void on_after_created(cef_life_span_handler_t* self, cef_browser_t* browser)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);

            OnAfterCreated(m_browser);
        }
        internal static cef_life_span_handler_t *Alloc()
        {
            var ptr = (cef_life_span_handler_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_life_span_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
 private int release(cef_life_span_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
 private int add_ref(cef_life_span_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
 internal static void Free(cef_life_span_handler_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
        private void on_before_close(cef_life_span_handler_t* self, cef_browser_t* browser)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);

            OnBeforeClose(m_browser);
        }
        private int do_close(cef_life_span_handler_t* self, cef_browser_t* browser)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);

            return DoClose(m_browser) ? 1 : 0;
        }
 private int get_refct(cef_life_span_handler_t* self)
 {
     return _refct;
 }
 private void CheckSelf(cef_life_span_handler_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }