Ejemplo n.º 1
0
        private void get_response_headers(cef_resource_handler_t* self, cef_response_t* response, long* response_length, cef_string_t* redirectUrl)
        {
            CheckSelf(self);

            var m_response = CefResponse.FromNative(response);
            long m_responseLength;
            string m_redirectUrl;

            GetResponseHeaders(m_response, out m_responseLength, out m_redirectUrl);

            *response_length = m_responseLength;

            if (!string.IsNullOrEmpty(m_redirectUrl))
            {
                cef_string_t.Copy(m_redirectUrl, redirectUrl);
            }
        }
Ejemplo n.º 2
0
 internal static CefResponse FromNativeOrNull(cef_response_t* ptr)
 {
     if (ptr == null) return null;
     return new CefResponse(ptr);
 }
Ejemplo n.º 3
0
 private CefResponse(cef_response_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
Ejemplo n.º 4
0
 public static void set_header_map(cef_response_t* self, cef_string_multimap* headerMap)
 {
     set_header_map_delegate d;
     var p = self->_set_header_map;
     if (p == _pc) { d = _dc; }
     else
     {
         d = (set_header_map_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_header_map_delegate));
         if (_pc == IntPtr.Zero) { _dc = d; _pc = p; }
     }
     d(self, headerMap);
 }
Ejemplo n.º 5
0
 internal static CefResponse FromNative(cef_response_t* ptr)
 {
     return new CefResponse(ptr);
 }
Ejemplo n.º 6
0
 public static void set_mime_type(cef_response_t* self, cef_string_t* mimeType)
 {
     set_mime_type_delegate d;
     var p = self->_set_mime_type;
     if (p == _p9) { d = _d9; }
     else
     {
         d = (set_mime_type_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_mime_type_delegate));
         if (_p9 == IntPtr.Zero) { _d9 = d; _p9 = p; }
     }
     d(self, mimeType);
 }
Ejemplo n.º 7
0
 public static cef_string_userfree* get_header(cef_response_t* self, cef_string_t* name)
 {
     get_header_delegate d;
     var p = self->_get_header;
     if (p == _pa) { d = _da; }
     else
     {
         d = (get_header_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_header_delegate));
         if (_pa == IntPtr.Zero) { _da = d; _pa = p; }
     }
     return d(self, name);
 }
Ejemplo n.º 8
0
 public static void set_status_text(cef_response_t* self, cef_string_t* statusText)
 {
     set_status_text_delegate d;
     var p = self->_set_status_text;
     if (p == _p7) { d = _d7; }
     else
     {
         d = (set_status_text_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_status_text_delegate));
         if (_p7 == IntPtr.Zero) { _d7 = d; _p7 = p; }
     }
     d(self, statusText);
 }
Ejemplo n.º 9
0
 public static cef_string_userfree* get_mime_type(cef_response_t* self)
 {
     get_mime_type_delegate d;
     var p = self->_get_mime_type;
     if (p == _p8) { d = _d8; }
     else
     {
         d = (get_mime_type_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_mime_type_delegate));
         if (_p8 == IntPtr.Zero) { _d8 = d; _p8 = p; }
     }
     return d(self);
 }
Ejemplo n.º 10
0
 public static void set_status(cef_response_t* self, int status)
 {
     set_status_delegate d;
     var p = self->_set_status;
     if (p == _p5) { d = _d5; }
     else
     {
         d = (set_status_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_status_delegate));
         if (_p5 == IntPtr.Zero) { _d5 = d; _p5 = p; }
     }
     d(self, status);
 }
Ejemplo n.º 11
0
 public static cef_string_userfree* get_status_text(cef_response_t* self)
 {
     get_status_text_delegate d;
     var p = self->_get_status_text;
     if (p == _p6) { d = _d6; }
     else
     {
         d = (get_status_text_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_status_text_delegate));
         if (_p6 == IntPtr.Zero) { _d6 = d; _p6 = p; }
     }
     return d(self);
 }
Ejemplo n.º 12
0
 public static int get_status(cef_response_t* self)
 {
     get_status_delegate d;
     var p = self->_get_status;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (get_status_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_status_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     return d(self);
 }
Ejemplo n.º 13
0
 public static int is_read_only(cef_response_t* self)
 {
     is_read_only_delegate d;
     var p = self->_is_read_only;
     if (p == _p3) { d = _d3; }
     else
     {
         d = (is_read_only_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_read_only_delegate));
         if (_p3 == IntPtr.Zero) { _d3 = d; _p3 = p; }
     }
     return d(self);
 }
Ejemplo n.º 14
0
 public static int has_one_ref(cef_response_t* self)
 {
     has_one_ref_delegate d;
     var p = self->_base._has_one_ref;
     if (p == _p2) { d = _d2; }
     else
     {
         d = (has_one_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(has_one_ref_delegate));
         if (_p2 == IntPtr.Zero) { _d2 = d; _p2 = p; }
     }
     return d(self);
 }
Ejemplo n.º 15
0
 public static int release(cef_response_t* self)
 {
     release_delegate d;
     var p = self->_base._release;
     if (p == _p1) { d = _d1; }
     else
     {
         d = (release_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(release_delegate));
         if (_p1 == IntPtr.Zero) { _d1 = d; _p1 = p; }
     }
     return d(self);
 }
Ejemplo n.º 16
0
 public static void add_ref(cef_response_t* self)
 {
     add_ref_delegate d;
     var p = self->_base._add_ref;
     if (p == _p0) { d = _d0; }
     else
     {
         d = (add_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_ref_delegate));
         if (_p0 == IntPtr.Zero) { _d0 = d; _p0 = p; }
     }
     d(self);
 }