servo: Merge #4102 - ports/cef: Use the CEF translator tool to generate the full set of CEF bindings (from pcwalton:cef-autogeneration); r=larsbergstrom
authorPatrick Walton <pcwalton@mimiga.net>
Thu, 27 Nov 2014 23:18:44 -0700
changeset 381979 57aeb4d1e4843bf9764503abfc660a31324c78a7
parent 381978 57cfeb9f66a556d72b69f5ebc85ba0d9aecbc5ee
child 381980 32bdae7528f1825bf9762b21cba9ad690d381788
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslarsbergstrom
servo: Merge #4102 - ports/cef: Use the CEF translator tool to generate the full set of CEF bindings (from pcwalton:cef-autogeneration); r=larsbergstrom This replaces hand-implemented CEF bindings with proper Rust wrappers automatically generated from the C++ headers. This means that, whenever CEF's C++ headers change, we can easily generate both the appropriate C API and the appropriate Rust API. It eliminates much of the hand-written unsafe code within the CEF port, because the CEF translator tool now knows how to generate Rust smart pointer wrappers for each class that corrently perform reference counting. Additionally, this commit adds utility macros (located in `macros.rs`) that make it easier to correctly expose Rust objects as CEF objects. They handle the marshaling of objects between Rust and CEF properly. The net result of this is that you can write mostly-natural-looking Rust in the CEF port and interact with it with a natural-looking C++ API on the embedding side. This setup relies on the branch of CEF located here: https://github.com/pcwalton/chromium-embedded-framework To regenerate, follow the instructions in `ports/cef/README.md`. For convenience, and because I don't anticipate the API to change much, I have vendored in all of the appropriate interfaces. r? @zmike or @larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: 02c2f53ccd8b75ff0b87edfce4f2f9315a6417bd
servo/ports/cef/README.md
servo/ports/cef/browser.rs
servo/ports/cef/command_line.rs
servo/ports/cef/cookie.rs
servo/ports/cef/core.rs
servo/ports/cef/drag_data.rs
servo/ports/cef/eutil.rs
servo/ports/cef/interfaces/cef_app.rs
servo/ports/cef/interfaces/cef_auth_callback.rs
servo/ports/cef/interfaces/cef_browser.rs
servo/ports/cef/interfaces/cef_browser_process_handler.rs
servo/ports/cef/interfaces/cef_callback.rs
servo/ports/cef/interfaces/cef_client.rs
servo/ports/cef/interfaces/cef_command_line.rs
servo/ports/cef/interfaces/cef_context_menu_handler.rs
servo/ports/cef/interfaces/cef_cookie.rs
servo/ports/cef/interfaces/cef_dialog_handler.rs
servo/ports/cef/interfaces/cef_display_handler.rs
servo/ports/cef/interfaces/cef_dom.rs
servo/ports/cef/interfaces/cef_download_handler.rs
servo/ports/cef/interfaces/cef_download_item.rs
servo/ports/cef/interfaces/cef_drag_data.rs
servo/ports/cef/interfaces/cef_drag_handler.rs
servo/ports/cef/interfaces/cef_focus_handler.rs
servo/ports/cef/interfaces/cef_frame.rs
servo/ports/cef/interfaces/cef_geolocation.rs
servo/ports/cef/interfaces/cef_geolocation_handler.rs
servo/ports/cef/interfaces/cef_jsdialog_handler.rs
servo/ports/cef/interfaces/cef_keyboard_handler.rs
servo/ports/cef/interfaces/cef_life_span_handler.rs
servo/ports/cef/interfaces/cef_load_handler.rs
servo/ports/cef/interfaces/cef_menu_model.rs
servo/ports/cef/interfaces/cef_origin_whitelist.rs
servo/ports/cef/interfaces/cef_path_util.rs
servo/ports/cef/interfaces/cef_print_handler.rs
servo/ports/cef/interfaces/cef_print_settings.rs
servo/ports/cef/interfaces/cef_process_message.rs
servo/ports/cef/interfaces/cef_process_util.rs
servo/ports/cef/interfaces/cef_render_handler.rs
servo/ports/cef/interfaces/cef_render_process_handler.rs
servo/ports/cef/interfaces/cef_request.rs
servo/ports/cef/interfaces/cef_request_context.rs
servo/ports/cef/interfaces/cef_request_context_handler.rs
servo/ports/cef/interfaces/cef_request_handler.rs
servo/ports/cef/interfaces/cef_resource_bundle_handler.rs
servo/ports/cef/interfaces/cef_resource_handler.rs
servo/ports/cef/interfaces/cef_response.rs
servo/ports/cef/interfaces/cef_scheme.rs
servo/ports/cef/interfaces/cef_stream.rs
servo/ports/cef/interfaces/cef_string_visitor.rs
servo/ports/cef/interfaces/cef_task.rs
servo/ports/cef/interfaces/cef_trace.rs
servo/ports/cef/interfaces/cef_url.rs
servo/ports/cef/interfaces/cef_urlrequest.rs
servo/ports/cef/interfaces/cef_v8.rs
servo/ports/cef/interfaces/cef_values.rs
servo/ports/cef/interfaces/cef_web_plugin.rs
servo/ports/cef/interfaces/cef_xml_reader.rs
servo/ports/cef/interfaces/cef_zip_reader.rs
servo/ports/cef/interfaces/mod.rs
servo/ports/cef/lib.rs
servo/ports/cef/macros.rs
servo/ports/cef/mem.rs
servo/ports/cef/print_settings.rs
servo/ports/cef/process_message.rs
servo/ports/cef/request.rs
servo/ports/cef/request_context.rs
servo/ports/cef/response.rs
servo/ports/cef/stream.rs
servo/ports/cef/string.rs
servo/ports/cef/string_list.rs
servo/ports/cef/string_map.rs
servo/ports/cef/string_multimap.rs
servo/ports/cef/stubs.rs
servo/ports/cef/task.rs
servo/ports/cef/types.rs
servo/ports/cef/urlrequest.rs
servo/ports/cef/v8.rs
servo/ports/cef/values.rs
servo/ports/cef/wrappers.rs
servo/ports/cef/xml_reader.rs
servo/ports/cef/zip_reader.rs
--- a/servo/ports/cef/README.md
+++ b/servo/ports/cef/README.md
@@ -5,8 +5,17 @@ 2. Unpack the (huge) archive
 3. Create both Debug and Release build types for CEF (```./build.sh [Debug|Release]```)
 4. Build servo
 5. Run a CEF-based executable with the embedding crate preloaded:
 	* Linux: ```LD_LIBRARY_PATH=/path/to/cef-bin-unpack-dir/out/$build_type LD_PRELOAD=/path/to/servo/build/libembedding-*.so [CEF EXE]```
 6. Enjoy CEF-powered crashes
 
 Notes:
 * Running with the Debug build in GDB is EXTREMELY slow on startup. Only use this if you are actively debugging an unimplemented CEF interaction.
+* The contents of `interfaces/`, with the exception of `interfaces/mod.rs` is autogenerated. To
+  regenerate:
+    - Check out the `servo` branch of the following repository:
+      https://github.com/pcwalton/chromium-embedded-framework
+    - Change to the `tools` directory and run `./translator.sh`
+    - Run the following command to copy in the Rust header files, replacing `${SERVO_SRC}` with
+      the path to your Servo checkout:
+      $ cp ../libcef_dll/rust/*.rs ${SERVO_SRC}/ports/cef/interfaces/
+
--- a/servo/ports/cef/browser.rs
+++ b/servo/ports/cef/browser.rs
@@ -1,96 +1,104 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-use compositing::windowing::{WindowMethods};
+use interfaces::{CefBrowser, CefClient, CefRequestContext, cef_browser_t, cef_client_t};
+use interfaces::{cef_request_context_t};
+use types::{cef_browser_settings_t, cef_string_t, cef_window_info_t};
+
+use eutil::Downcast;
 use glfw_app;
-use libc::{calloc, size_t,c_int};
+use libc::c_int;
 use servo::Browser;
 use servo_util::opts;
-use std::cell::RefCell;
-use std::mem;
+use std::cell::{Cell, RefCell};
 use std::rc::Rc;
-use std::string;
-use types::{cef_browser_settings_t, cef_browser_t, cef_client_t, cef_request_context_t, cef_string_t, cef_window_info_t};
 
-pub type servo_browser_t = servo_browser;
-pub struct servo_browser {
-    pub browser: cef_browser_t,
-    pub client: *mut cef_client_t,
-    pub servo_browser: Option<Browser<glfw_app::window::Window>>,
-    pub window: Rc<glfw_app::window::Window>,
-    pub callback_executed: bool
+pub struct ServoCefBrowser {
+    pub client: CefClient,
+    pub servo_browser: RefCell<Option<Browser<glfw_app::window::Window>>>,
+    pub window: RefCell<Option<Rc<glfw_app::window::Window>>>,
+    pub callback_executed: Cell<bool>,
 }
 
-local_data_key!(pub GLOBAL_BROWSERS: RefCell<Vec<*mut servo_browser_t>>)
-
-pub fn browser_callback_after_created(browser: *mut servo_browser_t) {
-    unsafe {
-        if (*browser).client.is_null() { return; }
-        let client = (*browser).client;
-        (*client).get_life_span_handler.map(|cb| {
-             let handler = cb(client);
-             if handler.is_not_null() {
-                 (*handler).on_after_created.map(|createcb| createcb(handler, browser as *mut cef_browser_t));
-             }
-        });
-        (*browser).callback_executed = true;
+impl ServoCefBrowser {
+    pub fn new(client: CefClient) -> ServoCefBrowser {
+        ServoCefBrowser {
+            client: client,
+            servo_browser: RefCell::new(None),
+            window: RefCell::new(None),
+            callback_executed: Cell::new(false),
+        }
     }
 }
 
-fn browser_host_create(_window_info: *const cef_window_info_t,
-                       client: *mut cef_client_t,
-                       url: *const cef_string_t,
-                       _settings: *const cef_browser_settings_t,
-                       _request_context: *mut cef_request_context_t,
-                       callback_executed: bool)
-                       -> *mut cef_browser_t {
-    unsafe {
-        let mut urls = Vec::new();
-        if url.is_null() || (*url).str.is_null() {
-            urls.push("http://s27.postimg.org/vqbtrolyr/servo.jpg".to_string());
-        } else {
-            urls.push(string::raw::from_buf((*url).str as *const u8));
+cef_class_impl! {
+    ServoCefBrowser : CefBrowser, cef_browser_t {}
+}
+
+local_data_key!(pub GLOBAL_BROWSERS: RefCell<Vec<CefBrowser>>)
+
+pub fn browser_callback_after_created(browser: CefBrowser) {
+    if browser.downcast().client.is_null_cef_object() {
+        return
+    }
+    let client = browser.downcast().client.clone();
+    let life_span_handler = client.get_life_span_handler();
+    if life_span_handler.is_not_null_cef_object() {
+        life_span_handler.on_after_created(browser.clone());
+    }
+    browser.downcast().callback_executed.set(true);
+}
+
+fn browser_host_create(client: CefClient, callback_executed: bool) -> CefBrowser {
+    let mut urls = Vec::new();
+    urls.push("http://s27.postimg.org/vqbtrolyr/servo.jpg".to_string());
+    let mut opts = opts::default_opts();
+    opts.urls = urls;
+    let browser = ServoCefBrowser::new(client).as_cef_interface();
+    if callback_executed {
+        browser_callback_after_created(browser.clone());
+    }
+    match GLOBAL_BROWSERS.replace(None) {
+        Some(brs) => {
+            brs.borrow_mut().push(browser.clone());
+            GLOBAL_BROWSERS.replace(Some(brs));
+        },
+        None => {
+            let brs = RefCell::new(vec!(browser.clone()));
+            GLOBAL_BROWSERS.replace(Some(brs));
         }
-        let mut opts = opts::default_opts();
-        opts.urls = urls;
-        let browser = calloc(1, mem::size_of::<servo_browser_t>() as size_t) as *mut servo_browser_t;
-        (*browser).browser.base.size = mem::size_of::<cef_browser_t>() as size_t;
-        (*browser).client = client;
-        if callback_executed {
-            browser_callback_after_created(browser);
-        }
-        match GLOBAL_BROWSERS.replace(None) {
-            Some(brs) => {
-                brs.borrow_mut().push(browser);
-                GLOBAL_BROWSERS.replace(Some(brs));
-            },
-            None => {
-                let brs = RefCell::new(vec!(browser));
-                GLOBAL_BROWSERS.replace(Some(brs));
-            }
-        }
-        browser as *mut cef_browser_t
+    }
+    browser
+}
+
+cef_static_method_impls! {
+    fn cef_browser_host_create_browser(_window_info: *const cef_window_info_t,
+                                       client: *mut cef_client_t,
+                                       _url: *const cef_string_t,
+                                       _browser_settings: *const cef_browser_settings_t,
+                                       _request_context: *mut cef_request_context_t)
+                                       -> c_int {
+        let _window_info: &cef_window_info_t = _window_info;
+        let client: CefClient = client;
+        let _url: &[u16] = _url;
+        let _browser_settings: &cef_browser_settings_t = _browser_settings;
+        let _request_context: CefRequestContext = _request_context;
+        browser_host_create(client, false);
+        1i32
+    }
+
+    fn cef_browser_host_create_browser_sync(_window_info: *const cef_window_info_t,
+                                            client: *mut cef_client_t,
+                                            _url: *const cef_string_t,
+                                            _browser_settings: *const cef_browser_settings_t,
+                                            _request_context: *mut cef_request_context_t)
+                                            -> *mut cef_browser_t {
+        let _window_info: &cef_window_info_t = _window_info;
+        let client: CefClient = client;
+        let _url: &[u16] = _url;
+        let _browser_settings: &cef_browser_settings_t = _browser_settings;
+        let _request_context: CefRequestContext = _request_context;
+        browser_host_create(client, true)
     }
 }
-
-#[no_mangle]
-pub extern "C" fn cef_browser_host_create_browser(window_info: *const cef_window_info_t,
-                                                  client: *mut cef_client_t,
-                                                  url: *const cef_string_t,
-                                                  settings: *const cef_browser_settings_t,
-                                                  request_context: *mut cef_request_context_t)
-                                                  -> c_int {
-    browser_host_create(window_info, client, url, settings, request_context, false);
-    1
-}
-
-#[no_mangle]
-pub extern "C" fn cef_browser_host_create_browser_sync(window_info: *const cef_window_info_t,
-                                                       client: *mut cef_client_t,
-                                                       url: *const cef_string_t,
-                                                       settings: *const cef_browser_settings_t,
-                                                       request_context: *mut cef_request_context_t)
-                                                       -> *mut cef_browser_t {
-    browser_host_create(window_info, client, url, settings, request_context, true)
-}
--- a/servo/ports/cef/command_line.rs
+++ b/servo/ports/cef/command_line.rs
@@ -1,18 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+use interfaces::cef_command_line_t;
+
 use libc::{calloc, c_int, size_t};
 use std::mem;
 use std::string;
 use std::c_vec::CVec;
-use string::{cef_string_userfree_utf16_alloc, cef_string_utf16_set};
-use types::{cef_command_line_t, cef_string_t, cef_string_userfree_t, cef_string_utf16_t};
+use string as cef_string;
+use string::cef_string_utf16_set;
+use types::{cef_string_t, cef_string_userfree_t, cef_string_utf16_t};
 
 type command_line_t = command_line;
 struct command_line {
     pub cl: cef_command_line_t,
     pub argc: c_int,
     pub argv: Vec<String>,
 }
 
@@ -36,41 +39,44 @@ pub fn command_line_init(argc: c_int, ar
         (*cl).argc = argc;
         (*cl).argv = a;
         (*cl).cl.get_switch_value = Some(command_line_get_switch_value);
         GLOBAL_CMDLINE = Some(cl);
     }
 }
 
 #[no_mangle]
-pub extern "C" fn command_line_get_switch_value(cmd: *mut cef_command_line_t, name: *const cef_string_t) -> *mut cef_string_userfree_t {
+pub extern "C" fn command_line_get_switch_value(cmd: *mut cef_command_line_t, name: *const cef_string_t) -> cef_string_userfree_t {
     if cmd.is_null() || name.is_null() {
-        return 0 as *mut cef_string_userfree_t;
+        return cef_string::empty_utf16_string()
     }
     unsafe {
         //technically cef_string_t can be any type of character size
         //but the default cef callback uses utf16, so I'm jumping on board the SS Copy
         let cl: *mut command_line_t = mem::transmute(cmd);
         let cs: *const cef_string_utf16_t = mem::transmute(name);
         let opt = String::from_utf16(CVec::new((*cs).str, (*cs).length as uint).as_slice()).unwrap();
             //debug!("opt: {}", opt);
         for s in (*cl).argv.iter() {
             let o = s.as_slice().trim_left_chars('-');
             //debug!("arg: {}", o);
             if o.as_slice().starts_with(opt.as_slice()) {
-                let string = cef_string_userfree_utf16_alloc() as *mut cef_string_utf16_t;
+                let mut string = mem::uninitialized();
                 let arg = o.slice_from(opt.len() + 1).as_bytes();
                 arg.with_c_str(|c_str| {
-                    cef_string_utf16_set(mem::transmute(c_str), arg.len() as size_t, string, 1);
+                    cef_string_utf16_set(mem::transmute(c_str),
+                                         arg.len() as size_t,
+                                         &mut string,
+                                         1);
                 });
-                return string as *mut cef_string_userfree_t
+                return string
             }
         }
     }
-    return 0 as *mut cef_string_userfree_t;
+    return cef_string::empty_utf16_string()
 }
 
 #[no_mangle]
 pub extern "C" fn cef_command_line_create() -> *mut cef_command_line_t {
         unsafe {
             let cl = command_line_new();
             (*cl).cl.get_switch_value = Some(command_line_get_switch_value);
             mem::transmute(cl)
@@ -85,8 +91,14 @@ pub extern "C" fn cef_command_line_get_g
                 mem::transmute(scl)
             },
             None => {
                 0 as *mut cef_command_line_t
             }
         }
     }
 }
+
+cef_stub_static_method_impls! {
+    fn cef_command_line_create_command_line() -> *mut cef_command_line_t;
+    fn cef_command_line_get_global_command_line() -> *mut cef_command_line_t;
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/cookie.rs
@@ -0,0 +1,16 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+use interfaces::cef_cookie_manager_t;
+use types::cef_string_t;
+
+use libc::c_int;
+
+cef_stub_static_method_impls! {
+    fn cef_cookie_manager_get_global_manager() -> *mut cef_cookie_manager_t;
+    fn cef_cookie_manager_create_manager(path: *const cef_string_t,
+                                         persist_session_cookies: c_int)
+                                         -> *mut cef_cookie_manager_t;
+}
+
--- a/servo/ports/cef/core.rs
+++ b/servo/ports/cef/core.rs
@@ -1,22 +1,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use browser::{GLOBAL_BROWSERS, browser_callback_after_created};
 use command_line::command_line_init;
+use interfaces::cef_app_t;
+use eutil::Downcast;
+use switches::{KPROCESSTYPE, KWAITFORDEBUGGER};
+use types::{cef_main_args_t, cef_settings_t};
+
 use glfw_app;
 use libc::funcs::c95::string::strlen;
-use libc::{c_int, c_void};
+use libc::{c_char, c_int, c_void};
 use native;
 use servo::Browser;
 use std::slice;
-use switches::{KPROCESSTYPE, KWAITFORDEBUGGER};
-use types::{cef_app_t, cef_main_args_t, cef_settings_t};
+
+static CEF_API_HASH_UNIVERSAL: &'static [u8] = b"8efd129f4afc344bd04b2feb7f73a149b6c4e27f\0";
+#[cfg(target_os="windows")]
+static CEF_API_HASH_PLATFORM: &'static [u8] = b"5c7f3e50ff5265985d11dc1a466513e25748bedd\0";
+#[cfg(target_os="macos")]
+static CEF_API_HASH_PLATFORM: &'static [u8] = b"6813214accbf2ebfb6bdcf8d00654650b251bf3d\0";
+#[cfg(target_os="linux")]
+static CEF_API_HASH_PLATFORM: &'static [u8] = b"2bc564c3871965ef3a2531b528bda3e17fa17a6d\0";
 
 #[no_mangle]
 pub extern "C" fn cef_initialize(args: *const cef_main_args_t,
                                  _settings: *mut cef_settings_t,
                                  application: *mut cef_app_t,
                                  _windows_sandbox_info: *const c_void)
                                  -> c_int {
     if args.is_null() {
@@ -37,32 +48,46 @@ pub extern "C" fn cef_initialize(args: *
 #[no_mangle]
 pub extern "C" fn cef_shutdown() {
 }
 
 #[no_mangle]
 pub extern "C" fn cef_run_message_loop() {
     native::start(0, 0 as *const *const u8, proc() {
         GLOBAL_BROWSERS.get().map(|refcellbrowsers| {
-            unsafe {
-                let browsers = refcellbrowsers.borrow();
-                let mut num = browsers.len();
-                for active_browser in browsers.iter() {
-                    (**active_browser).window = glfw_app::create_window();
-                    (**active_browser).servo_browser = Some(Browser::new(Some((**active_browser).window.clone())));
-                    if !(**active_browser).callback_executed { browser_callback_after_created(*active_browser); }
+            let browsers = refcellbrowsers.borrow();
+            let mut num = browsers.len();
+            for active_browser in browsers.iter() {
+                *active_browser.downcast().window.borrow_mut() =
+                    Some(glfw_app::create_window());
+                *active_browser.downcast().servo_browser.borrow_mut() =
+                    Some(Browser::new((*active_browser.downcast()
+                                                      .window
+                                                      .borrow()).clone()));
+                if !active_browser.downcast().callback_executed.get() {
+                    browser_callback_after_created((*active_browser).clone());
                 }
-                while num > 0 {
-                    for active_browser in browsers.iter().filter(|&active_browser| (**active_browser).servo_browser.is_some()) {
-                        let ref mut browser = **active_browser;
-                        let mut servobrowser = browser.servo_browser.take().unwrap();
-                        if !servobrowser.handle_event(browser.window.wait_events()) {
-                            servobrowser.shutdown();
-                            num -= 1;
-                        }
+            }
+            while num > 0 {
+                for active_browser in browsers.iter()
+                                              .filter(|&active_browser| {
+                                                  active_browser.downcast()
+                                                                .servo_browser
+                                                                .borrow()
+                                                                .is_some()
+                                              }) {
+                    let ref mut browser = active_browser.downcast();
+                    let mut servobrowser = browser.servo_browser.borrow_mut().take().unwrap();
+                    if !servobrowser.handle_event(browser.window
+                                                         .borrow_mut()
+                                                         .as_ref()
+                                                         .unwrap()
+                                                         .wait_events()) {
+                        servobrowser.shutdown();
+                        num -= 1;
                     }
                 }
             }
         });
     });
 }
 
 #[no_mangle]
@@ -93,8 +118,23 @@ pub extern "C" fn cef_execute_process(ar
                      }
                  }
              });
         }
     }
    //process type not specified, must be browser process (NOOP)
    -1
 }
+
+#[no_mangle]
+pub extern "C" fn cef_api_hash(entry: c_int) -> *const c_char {
+    if entry == 0 {
+        &CEF_API_HASH_PLATFORM[0] as *const u8 as *const c_char
+    } else {
+        &CEF_API_HASH_UNIVERSAL[0] as *const u8 as *const c_char
+    }
+}
+
+#[no_mangle]
+pub extern "C" fn cef_get_min_log_level() -> c_int {
+    0
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/drag_data.rs
@@ -0,0 +1,10 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+use interfaces::{cef_drag_data_t};
+
+cef_stub_static_method_impls! {
+    fn cef_drag_data_create() -> *mut cef_drag_data_t;
+}
+
--- a/servo/ports/cef/eutil.rs
+++ b/servo/ports/cef/eutil.rs
@@ -1,15 +1,80 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-use libc::c_int;
+use types::cef_base_t;
+
+use libc::{mod, c_int, c_void, size_t};
+use std::mem;
 use std::slice;
 use std::str;
 
+/// Allows you to downcast a CEF interface to a CEF class instance.
+///
+/// FIXME(pcwalton): This is currently unsafe. I think the right way to make this safe is to (a)
+/// forbid more than one Rust implementation of a given interface (easy to do by manufacturing an
+/// impl that will conflict if there is more than one) and then (b) add a dynamic check to make
+/// sure the `release` for the object is equal to `servo_release`.
+pub trait Downcast<Class> {
+    fn downcast(&self) -> &Class;
+}
+
 pub fn slice_to_str(s: *const u8, l: uint, f: |&str| -> c_int) -> c_int {
     unsafe {
         slice::raw::buf_as_slice(s, l, |result| {
              str::from_utf8(result).map(|s| f(s)).unwrap_or(0)
         })
     }
 }
+
+/// Creates a new raw CEF object of the given type and sets up its reference counting machinery.
+/// All fields are initialized to zero. It is the caller's responsibility to ensure that the given
+/// type is a CEF type with `cef_base_t` as its first member.
+pub unsafe fn create_cef_object<Base,Extra>(size: size_t) -> *mut Base {
+    let object = libc::calloc(1, (mem::size_of::<Base>() + mem::size_of::<Extra>()) as u64) as
+        *mut cef_base_t;
+    (*object).size = size;
+    (*object).add_ref = Some(servo_add_ref);
+    (*object).release = Some(servo_release);
+    *ref_count(object) = 1;
+    object as *mut Base
+}
+
+/// Returns a pointer to the Servo-specific reference count for the given object. This only works
+/// on objects that Servo created!
+unsafe fn ref_count(object: *mut cef_base_t) -> *mut uint {
+    // The reference count should be the first field of the extra data.
+    (object as *mut u8).offset((*object).size as int) as *mut uint
+}
+
+/// Increments the reference count on a CEF object. This only works on objects that Servo created!
+extern "C" fn servo_add_ref(object: *mut cef_base_t) -> c_int {
+    unsafe {
+        let count = ref_count(object);
+        *count += 1;
+        *count as c_int
+    }
+}
+
+/// Decrements the reference count on a CEF object. If zero, frees it. This only works on objects
+/// that Servo created!
+extern "C" fn servo_release(object: *mut cef_base_t) -> c_int {
+    unsafe {
+        let count = ref_count(object);
+        *count -= 1;
+        let new_count = *count;
+        if new_count == 0 {
+            servo_free(object);
+        }
+        (new_count == 0) as c_int
+    }
+}
+
+unsafe fn servo_free(object: *mut cef_base_t) {
+    libc::free(object as *mut c_void);
+}
+
+pub unsafe fn add_ref(c_object: *mut cef_base_t) {
+    ((*c_object).add_ref.unwrap())(c_object);
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_app.rs
@@ -0,0 +1,305 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Implement this structure to provide handler implementations. Methods will be
+// called by the process and/or thread indicated.
+//
+#[repr(C)]
+pub struct _cef_app_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Provides an opportunity to view and/or modify command-line arguments before
+  // processing by CEF and Chromium. The |process_type| value will be NULL for
+  // the browser process. Do not keep a reference to the cef_command_line_t
+  // object passed to this function. The CefSettings.command_line_args_disabled
+  // value can be used to start with an NULL command-line object. Any values
+  // specified in CefSettings that equate to command-line arguments will be set
+  // before this function is called. Be cautious when using this function to
+  // modify command-line arguments for non-browser processes as this may result
+  // in undefined behavior including crashes.
+  //
+  pub on_before_command_line_processing: Option<extern "C" fn(
+      this: *mut cef_app_t, process_type: *const types::cef_string_t,
+      command_line: *mut interfaces::cef_command_line_t) -> ()>,
+
+  //
+  // Provides an opportunity to register custom schemes. Do not keep a reference
+  // to the |registrar| object. This function is called on the main thread for
+  // each process and the registered schemes should be the same across all
+  // processes.
+  //
+  pub on_register_custom_schemes: Option<extern "C" fn(this: *mut cef_app_t,
+      registrar: *mut interfaces::cef_scheme_registrar_t) -> ()>,
+
+  //
+  // Return the handler for resource bundle events. If
+  // CefSettings.pack_loading_disabled is true (1) a handler must be returned.
+  // If no handler is returned resources will be loaded from pack files. This
+  // function is called by the browser and render processes on multiple threads.
+  //
+  pub get_resource_bundle_handler: Option<extern "C" fn(
+      this: *mut cef_app_t) -> *mut interfaces::cef_resource_bundle_handler_t>,
+
+  //
+  // Return the handler for functionality specific to the browser process. This
+  // function is called on multiple threads in the browser process.
+  //
+  pub get_browser_process_handler: Option<extern "C" fn(
+      this: *mut cef_app_t) -> *mut interfaces::cef_browser_process_handler_t>,
+
+  //
+  // Return the handler for functionality specific to the render process. This
+  // function is called on the render process main thread.
+  //
+  pub get_render_process_handler: Option<extern "C" fn(
+      this: *mut cef_app_t) -> *mut interfaces::cef_render_process_handler_t>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_app_t = _cef_app_t;
+
+
+//
+// Implement this structure to provide handler implementations. Methods will be
+// called by the process and/or thread indicated.
+//
+pub struct CefApp {
+  c_object: *mut cef_app_t,
+}
+
+impl Clone for CefApp {
+  fn clone(&self) -> CefApp{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefApp {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefApp {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefApp {
+  pub unsafe fn from_c_object(c_object: *mut cef_app_t) -> CefApp {
+    CefApp {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_app_t) -> CefApp {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefApp {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_app_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_app_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Provides an opportunity to view and/or modify command-line arguments before
+  // processing by CEF and Chromium. The |process_type| value will be NULL for
+  // the browser process. Do not keep a reference to the cef_command_line_t
+  // object passed to this function. The CefSettings.command_line_args_disabled
+  // value can be used to start with an NULL command-line object. Any values
+  // specified in CefSettings that equate to command-line arguments will be set
+  // before this function is called. Be cautious when using this function to
+  // modify command-line arguments for non-browser processes as this may result
+  // in undefined behavior including crashes.
+  //
+  pub fn on_before_command_line_processing(&self, process_type: &[u16],
+      command_line: interfaces::CefCommandLine) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_before_command_line_processing.unwrap())(
+          self.c_object,
+          CefWrap::to_c(process_type),
+          CefWrap::to_c(command_line)))
+    }
+  }
+
+  //
+  // Provides an opportunity to register custom schemes. Do not keep a reference
+  // to the |registrar| object. This function is called on the main thread for
+  // each process and the registered schemes should be the same across all
+  // processes.
+  //
+  pub fn on_register_custom_schemes(&self,
+      registrar: interfaces::CefSchemeRegistrar) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_register_custom_schemes.unwrap())(
+          self.c_object,
+          CefWrap::to_c(registrar)))
+    }
+  }
+
+  //
+  // Return the handler for resource bundle events. If
+  // CefSettings.pack_loading_disabled is true (1) a handler must be returned.
+  // If no handler is returned resources will be loaded from pack files. This
+  // function is called by the browser and render processes on multiple threads.
+  //
+  pub fn get_resource_bundle_handler(
+      &self) -> interfaces::CefResourceBundleHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_resource_bundle_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for functionality specific to the browser process. This
+  // function is called on multiple threads in the browser process.
+  //
+  pub fn get_browser_process_handler(
+      &self) -> interfaces::CefBrowserProcessHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_browser_process_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for functionality specific to the render process. This
+  // function is called on the render process main thread.
+  //
+  pub fn get_render_process_handler(
+      &self) -> interfaces::CefRenderProcessHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_render_process_handler.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_app_t> for CefApp {
+  fn to_c(rust_object: CefApp) -> *mut cef_app_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_app_t) -> CefApp {
+    CefApp::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_app_t> for Option<CefApp> {
+  fn to_c(rust_object: Option<CefApp>) -> *mut cef_app_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_app_t) -> Option<CefApp> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefApp::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_auth_callback.rs
@@ -0,0 +1,206 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Callback structure used for asynchronous continuation of authentication
+// requests.
+//
+#[repr(C)]
+pub struct _cef_auth_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Continue the authentication request.
+  //
+  pub cont: Option<extern "C" fn(this: *mut cef_auth_callback_t,
+      username: *const types::cef_string_t,
+      password: *const types::cef_string_t) -> ()>,
+
+  //
+  // Cancel the authentication request.
+  //
+  pub cancel: Option<extern "C" fn(this: *mut cef_auth_callback_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_auth_callback_t = _cef_auth_callback_t;
+
+
+//
+// Callback structure used for asynchronous continuation of authentication
+// requests.
+//
+pub struct CefAuthCallback {
+  c_object: *mut cef_auth_callback_t,
+}
+
+impl Clone for CefAuthCallback {
+  fn clone(&self) -> CefAuthCallback{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefAuthCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefAuthCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefAuthCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_auth_callback_t) -> CefAuthCallback {
+    CefAuthCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_auth_callback_t) -> CefAuthCallback {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefAuthCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_auth_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_auth_callback_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Continue the authentication request.
+  //
+  pub fn cont(&self, username: &[u16], password: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cont.unwrap())(
+          self.c_object,
+          CefWrap::to_c(username),
+          CefWrap::to_c(password)))
+    }
+  }
+
+  //
+  // Cancel the authentication request.
+  //
+  pub fn cancel(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cancel.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_auth_callback_t> for CefAuthCallback {
+  fn to_c(rust_object: CefAuthCallback) -> *mut cef_auth_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_auth_callback_t) -> CefAuthCallback {
+    CefAuthCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_auth_callback_t> for Option<CefAuthCallback> {
+  fn to_c(rust_object: Option<CefAuthCallback>) -> *mut cef_auth_callback_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_auth_callback_t) -> Option<CefAuthCallback> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefAuthCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_browser.rs
@@ -0,0 +1,2010 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Structure used to represent a browser window. When used in the browser
+// process the functions of this structure may be called on any thread unless
+// otherwise indicated in the comments. When used in the render process the
+// functions of this structure may only be called on the main thread.
+//
+#[repr(C)]
+pub struct _cef_browser_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns the browser host object. This function can only be called in the
+  // browser process.
+  //
+  pub get_host: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> *mut interfaces::cef_browser_host_t>,
+
+  //
+  // Returns true (1) if the browser can navigate backwards.
+  //
+  pub can_go_back: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> libc::c_int>,
+
+  //
+  // Navigate backwards.
+  //
+  pub go_back: Option<extern "C" fn(this: *mut cef_browser_t) -> ()>,
+
+  //
+  // Returns true (1) if the browser can navigate forwards.
+  //
+  pub can_go_forward: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> libc::c_int>,
+
+  //
+  // Navigate forwards.
+  //
+  pub go_forward: Option<extern "C" fn(this: *mut cef_browser_t) -> ()>,
+
+  //
+  // Returns true (1) if the browser is currently loading.
+  //
+  pub is_loading: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> libc::c_int>,
+
+  //
+  // Reload the current page.
+  //
+  pub reload: Option<extern "C" fn(this: *mut cef_browser_t) -> ()>,
+
+  //
+  // Reload the current page ignoring any cached data.
+  //
+  pub reload_ignore_cache: Option<extern "C" fn(this: *mut cef_browser_t) -> (
+      )>,
+
+  //
+  // Stop loading the page.
+  //
+  pub stop_load: Option<extern "C" fn(this: *mut cef_browser_t) -> ()>,
+
+  //
+  // Returns the globally unique identifier for this browser.
+  //
+  pub get_identifier: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if this object is pointing to the same handle as |that|
+  // object.
+  //
+  pub is_same: Option<extern "C" fn(this: *mut cef_browser_t,
+      that: *mut interfaces::cef_browser_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the window is a popup window.
+  //
+  pub is_popup: Option<extern "C" fn(this: *mut cef_browser_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if a document has been loaded in the browser.
+  //
+  pub has_document: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> libc::c_int>,
+
+  //
+  // Returns the main (top-level) frame for the browser window.
+  //
+  pub get_main_frame: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> *mut interfaces::cef_frame_t>,
+
+  //
+  // Returns the focused frame for the browser window.
+  //
+  pub get_focused_frame: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> *mut interfaces::cef_frame_t>,
+
+  //
+  // Returns the frame with the specified identifier, or NULL if not found.
+  //
+  pub get_frame_byident: Option<extern "C" fn(this: *mut cef_browser_t,
+      identifier: i64) -> *mut interfaces::cef_frame_t>,
+
+  //
+  // Returns the frame with the specified name, or NULL if not found.
+  //
+  pub get_frame: Option<extern "C" fn(this: *mut cef_browser_t,
+      name: *const types::cef_string_t) -> *mut interfaces::cef_frame_t>,
+
+  //
+  // Returns the number of frames that currently exist.
+  //
+  pub get_frame_count: Option<extern "C" fn(
+      this: *mut cef_browser_t) -> libc::size_t>,
+
+  //
+  // Returns the identifiers of all existing frames.
+  //
+  pub get_frame_identifiers: Option<extern "C" fn(this: *mut cef_browser_t,
+      identifiers_count: *mut libc::size_t, identifiers: *mut i64) -> ()>,
+
+  //
+  // Returns the names of all existing frames.
+  //
+  pub get_frame_names: Option<extern "C" fn(this: *mut cef_browser_t,
+      names: types::cef_string_list_t) -> ()>,
+
+  //
+  // Send a message to the specified |target_process|. Returns true (1) if the
+  // message was sent successfully.
+  //
+  pub send_process_message: Option<extern "C" fn(this: *mut cef_browser_t,
+      target_process: interfaces::cef_process_id_t,
+      message: *mut interfaces::cef_process_message_t) -> libc::c_int>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_browser_t = _cef_browser_t;
+
+
+//
+// Structure used to represent a browser window. When used in the browser
+// process the functions of this structure may be called on any thread unless
+// otherwise indicated in the comments. When used in the render process the
+// functions of this structure may only be called on the main thread.
+//
+pub struct CefBrowser {
+  c_object: *mut cef_browser_t,
+}
+
+impl Clone for CefBrowser {
+  fn clone(&self) -> CefBrowser{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefBrowser {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefBrowser {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefBrowser {
+  pub unsafe fn from_c_object(c_object: *mut cef_browser_t) -> CefBrowser {
+    CefBrowser {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_browser_t) -> CefBrowser {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefBrowser {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_browser_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_browser_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Returns the browser host object. This function can only be called in the
+  // browser process.
+  //
+  pub fn get_host(&self) -> interfaces::CefBrowserHost {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_host.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the browser can navigate backwards.
+  //
+  pub fn can_go_back(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).can_go_back.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Navigate backwards.
+  //
+  pub fn go_back(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).go_back.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the browser can navigate forwards.
+  //
+  pub fn can_go_forward(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).can_go_forward.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Navigate forwards.
+  //
+  pub fn go_forward(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).go_forward.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the browser is currently loading.
+  //
+  pub fn is_loading(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_loading.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Reload the current page.
+  //
+  pub fn reload(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).reload.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Reload the current page ignoring any cached data.
+  //
+  pub fn reload_ignore_cache(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).reload_ignore_cache.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Stop loading the page.
+  //
+  pub fn stop_load(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).stop_load.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the globally unique identifier for this browser.
+  //
+  pub fn get_identifier(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_identifier.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this object is pointing to the same handle as |that|
+  // object.
+  //
+  pub fn is_same(&self, that: interfaces::CefBrowser) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_same.unwrap())(
+          self.c_object,
+          CefWrap::to_c(that)))
+    }
+  }
+
+  //
+  // Returns true (1) if the window is a popup window.
+  //
+  pub fn is_popup(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_popup.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if a document has been loaded in the browser.
+  //
+  pub fn has_document(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_document.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the main (top-level) frame for the browser window.
+  //
+  pub fn get_main_frame(&self) -> interfaces::CefFrame {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_main_frame.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the focused frame for the browser window.
+  //
+  pub fn get_focused_frame(&self) -> interfaces::CefFrame {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_focused_frame.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the frame with the specified identifier, or NULL if not found.
+  //
+  pub fn get_frame_byident(&self, identifier: i64) -> interfaces::CefFrame {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_frame_byident.unwrap())(
+          self.c_object,
+          CefWrap::to_c(identifier)))
+    }
+  }
+
+  //
+  // Returns the frame with the specified name, or NULL if not found.
+  //
+  pub fn get_frame(&self, name: &[u16]) -> interfaces::CefFrame {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_frame.unwrap())(
+          self.c_object,
+          CefWrap::to_c(name)))
+    }
+  }
+
+  //
+  // Returns the number of frames that currently exist.
+  //
+  pub fn get_frame_count(&self) -> libc::size_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_frame_count.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the identifiers of all existing frames.
+  //
+  pub fn get_frame_identifiers(&self, identifiers_count: *mut libc::size_t,
+      identifiers: *mut i64) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_frame_identifiers.unwrap())(
+          self.c_object,
+          CefWrap::to_c(identifiers_count),
+          CefWrap::to_c(identifiers)))
+    }
+  }
+
+  //
+  // Returns the names of all existing frames.
+  //
+  pub fn get_frame_names(&self, names: Vec<String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_frame_names.unwrap())(
+          self.c_object,
+          CefWrap::to_c(names)))
+    }
+  }
+
+  //
+  // Send a message to the specified |target_process|. Returns true (1) if the
+  // message was sent successfully.
+  //
+  pub fn send_process_message(&self, target_process: interfaces::CefProcessId,
+      message: interfaces::CefProcessMessage) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).send_process_message.unwrap())(
+          self.c_object,
+          CefWrap::to_c(target_process),
+          CefWrap::to_c(message)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_browser_t> for CefBrowser {
+  fn to_c(rust_object: CefBrowser) -> *mut cef_browser_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_browser_t) -> CefBrowser {
+    CefBrowser::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_browser_t> for Option<CefBrowser> {
+  fn to_c(rust_object: Option<CefBrowser>) -> *mut cef_browser_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_browser_t) -> Option<CefBrowser> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefBrowser::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
+// this structure will be called on the browser process UI thread.
+//
+#[repr(C)]
+pub struct _cef_run_file_dialog_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Called asynchronously after the file dialog is dismissed. If the selection
+  // was successful |file_paths| will be a single value or a list of values
+  // depending on the dialog mode. If the selection was cancelled |file_paths|
+  // will be NULL.
+  //
+  pub cont: Option<extern "C" fn(this: *mut cef_run_file_dialog_callback_t,
+      browser_host: *mut interfaces::cef_browser_host_t,
+      file_paths: types::cef_string_list_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_run_file_dialog_callback_t = _cef_run_file_dialog_callback_t;
+
+
+//
+// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
+// this structure will be called on the browser process UI thread.
+//
+pub struct CefRunFileDialogCallback {
+  c_object: *mut cef_run_file_dialog_callback_t,
+}
+
+impl Clone for CefRunFileDialogCallback {
+  fn clone(&self) -> CefRunFileDialogCallback{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefRunFileDialogCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefRunFileDialogCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefRunFileDialogCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_run_file_dialog_callback_t) -> CefRunFileDialogCallback {
+    CefRunFileDialogCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_run_file_dialog_callback_t) -> CefRunFileDialogCallback {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefRunFileDialogCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_run_file_dialog_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_run_file_dialog_callback_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Called asynchronously after the file dialog is dismissed. If the selection
+  // was successful |file_paths| will be a single value or a list of values
+  // depending on the dialog mode. If the selection was cancelled |file_paths|
+  // will be NULL.
+  //
+  pub fn cont(&self, browser_host: interfaces::CefBrowserHost,
+      file_paths: Vec<String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cont.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser_host),
+          CefWrap::to_c(file_paths)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_run_file_dialog_callback_t> for CefRunFileDialogCallback {
+  fn to_c(rust_object: CefRunFileDialogCallback) -> *mut cef_run_file_dialog_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_run_file_dialog_callback_t) -> CefRunFileDialogCallback {
+    CefRunFileDialogCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_run_file_dialog_callback_t> for Option<CefRunFileDialogCallback> {
+  fn to_c(rust_object: Option<CefRunFileDialogCallback>) -> *mut cef_run_file_dialog_callback_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_run_file_dialog_callback_t) -> Option<CefRunFileDialogCallback> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefRunFileDialogCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Structure used to represent the browser process aspects of a browser window.
+// The functions of this structure can only be called in the browser process.
+// They may be called on any thread in that process unless otherwise indicated
+// in the comments.
+//
+#[repr(C)]
+pub struct _cef_browser_host_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns the hosted browser object.
+  //
+  pub get_browser: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> *mut interfaces::cef_browser_t>,
+
+  //
+  // Request that the browser close. The JavaScript 'onbeforeunload' event will
+  // be fired. If |force_close| is false (0) the event handler, if any, will be
+  // allowed to prompt the user and the user can optionally cancel the close. If
+  // |force_close| is true (1) the prompt will not be displayed and the close
+  // will proceed. Results in a call to cef_life_span_handler_t::do_close() if
+  // the event handler allows the close or if |force_close| is true (1). See
+  // cef_life_span_handler_t::do_close() documentation for additional usage
+  // information.
+  //
+  pub close_browser: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      force_close: libc::c_int) -> ()>,
+
+  //
+  // Set whether the browser is focused.
+  //
+  pub set_focus: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      focus: libc::c_int) -> ()>,
+
+  //
+  // Set whether the window containing the browser is visible
+  // (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X.
+  //
+  pub set_window_visibility: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      visible: libc::c_int) -> ()>,
+
+  //
+  // Retrieve the window handle for this browser.
+  //
+  pub get_window_handle: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> types::cef_window_handle_t>,
+
+  //
+  // Retrieve the window handle of the browser that opened this browser. Will
+  // return NULL for non-popup windows. This function can be used in combination
+  // with custom handling of modal windows.
+  //
+  pub get_opener_window_handle: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> types::cef_window_handle_t>,
+
+  //
+  // Returns the client for this browser.
+  //
+  pub get_client: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> *mut interfaces::cef_client_t>,
+
+  //
+  // Returns the request context for this browser.
+  //
+  pub get_request_context: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> *mut interfaces::cef_request_context_t>,
+
+  //
+  // Get the current zoom level. The default zoom level is 0.0. This function
+  // can only be called on the UI thread.
+  //
+  pub get_zoom_level: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> libc::c_double>,
+
+  //
+  // Change the zoom level to the specified value. Specify 0.0 to reset the zoom
+  // level. If called on the UI thread the change will be applied immediately.
+  // Otherwise, the change will be applied asynchronously on the UI thread.
+  //
+  pub set_zoom_level: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      zoomLevel: libc::c_double) -> ()>,
+
+  //
+  // Call to run a file chooser dialog. Only a single file chooser dialog may be
+  // pending at any given time. |mode| represents the type of dialog to display.
+  // |title| to the title to be used for the dialog and may be NULL to show the
+  // default title ("Open" or "Save" depending on the mode). |default_file_name|
+  // is the default file name to select in the dialog. |accept_types| is a list
+  // of valid lower-cased MIME types or file extensions specified in an input
+  // element and is used to restrict selectable files to such types. |callback|
+  // will be executed after the dialog is dismissed or immediately if another
+  // dialog is already pending. The dialog will be initiated asynchronously on
+  // the UI thread.
+  //
+  pub run_file_dialog: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      mode: types::cef_file_dialog_mode_t, title: *const types::cef_string_t,
+      default_file_name: *const types::cef_string_t,
+      accept_types: types::cef_string_list_t,
+      callback: *mut interfaces::cef_run_file_dialog_callback_t) -> ()>,
+
+  //
+  // Download the file at |url| using cef_download_handler_t.
+  //
+  pub start_download: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      url: *const types::cef_string_t) -> ()>,
+
+  //
+  // Print the current browser contents.
+  //
+  pub print: Option<extern "C" fn(this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // Search for |searchText|. |identifier| can be used to have multiple searches
+  // running simultaniously. |forward| indicates whether to search forward or
+  // backward within the page. |matchCase| indicates whether the search should
+  // be case-sensitive. |findNext| indicates whether this is the first request
+  // or a follow-up.
+  //
+  pub find: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      identifier: libc::c_int, searchText: *const types::cef_string_t,
+      forward: libc::c_int, matchCase: libc::c_int, findNext: libc::c_int) -> (
+      )>,
+
+  //
+  // Cancel all searches that are currently going on.
+  //
+  pub stop_finding: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      clearSelection: libc::c_int) -> ()>,
+
+  //
+  // Open developer tools in its own window. If |inspect_element_at| is non-
+  // NULL the element at the specified (x,y) location will be inspected.
+  //
+  pub show_dev_tools: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      windowInfo: *const interfaces::cef_window_info_t,
+      client: *mut interfaces::cef_client_t,
+      settings: *const interfaces::cef_browser_settings_t,
+      inspect_element_at: *const types::cef_point_t) -> ()>,
+
+  //
+  // Explicitly close the developer tools window if one exists for this browser
+  // instance.
+  //
+  pub close_dev_tools: Option<extern "C" fn(this: *mut cef_browser_host_t) -> (
+      )>,
+
+  //
+  // Set whether mouse cursor change is disabled.
+  //
+  pub set_mouse_cursor_change_disabled: Option<extern "C" fn(
+      this: *mut cef_browser_host_t, disabled: libc::c_int) -> ()>,
+
+  //
+  // Returns true (1) if mouse cursor change is disabled.
+  //
+  pub is_mouse_cursor_change_disabled: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> libc::c_int>,
+
+  //
+  // If a misspelled word is currently selected in an editable node calling this
+  // function will replace it with the specified |word|.
+  //
+  pub replace_misspelling: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      word: *const types::cef_string_t) -> ()>,
+
+  //
+  // Add the specified |word| to the spelling dictionary.
+  //
+  pub add_word_to_dictionary: Option<extern "C" fn(
+      this: *mut cef_browser_host_t, word: *const types::cef_string_t) -> ()>,
+
+  //
+  // Returns true (1) if window rendering is disabled.
+  //
+  pub is_window_rendering_disabled: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> libc::c_int>,
+
+  //
+  // Notify the browser that the widget has been resized. The browser will first
+  // call cef_render_handler_t::GetViewRect to get the new size and then call
+  // cef_render_handler_t::OnPaint asynchronously with the updated regions. This
+  // function is only used when window rendering is disabled.
+  //
+  pub was_resized: Option<extern "C" fn(this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // Notify the browser that it has been hidden or shown. Layouting and
+  // cef_render_handler_t::OnPaint notification will stop when the browser is
+  // hidden. This function is only used when window rendering is disabled.
+  //
+  pub was_hidden: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      hidden: libc::c_int) -> ()>,
+
+  //
+  // Send a notification to the browser that the screen info has changed. The
+  // browser will then call cef_render_handler_t::GetScreenInfo to update the
+  // screen information with the new values. This simulates moving the webview
+  // window from one display to another, or changing the properties of the
+  // current display. This function is only used when window rendering is
+  // disabled.
+  //
+  pub notify_screen_info_changed: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // Invalidate the view. The browser will call cef_render_handler_t::OnPaint
+  // asynchronously. This function is only used when window rendering is
+  // disabled.
+  //
+  pub invalidate: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      ty: types::cef_paint_element_type_t) -> ()>,
+
+  //
+  // Send a key event to the browser.
+  //
+  pub send_key_event: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      event: *const interfaces::cef_key_event_t) -> ()>,
+
+  //
+  // Send a mouse click event to the browser. The |x| and |y| coordinates are
+  // relative to the upper-left corner of the view.
+  //
+  pub send_mouse_click_event: Option<extern "C" fn(
+      this: *mut cef_browser_host_t,
+      event: *const interfaces::cef_mouse_event_t,
+      ty: types::cef_mouse_button_type_t, mouseUp: libc::c_int,
+      clickCount: libc::c_int) -> ()>,
+
+  //
+  // Send a mouse move event to the browser. The |x| and |y| coordinates are
+  // relative to the upper-left corner of the view.
+  //
+  pub send_mouse_move_event: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      event: *const interfaces::cef_mouse_event_t,
+      mouseLeave: libc::c_int) -> ()>,
+
+  //
+  // Send a mouse wheel event to the browser. The |x| and |y| coordinates are
+  // relative to the upper-left corner of the view. The |deltaX| and |deltaY|
+  // values represent the movement delta in the X and Y directions respectively.
+  // In order to scroll inside select popups with window rendering disabled
+  // cef_render_handler_t::GetScreenPoint should be implemented properly.
+  //
+  pub send_mouse_wheel_event: Option<extern "C" fn(
+      this: *mut cef_browser_host_t,
+      event: *const interfaces::cef_mouse_event_t, deltaX: libc::c_int,
+      deltaY: libc::c_int) -> ()>,
+
+  //
+  // Send a focus event to the browser.
+  //
+  pub send_focus_event: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      setFocus: libc::c_int) -> ()>,
+
+  //
+  // Send a capture lost event to the browser.
+  //
+  pub send_capture_lost_event: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // Notify the browser that the window hosting it is about to be moved or
+  // resized. This function is only used on Windows and Linux.
+  //
+  pub notify_move_or_resize_started: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // Get the NSTextInputContext implementation for enabling IME on Mac when
+  // window rendering is disabled.
+  //
+  pub get_nstext_input_context: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> types::cef_text_input_context_t>,
+
+  //
+  // Handles a keyDown event prior to passing it through the NSTextInputClient
+  // machinery.
+  //
+  pub handle_key_event_before_text_input_client: Option<extern "C" fn(
+      this: *mut cef_browser_host_t, keyEvent: types::cef_event_handle_t) -> (
+      )>,
+
+  //
+  // Performs any additional actions after NSTextInputClient handles the event.
+  //
+  pub handle_key_event_after_text_input_client: Option<extern "C" fn(
+      this: *mut cef_browser_host_t, keyEvent: types::cef_event_handle_t) -> (
+      )>,
+
+  //
+  // Call this function when the user drags the mouse into the web view (before
+  // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data|
+  // should not contain file contents as this type of data is not allowed to be
+  // dragged into the web view. File contents can be removed using
+  // cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from
+  // cef_render_handler_t::StartDragging). This function is only used when
+  // window rendering is disabled.
+  //
+  pub drag_target_drag_enter: Option<extern "C" fn(
+      this: *mut cef_browser_host_t,
+      drag_data: *mut interfaces::cef_drag_data_t,
+      event: *const interfaces::cef_mouse_event_t,
+      allowed_ops: types::cef_drag_operations_mask_t) -> ()>,
+
+  //
+  // Call this function each time the mouse is moved across the web view during
+  // a drag operation (after calling DragTargetDragEnter and before calling
+  // DragTargetDragLeave/DragTargetDrop). This function is only used when window
+  // rendering is disabled.
+  //
+  pub drag_target_drag_over: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      event: *const interfaces::cef_mouse_event_t,
+      allowed_ops: types::cef_drag_operations_mask_t) -> ()>,
+
+  //
+  // Call this function when the user drags the mouse out of the web view (after
+  // calling DragTargetDragEnter). This function is only used when window
+  // rendering is disabled.
+  //
+  pub drag_target_drag_leave: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // Call this function when the user completes the drag operation by dropping
+  // the object onto the web view (after calling DragTargetDragEnter). The
+  // object being dropped is |drag_data|, given as an argument to the previous
+  // DragTargetDragEnter call. This function is only used when window rendering
+  // is disabled.
+  //
+  pub drag_target_drop: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      event: *const interfaces::cef_mouse_event_t) -> ()>,
+
+  //
+  // Call this function when the drag operation started by a
+  // cef_render_handler_t::StartDragging call has ended either in a drop or by
+  // being cancelled. |x| and |y| are mouse coordinates relative to the upper-
+  // left corner of the view. If the web view is both the drag source and the
+  // drag target then all DragTarget* functions should be called before
+  // DragSource* mthods. This function is only used when window rendering is
+  // disabled.
+  //
+  pub drag_source_ended_at: Option<extern "C" fn(this: *mut cef_browser_host_t,
+      x: libc::c_int, y: libc::c_int,
+      op: types::cef_drag_operations_mask_t) -> ()>,
+
+  //
+  // Call this function when the drag operation started by a
+  // cef_render_handler_t::StartDragging call has completed. This function may
+  // be called immediately without first calling DragSourceEndedAt to cancel a
+  // drag operation. If the web view is both the drag source and the drag target
+  // then all DragTarget* functions should be called before DragSource* mthods.
+  // This function is only used when window rendering is disabled.
+  //
+  pub drag_source_system_drag_ended: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // Instructs the browser to initialize accelerated compositing. The
+  // appropriate Direct3D or OpenGL state must have been set up before calling
+  // this function.
+  //
+  pub initialize_compositing: Option<extern "C" fn(
+      this: *mut cef_browser_host_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_browser_host_t = _cef_browser_host_t;
+
+
+//
+// Structure used to represent the browser process aspects of a browser window.
+// The functions of this structure can only be called in the browser process.
+// They may be called on any thread in that process unless otherwise indicated
+// in the comments.
+//
+pub struct CefBrowserHost {
+  c_object: *mut cef_browser_host_t,
+}
+
+impl Clone for CefBrowserHost {
+  fn clone(&self) -> CefBrowserHost{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefBrowserHost {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefBrowserHost {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefBrowserHost {
+  pub unsafe fn from_c_object(c_object: *mut cef_browser_host_t) -> CefBrowserHost {
+    CefBrowserHost {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_browser_host_t) -> CefBrowserHost {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefBrowserHost {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_browser_host_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_browser_host_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Returns the hosted browser object.
+  //
+  pub fn get_browser(&self) -> interfaces::CefBrowser {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_browser.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Request that the browser close. The JavaScript 'onbeforeunload' event will
+  // be fired. If |force_close| is false (0) the event handler, if any, will be
+  // allowed to prompt the user and the user can optionally cancel the close. If
+  // |force_close| is true (1) the prompt will not be displayed and the close
+  // will proceed. Results in a call to cef_life_span_handler_t::do_close() if
+  // the event handler allows the close or if |force_close| is true (1). See
+  // cef_life_span_handler_t::do_close() documentation for additional usage
+  // information.
+  //
+  pub fn close_browser(&self, force_close: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).close_browser.unwrap())(
+          self.c_object,
+          CefWrap::to_c(force_close)))
+    }
+  }
+
+  //
+  // Set whether the browser is focused.
+  //
+  pub fn set_focus(&self, focus: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_focus.unwrap())(
+          self.c_object,
+          CefWrap::to_c(focus)))
+    }
+  }
+
+  //
+  // Set whether the window containing the browser is visible
+  // (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X.
+  //
+  pub fn set_window_visibility(&self, visible: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_window_visibility.unwrap())(
+          self.c_object,
+          CefWrap::to_c(visible)))
+    }
+  }
+
+  //
+  // Retrieve the window handle for this browser.
+  //
+  pub fn get_window_handle(&self) -> types::cef_window_handle_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_window_handle.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Retrieve the window handle of the browser that opened this browser. Will
+  // return NULL for non-popup windows. This function can be used in combination
+  // with custom handling of modal windows.
+  //
+  pub fn get_opener_window_handle(&self) -> types::cef_window_handle_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_opener_window_handle.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the client for this browser.
+  //
+  pub fn get_client(&self) -> interfaces::CefClient {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_client.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the request context for this browser.
+  //
+  pub fn get_request_context(&self) -> interfaces::CefRequestContext {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_request_context.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Get the current zoom level. The default zoom level is 0.0. This function
+  // can only be called on the UI thread.
+  //
+  pub fn get_zoom_level(&self) -> libc::c_double {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_zoom_level.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Change the zoom level to the specified value. Specify 0.0 to reset the zoom
+  // level. If called on the UI thread the change will be applied immediately.
+  // Otherwise, the change will be applied asynchronously on the UI thread.
+  //
+  pub fn set_zoom_level(&self, zoomLevel: libc::c_double) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_zoom_level.unwrap())(
+          self.c_object,
+          CefWrap::to_c(zoomLevel)))
+    }
+  }
+
+  //
+  // Call to run a file chooser dialog. Only a single file chooser dialog may be
+  // pending at any given time. |mode| represents the type of dialog to display.
+  // |title| to the title to be used for the dialog and may be NULL to show the
+  // default title ("Open" or "Save" depending on the mode). |default_file_name|
+  // is the default file name to select in the dialog. |accept_types| is a list
+  // of valid lower-cased MIME types or file extensions specified in an input
+  // element and is used to restrict selectable files to such types. |callback|
+  // will be executed after the dialog is dismissed or immediately if another
+  // dialog is already pending. The dialog will be initiated asynchronously on
+  // the UI thread.
+  //
+  pub fn run_file_dialog(&self, mode: types::cef_file_dialog_mode_t,
+      title: &[u16], default_file_name: &[u16], accept_types: Vec<String>,
+      callback: interfaces::CefRunFileDialogCallback) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).run_file_dialog.unwrap())(
+          self.c_object,
+          CefWrap::to_c(mode),
+          CefWrap::to_c(title),
+          CefWrap::to_c(default_file_name),
+          CefWrap::to_c(accept_types),
+          CefWrap::to_c(callback)))
+    }
+  }
+
+  //
+  // Download the file at |url| using cef_download_handler_t.
+  //
+  pub fn start_download(&self, url: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).start_download.unwrap())(
+          self.c_object,
+          CefWrap::to_c(url)))
+    }
+  }
+
+  //
+  // Print the current browser contents.
+  //
+  pub fn print(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).print.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Search for |searchText|. |identifier| can be used to have multiple searches
+  // running simultaniously. |forward| indicates whether to search forward or
+  // backward within the page. |matchCase| indicates whether the search should
+  // be case-sensitive. |findNext| indicates whether this is the first request
+  // or a follow-up.
+  //
+  pub fn find(&self, identifier: libc::c_int, searchText: &[u16],
+      forward: libc::c_int, matchCase: libc::c_int, findNext: libc::c_int) -> (
+      ) {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).find.unwrap())(
+          self.c_object,
+          CefWrap::to_c(identifier),
+          CefWrap::to_c(searchText),
+          CefWrap::to_c(forward),
+          CefWrap::to_c(matchCase),
+          CefWrap::to_c(findNext)))
+    }
+  }
+
+  //
+  // Cancel all searches that are currently going on.
+  //
+  pub fn stop_finding(&self, clearSelection: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).stop_finding.unwrap())(
+          self.c_object,
+          CefWrap::to_c(clearSelection)))
+    }
+  }
+
+  //
+  // Open developer tools in its own window. If |inspect_element_at| is non-
+  // NULL the element at the specified (x,y) location will be inspected.
+  //
+  pub fn show_dev_tools(&self, windowInfo: &interfaces::CefWindowInfo,
+      client: interfaces::CefClient, settings: &interfaces::CefBrowserSettings,
+      inspect_element_at: &types::cef_point_t) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).show_dev_tools.unwrap())(
+          self.c_object,
+          CefWrap::to_c(windowInfo),
+          CefWrap::to_c(client),
+          CefWrap::to_c(settings),
+          CefWrap::to_c(inspect_element_at)))
+    }
+  }
+
+  //
+  // Explicitly close the developer tools window if one exists for this browser
+  // instance.
+  //
+  pub fn close_dev_tools(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).close_dev_tools.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Set whether mouse cursor change is disabled.
+  //
+  pub fn set_mouse_cursor_change_disabled(&self, disabled: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_mouse_cursor_change_disabled.unwrap())(
+          self.c_object,
+          CefWrap::to_c(disabled)))
+    }
+  }
+
+  //
+  // Returns true (1) if mouse cursor change is disabled.
+  //
+  pub fn is_mouse_cursor_change_disabled(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_mouse_cursor_change_disabled.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // If a misspelled word is currently selected in an editable node calling this
+  // function will replace it with the specified |word|.
+  //
+  pub fn replace_misspelling(&self, word: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).replace_misspelling.unwrap())(
+          self.c_object,
+          CefWrap::to_c(word)))
+    }
+  }
+
+  //
+  // Add the specified |word| to the spelling dictionary.
+  //
+  pub fn add_word_to_dictionary(&self, word: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).add_word_to_dictionary.unwrap())(
+          self.c_object,
+          CefWrap::to_c(word)))
+    }
+  }
+
+  //
+  // Returns true (1) if window rendering is disabled.
+  //
+  pub fn is_window_rendering_disabled(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_window_rendering_disabled.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Notify the browser that the widget has been resized. The browser will first
+  // call cef_render_handler_t::GetViewRect to get the new size and then call
+  // cef_render_handler_t::OnPaint asynchronously with the updated regions. This
+  // function is only used when window rendering is disabled.
+  //
+  pub fn was_resized(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).was_resized.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Notify the browser that it has been hidden or shown. Layouting and
+  // cef_render_handler_t::OnPaint notification will stop when the browser is
+  // hidden. This function is only used when window rendering is disabled.
+  //
+  pub fn was_hidden(&self, hidden: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).was_hidden.unwrap())(
+          self.c_object,
+          CefWrap::to_c(hidden)))
+    }
+  }
+
+  //
+  // Send a notification to the browser that the screen info has changed. The
+  // browser will then call cef_render_handler_t::GetScreenInfo to update the
+  // screen information with the new values. This simulates moving the webview
+  // window from one display to another, or changing the properties of the
+  // current display. This function is only used when window rendering is
+  // disabled.
+  //
+  pub fn notify_screen_info_changed(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).notify_screen_info_changed.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Invalidate the view. The browser will call cef_render_handler_t::OnPaint
+  // asynchronously. This function is only used when window rendering is
+  // disabled.
+  //
+  pub fn invalidate(&self, ty: types::cef_paint_element_type_t) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).invalidate.unwrap())(
+          self.c_object,
+          CefWrap::to_c(ty)))
+    }
+  }
+
+  //
+  // Send a key event to the browser.
+  //
+  pub fn send_key_event(&self, event: &interfaces::CefKeyEvent) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).send_key_event.unwrap())(
+          self.c_object,
+          CefWrap::to_c(event)))
+    }
+  }
+
+  //
+  // Send a mouse click event to the browser. The |x| and |y| coordinates are
+  // relative to the upper-left corner of the view.
+  //
+  pub fn send_mouse_click_event(&self, event: &interfaces::CefMouseEvent,
+      ty: types::cef_mouse_button_type_t, mouseUp: libc::c_int,
+      clickCount: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).send_mouse_click_event.unwrap())(
+          self.c_object,
+          CefWrap::to_c(event),
+          CefWrap::to_c(ty),
+          CefWrap::to_c(mouseUp),
+          CefWrap::to_c(clickCount)))
+    }
+  }
+
+  //
+  // Send a mouse move event to the browser. The |x| and |y| coordinates are
+  // relative to the upper-left corner of the view.
+  //
+  pub fn send_mouse_move_event(&self, event: &interfaces::CefMouseEvent,
+      mouseLeave: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).send_mouse_move_event.unwrap())(
+          self.c_object,
+          CefWrap::to_c(event),
+          CefWrap::to_c(mouseLeave)))
+    }
+  }
+
+  //
+  // Send a mouse wheel event to the browser. The |x| and |y| coordinates are
+  // relative to the upper-left corner of the view. The |deltaX| and |deltaY|
+  // values represent the movement delta in the X and Y directions respectively.
+  // In order to scroll inside select popups with window rendering disabled
+  // cef_render_handler_t::GetScreenPoint should be implemented properly.
+  //
+  pub fn send_mouse_wheel_event(&self, event: &interfaces::CefMouseEvent,
+      deltaX: libc::c_int, deltaY: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).send_mouse_wheel_event.unwrap())(
+          self.c_object,
+          CefWrap::to_c(event),
+          CefWrap::to_c(deltaX),
+          CefWrap::to_c(deltaY)))
+    }
+  }
+
+  //
+  // Send a focus event to the browser.
+  //
+  pub fn send_focus_event(&self, setFocus: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).send_focus_event.unwrap())(
+          self.c_object,
+          CefWrap::to_c(setFocus)))
+    }
+  }
+
+  //
+  // Send a capture lost event to the browser.
+  //
+  pub fn send_capture_lost_event(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).send_capture_lost_event.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Notify the browser that the window hosting it is about to be moved or
+  // resized. This function is only used on Windows and Linux.
+  //
+  pub fn notify_move_or_resize_started(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).notify_move_or_resize_started.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Get the NSTextInputContext implementation for enabling IME on Mac when
+  // window rendering is disabled.
+  //
+  pub fn get_nstext_input_context(&self) -> types::cef_text_input_context_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_nstext_input_context.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Handles a keyDown event prior to passing it through the NSTextInputClient
+  // machinery.
+  //
+  pub fn handle_key_event_before_text_input_client(&self,
+      keyEvent: types::cef_event_handle_t) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).handle_key_event_before_text_input_client.unwrap())(
+          self.c_object,
+          CefWrap::to_c(keyEvent)))
+    }
+  }
+
+  //
+  // Performs any additional actions after NSTextInputClient handles the event.
+  //
+  pub fn handle_key_event_after_text_input_client(&self,
+      keyEvent: types::cef_event_handle_t) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).handle_key_event_after_text_input_client.unwrap())(
+          self.c_object,
+          CefWrap::to_c(keyEvent)))
+    }
+  }
+
+  //
+  // Call this function when the user drags the mouse into the web view (before
+  // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data|
+  // should not contain file contents as this type of data is not allowed to be
+  // dragged into the web view. File contents can be removed using
+  // cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from
+  // cef_render_handler_t::StartDragging). This function is only used when
+  // window rendering is disabled.
+  //
+  pub fn drag_target_drag_enter(&self, drag_data: interfaces::CefDragData,
+      event: &interfaces::CefMouseEvent,
+      allowed_ops: types::cef_drag_operations_mask_t) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).drag_target_drag_enter.unwrap())(
+          self.c_object,
+          CefWrap::to_c(drag_data),
+          CefWrap::to_c(event),
+          CefWrap::to_c(allowed_ops)))
+    }
+  }
+
+  //
+  // Call this function each time the mouse is moved across the web view during
+  // a drag operation (after calling DragTargetDragEnter and before calling
+  // DragTargetDragLeave/DragTargetDrop). This function is only used when window
+  // rendering is disabled.
+  //
+  pub fn drag_target_drag_over(&self, event: &interfaces::CefMouseEvent,
+      allowed_ops: types::cef_drag_operations_mask_t) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).drag_target_drag_over.unwrap())(
+          self.c_object,
+          CefWrap::to_c(event),
+          CefWrap::to_c(allowed_ops)))
+    }
+  }
+
+  //
+  // Call this function when the user drags the mouse out of the web view (after
+  // calling DragTargetDragEnter). This function is only used when window
+  // rendering is disabled.
+  //
+  pub fn drag_target_drag_leave(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).drag_target_drag_leave.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Call this function when the user completes the drag operation by dropping
+  // the object onto the web view (after calling DragTargetDragEnter). The
+  // object being dropped is |drag_data|, given as an argument to the previous
+  // DragTargetDragEnter call. This function is only used when window rendering
+  // is disabled.
+  //
+  pub fn drag_target_drop(&self, event: &interfaces::CefMouseEvent) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).drag_target_drop.unwrap())(
+          self.c_object,
+          CefWrap::to_c(event)))
+    }
+  }
+
+  //
+  // Call this function when the drag operation started by a
+  // cef_render_handler_t::StartDragging call has ended either in a drop or by
+  // being cancelled. |x| and |y| are mouse coordinates relative to the upper-
+  // left corner of the view. If the web view is both the drag source and the
+  // drag target then all DragTarget* functions should be called before
+  // DragSource* mthods. This function is only used when window rendering is
+  // disabled.
+  //
+  pub fn drag_source_ended_at(&self, x: libc::c_int, y: libc::c_int,
+      op: types::cef_drag_operations_mask_t) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).drag_source_ended_at.unwrap())(
+          self.c_object,
+          CefWrap::to_c(x),
+          CefWrap::to_c(y),
+          CefWrap::to_c(op)))
+    }
+  }
+
+  //
+  // Call this function when the drag operation started by a
+  // cef_render_handler_t::StartDragging call has completed. This function may
+  // be called immediately without first calling DragSourceEndedAt to cancel a
+  // drag operation. If the web view is both the drag source and the drag target
+  // then all DragTarget* functions should be called before DragSource* mthods.
+  // This function is only used when window rendering is disabled.
+  //
+  pub fn drag_source_system_drag_ended(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).drag_source_system_drag_ended.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Instructs the browser to initialize accelerated compositing. The
+  // appropriate Direct3D or OpenGL state must have been set up before calling
+  // this function.
+  //
+  pub fn initialize_compositing(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).initialize_compositing.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Create a new browser window using the window parameters specified by
+  // |windowInfo|. All values will be copied internally and the actual window
+  // will be created on the UI thread. If |request_context| is NULL the global
+  // request context will be used. This function can be called on any browser
+  // process thread and will not block.
+  //
+  pub fn create_browser(windowInfo: &interfaces::CefWindowInfo,
+      client: interfaces::CefClient, url: &[u16],
+      settings: &interfaces::CefBrowserSettings,
+      request_context: interfaces::CefRequestContext) -> libc::c_int {
+    unsafe {
+      CefWrap::to_rust(
+        ::browser::cef_browser_host_create_browser(
+          CefWrap::to_c(windowInfo),
+          CefWrap::to_c(client),
+          CefWrap::to_c(url),
+          CefWrap::to_c(settings),
+          CefWrap::to_c(request_context)))
+    }
+  }
+
+  //
+  // Create a new browser window using the window parameters specified by
+  // |windowInfo|. If |request_context| is NULL the global request context will
+  // be used. This function can only be called on the browser process UI thread.
+  //
+  pub fn create_browser_sync(windowInfo: &interfaces::CefWindowInfo,
+      client: interfaces::CefClient, url: &[u16],
+      settings: &interfaces::CefBrowserSettings,
+      request_context: interfaces::CefRequestContext) -> interfaces::CefBrowser {
+    unsafe {
+      CefWrap::to_rust(
+        ::browser::cef_browser_host_create_browser_sync(
+          CefWrap::to_c(windowInfo),
+          CefWrap::to_c(client),
+          CefWrap::to_c(url),
+          CefWrap::to_c(settings),
+          CefWrap::to_c(request_context)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_browser_host_t> for CefBrowserHost {
+  fn to_c(rust_object: CefBrowserHost) -> *mut cef_browser_host_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_browser_host_t) -> CefBrowserHost {
+    CefBrowserHost::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_browser_host_t> for Option<CefBrowserHost> {
+  fn to_c(rust_object: Option<CefBrowserHost>) -> *mut cef_browser_host_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_browser_host_t) -> Option<CefBrowserHost> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefBrowserHost::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_browser_process_handler.rs
@@ -0,0 +1,272 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Structure used to implement browser process callbacks. The functions of this
+// structure will be called on the browser process main thread unless otherwise
+// indicated.
+//
+#[repr(C)]
+pub struct _cef_browser_process_handler_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Called on the browser process UI thread immediately after the CEF context
+  // has been initialized.
+  //
+  pub on_context_initialized: Option<extern "C" fn(
+      this: *mut cef_browser_process_handler_t) -> ()>,
+
+  //
+  // 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 function.
+  //
+  pub on_before_child_process_launch: Option<extern "C" fn(
+      this: *mut cef_browser_process_handler_t,
+      command_line: *mut interfaces::cef_command_line_t) -> ()>,
+
+  //
+  // 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
+  // cef_render_process_handler_t::on_render_thread_created() in the render
+  // process. Do not keep a reference to |extra_info| outside of this function.
+  //
+  pub on_render_process_thread_created: Option<extern "C" fn(
+      this: *mut cef_browser_process_handler_t,
+      extra_info: *mut interfaces::cef_list_value_t) -> ()>,
+
+  //
+  // Return the handler for printing on Linux. If a print handler is not
+  // provided then printing will not be supported on the Linux platform.
+  //
+  pub get_print_handler: Option<extern "C" fn(
+      this: *mut cef_browser_process_handler_t) -> *mut interfaces::cef_print_handler_t>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_browser_process_handler_t = _cef_browser_process_handler_t;
+
+
+//
+// Structure used to implement browser process callbacks. The functions of this
+// structure will be called on the browser process main thread unless otherwise
+// indicated.
+//
+pub struct CefBrowserProcessHandler {
+  c_object: *mut cef_browser_process_handler_t,
+}
+
+impl Clone for CefBrowserProcessHandler {
+  fn clone(&self) -> CefBrowserProcessHandler{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefBrowserProcessHandler {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefBrowserProcessHandler {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefBrowserProcessHandler {
+  pub unsafe fn from_c_object(c_object: *mut cef_browser_process_handler_t) -> CefBrowserProcessHandler {
+    CefBrowserProcessHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_browser_process_handler_t) -> CefBrowserProcessHandler {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefBrowserProcessHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_browser_process_handler_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_browser_process_handler_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Called on the browser process UI thread immediately after the CEF context
+  // has been initialized.
+  //
+  pub fn on_context_initialized(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_context_initialized.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // 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 function.
+  //
+  pub fn on_before_child_process_launch(&self,
+      command_line: interfaces::CefCommandLine) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_before_child_process_launch.unwrap())(
+          self.c_object,
+          CefWrap::to_c(command_line)))
+    }
+  }
+
+  //
+  // 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
+  // cef_render_process_handler_t::on_render_thread_created() in the render
+  // process. Do not keep a reference to |extra_info| outside of this function.
+  //
+  pub fn on_render_process_thread_created(&self,
+      extra_info: interfaces::CefListValue) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_render_process_thread_created.unwrap())(
+          self.c_object,
+          CefWrap::to_c(extra_info)))
+    }
+  }
+
+  //
+  // Return the handler for printing on Linux. If a print handler is not
+  // provided then printing will not be supported on the Linux platform.
+  //
+  pub fn get_print_handler(&self) -> interfaces::CefPrintHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_print_handler.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_browser_process_handler_t> for CefBrowserProcessHandler {
+  fn to_c(rust_object: CefBrowserProcessHandler) -> *mut cef_browser_process_handler_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_browser_process_handler_t) -> CefBrowserProcessHandler {
+    CefBrowserProcessHandler::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_browser_process_handler_t> for Option<CefBrowserProcessHandler> {
+  fn to_c(rust_object: Option<CefBrowserProcessHandler>) -> *mut cef_browser_process_handler_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_browser_process_handler_t) -> Option<CefBrowserProcessHandler> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefBrowserProcessHandler::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_callback.rs
@@ -0,0 +1,336 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Generic callback structure used for asynchronous continuation.
+//
+#[repr(C)]
+pub struct _cef_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Continue processing.
+  //
+  pub cont: Option<extern "C" fn(this: *mut cef_callback_t) -> ()>,
+
+  //
+  // Cancel processing.
+  //
+  pub cancel: Option<extern "C" fn(this: *mut cef_callback_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_callback_t = _cef_callback_t;
+
+
+//
+// Generic callback structure used for asynchronous continuation.
+//
+pub struct CefCallback {
+  c_object: *mut cef_callback_t,
+}
+
+impl Clone for CefCallback {
+  fn clone(&self) -> CefCallback{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_callback_t) -> CefCallback {
+    CefCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_callback_t) -> CefCallback {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_callback_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Continue processing.
+  //
+  pub fn cont(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cont.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Cancel processing.
+  //
+  pub fn cancel(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cancel.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_callback_t> for CefCallback {
+  fn to_c(rust_object: CefCallback) -> *mut cef_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_callback_t) -> CefCallback {
+    CefCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_callback_t> for Option<CefCallback> {
+  fn to_c(rust_object: Option<CefCallback>) -> *mut cef_callback_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_callback_t) -> Option<CefCallback> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Generic callback structure used for asynchronous completion.
+//
+#[repr(C)]
+pub struct _cef_completion_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Method that will be called once the task is complete.
+  //
+  pub on_complete: Option<extern "C" fn(
+      this: *mut cef_completion_callback_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_completion_callback_t = _cef_completion_callback_t;
+
+
+//
+// Generic callback structure used for asynchronous completion.
+//
+pub struct CefCompletionCallback {
+  c_object: *mut cef_completion_callback_t,
+}
+
+impl Clone for CefCompletionCallback {
+  fn clone(&self) -> CefCompletionCallback{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefCompletionCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefCompletionCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefCompletionCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_completion_callback_t) -> CefCompletionCallback {
+    CefCompletionCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_completion_callback_t) -> CefCompletionCallback {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefCompletionCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_completion_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_completion_callback_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Method that will be called once the task is complete.
+  //
+  pub fn on_complete(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_complete.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_completion_callback_t> for CefCompletionCallback {
+  fn to_c(rust_object: CefCompletionCallback) -> *mut cef_completion_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_completion_callback_t) -> CefCompletionCallback {
+    CefCompletionCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_completion_callback_t> for Option<CefCompletionCallback> {
+  fn to_c(rust_object: Option<CefCompletionCallback>) -> *mut cef_completion_callback_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_completion_callback_t) -> Option<CefCompletionCallback> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefCompletionCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_client.rs
@@ -0,0 +1,463 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Implement this structure to provide handler implementations.
+//
+#[repr(C)]
+pub struct _cef_client_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Return the handler for context menus. If no handler is provided the default
+  // implementation will be used.
+  //
+  pub get_context_menu_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_context_menu_handler_t>,
+
+  //
+  // Return the handler for dialogs. If no handler is provided the default
+  // implementation will be used.
+  //
+  pub get_dialog_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_dialog_handler_t>,
+
+  //
+  // Return the handler for browser display state events.
+  //
+  pub get_display_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_display_handler_t>,
+
+  //
+  // Return the handler for download events. If no handler is returned downloads
+  // will not be allowed.
+  //
+  pub get_download_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_download_handler_t>,
+
+  //
+  // Return the handler for drag events.
+  //
+  pub get_drag_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_drag_handler_t>,
+
+  //
+  // Return the handler for focus events.
+  //
+  pub get_focus_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_focus_handler_t>,
+
+  //
+  // Return the handler for geolocation permissions requests. If no handler is
+  // provided geolocation access will be denied by default.
+  //
+  pub get_geolocation_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_geolocation_handler_t>,
+
+  //
+  // Return the handler for JavaScript dialogs. If no handler is provided the
+  // default implementation will be used.
+  //
+  pub get_jsdialog_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_jsdialog_handler_t>,
+
+  //
+  // Return the handler for keyboard events.
+  //
+  pub get_keyboard_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_keyboard_handler_t>,
+
+  //
+  // Return the handler for browser life span events.
+  //
+  pub get_life_span_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_life_span_handler_t>,
+
+  //
+  // Return the handler for browser load status events.
+  //
+  pub get_load_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_load_handler_t>,
+
+  //
+  // Return the handler for off-screen rendering events.
+  //
+  pub get_render_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_render_handler_t>,
+
+  //
+  // Return the handler for browser request events.
+  //
+  pub get_request_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_request_handler_t>,
+
+  //
+  // Called when a new message is received from a different process. Return true
+  // (1) if the message was handled or false (0) otherwise. Do not keep a
+  // reference to or attempt to access the message outside of this callback.
+  //
+  pub on_process_message_received: Option<extern "C" fn(this: *mut cef_client_t,
+      browser: *mut interfaces::cef_browser_t,
+      source_process: interfaces::cef_process_id_t,
+      message: *mut interfaces::cef_process_message_t) -> libc::c_int>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_client_t = _cef_client_t;
+
+
+//
+// Implement this structure to provide handler implementations.
+//
+pub struct CefClient {
+  c_object: *mut cef_client_t,
+}
+
+impl Clone for CefClient {
+  fn clone(&self) -> CefClient{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefClient {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefClient {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefClient {
+  pub unsafe fn from_c_object(c_object: *mut cef_client_t) -> CefClient {
+    CefClient {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_client_t) -> CefClient {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefClient {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_client_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_client_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Return the handler for context menus. If no handler is provided the default
+  // implementation will be used.
+  //
+  pub fn get_context_menu_handler(&self) -> interfaces::CefContextMenuHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_context_menu_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for dialogs. If no handler is provided the default
+  // implementation will be used.
+  //
+  pub fn get_dialog_handler(&self) -> interfaces::CefDialogHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_dialog_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for browser display state events.
+  //
+  pub fn get_display_handler(&self) -> interfaces::CefDisplayHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_display_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for download events. If no handler is returned downloads
+  // will not be allowed.
+  //
+  pub fn get_download_handler(&self) -> interfaces::CefDownloadHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_download_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for drag events.
+  //
+  pub fn get_drag_handler(&self) -> interfaces::CefDragHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_drag_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for focus events.
+  //
+  pub fn get_focus_handler(&self) -> interfaces::CefFocusHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_focus_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for geolocation permissions requests. If no handler is
+  // provided geolocation access will be denied by default.
+  //
+  pub fn get_geolocation_handler(&self) -> interfaces::CefGeolocationHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_geolocation_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for JavaScript dialogs. If no handler is provided the
+  // default implementation will be used.
+  //
+  pub fn get_jsdialog_handler(&self) -> interfaces::CefJSDialogHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_jsdialog_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for keyboard events.
+  //
+  pub fn get_keyboard_handler(&self) -> interfaces::CefKeyboardHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_keyboard_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for browser life span events.
+  //
+  pub fn get_life_span_handler(&self) -> interfaces::CefLifeSpanHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_life_span_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for browser load status events.
+  //
+  pub fn get_load_handler(&self) -> interfaces::CefLoadHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_load_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for off-screen rendering events.
+  //
+  pub fn get_render_handler(&self) -> interfaces::CefRenderHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_render_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the handler for browser request events.
+  //
+  pub fn get_request_handler(&self) -> interfaces::CefRequestHandler {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_request_handler.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Called when a new message is received from a different process. Return true
+  // (1) if the message was handled or false (0) otherwise. Do not keep a
+  // reference to or attempt to access the message outside of this callback.
+  //
+  pub fn on_process_message_received(&self, browser: interfaces::CefBrowser,
+      source_process: interfaces::CefProcessId,
+      message: interfaces::CefProcessMessage) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_process_message_received.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(source_process),
+          CefWrap::to_c(message)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_client_t> for CefClient {
+  fn to_c(rust_object: CefClient) -> *mut cef_client_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_client_t) -> CefClient {
+    CefClient::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_client_t> for Option<CefClient> {
+  fn to_c(rust_object: Option<CefClient>) -> *mut cef_client_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_client_t) -> Option<CefClient> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefClient::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_command_line.rs
@@ -0,0 +1,643 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Structure used to create and/or parse command line arguments. Arguments with
+// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
+// will always precede any arguments without switch prefixes. Switches can
+// optionally have a value specified using the '=' delimiter (e.g.
+// "-switch=value"). An argument of "--" will terminate switch parsing with all
+// subsequent tokens, regardless of prefix, being interpreted as non-switch
+// arguments. Switch names are considered case-insensitive. This structure can
+// be used before cef_initialize() is called.
+//
+#[repr(C)]
+pub struct _cef_command_line_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns true (1) if this object is valid. Do not call any other functions
+  // if this function returns false (0).
+  //
+  pub is_valid: Option<extern "C" fn(
+      this: *mut cef_command_line_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the values of this object are read-only. Some APIs may
+  // expose read-only objects.
+  //
+  pub is_read_only: Option<extern "C" fn(
+      this: *mut cef_command_line_t) -> libc::c_int>,
+
+  //
+  // Returns a writable copy of this object.
+  //
+  pub copy: Option<extern "C" fn(
+      this: *mut cef_command_line_t) -> *mut interfaces::cef_command_line_t>,
+
+  //
+  // Initialize the command line with the specified |argc| and |argv| values.
+  // The first argument must be the name of the program. This function is only
+  // supported on non-Windows platforms.
+  //
+  pub init_from_argv: Option<extern "C" fn(this: *mut cef_command_line_t,
+      argc: libc::c_int, argv: *const *const libc::c_char) -> ()>,
+
+  //
+  // Initialize the command line with the string returned by calling
+  // GetCommandLineW(). This function is only supported on Windows.
+  //
+  pub init_from_string: Option<extern "C" fn(this: *mut cef_command_line_t,
+      command_line: *const types::cef_string_t) -> ()>,
+
+  //
+  // Reset the command-line switches and arguments but leave the program
+  // component unchanged.
+  //
+  pub reset: Option<extern "C" fn(this: *mut cef_command_line_t) -> ()>,
+
+  //
+  // Retrieve the original command line string as a vector of strings. The argv
+  // array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
+  //
+  pub get_argv: Option<extern "C" fn(this: *mut cef_command_line_t,
+      argv: types::cef_string_list_t) -> ()>,
+
+  //
+  // Constructs and returns the represented command line string. Use this
+  // function cautiously because quoting behavior is unclear.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_command_line_string: Option<extern "C" fn(
+      this: *mut cef_command_line_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Get the program part of the command line string (the first item).
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_program: Option<extern "C" fn(
+      this: *mut cef_command_line_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Set the program part of the command line string (the first item).
+  //
+  pub set_program: Option<extern "C" fn(this: *mut cef_command_line_t,
+      program: *const types::cef_string_t) -> ()>,
+
+  //
+  // Returns true (1) if the command line has switches.
+  //
+  pub has_switches: Option<extern "C" fn(
+      this: *mut cef_command_line_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the command line contains the given switch.
+  //
+  pub has_switch: Option<extern "C" fn(this: *mut cef_command_line_t,
+      name: *const types::cef_string_t) -> libc::c_int>,
+
+  //
+  // Returns the value associated with the given switch. If the switch has no
+  // value or isn't present this function returns the NULL string.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_switch_value: Option<extern "C" fn(this: *mut cef_command_line_t,
+      name: *const types::cef_string_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the map of switch names and values. If a switch has no value an
+  // NULL string is returned.
+  //
+  pub get_switches: Option<extern "C" fn(this: *mut cef_command_line_t,
+      switches: types::cef_string_map_t) -> ()>,
+
+  //
+  // Add a switch to the end of the command line. If the switch has no value
+  // pass an NULL value string.
+  //
+  pub append_switch: Option<extern "C" fn(this: *mut cef_command_line_t,
+      name: *const types::cef_string_t) -> ()>,
+
+  //
+  // Add a switch with the specified value to the end of the command line.
+  //
+  pub append_switch_with_value: Option<extern "C" fn(
+      this: *mut cef_command_line_t, name: *const types::cef_string_t,
+      value: *const types::cef_string_t) -> ()>,
+
+  //
+  // True if there are remaining command line arguments.
+  //
+  pub has_arguments: Option<extern "C" fn(
+      this: *mut cef_command_line_t) -> libc::c_int>,
+
+  //
+  // Get the remaining command line arguments.
+  //
+  pub get_arguments: Option<extern "C" fn(this: *mut cef_command_line_t,
+      arguments: types::cef_string_list_t) -> ()>,
+
+  //
+  // Add an argument to the end of the command line.
+  //
+  pub append_argument: Option<extern "C" fn(this: *mut cef_command_line_t,
+      argument: *const types::cef_string_t) -> ()>,
+
+  //
+  // Insert a command before the current command. Common for debuggers, like
+  // "valgrind" or "gdb --args".
+  //
+  pub prepend_wrapper: Option<extern "C" fn(this: *mut cef_command_line_t,
+      wrapper: *const types::cef_string_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_command_line_t = _cef_command_line_t;
+
+
+//
+// Structure used to create and/or parse command line arguments. Arguments with
+// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches
+// will always precede any arguments without switch prefixes. Switches can
+// optionally have a value specified using the '=' delimiter (e.g.
+// "-switch=value"). An argument of "--" will terminate switch parsing with all
+// subsequent tokens, regardless of prefix, being interpreted as non-switch
+// arguments. Switch names are considered case-insensitive. This structure can
+// be used before cef_initialize() is called.
+//
+pub struct CefCommandLine {
+  c_object: *mut cef_command_line_t,
+}
+
+impl Clone for CefCommandLine {
+  fn clone(&self) -> CefCommandLine{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefCommandLine {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefCommandLine {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefCommandLine {
+  pub unsafe fn from_c_object(c_object: *mut cef_command_line_t) -> CefCommandLine {
+    CefCommandLine {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_command_line_t) -> CefCommandLine {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefCommandLine {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_command_line_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_command_line_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Returns true (1) if this object is valid. Do not call any other functions
+  // if this function returns false (0).
+  //
+  pub fn is_valid(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_valid.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the values of this object are read-only. Some APIs may
+  // expose read-only objects.
+  //
+  pub fn is_read_only(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_read_only.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns a writable copy of this object.
+  //
+  pub fn copy(&self) -> interfaces::CefCommandLine {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).copy.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Initialize the command line with the specified |argc| and |argv| values.
+  // The first argument must be the name of the program. This function is only
+  // supported on non-Windows platforms.
+  //
+  pub fn init_from_argv(&self, argc: libc::c_int, argv: &&str) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).init_from_argv.unwrap())(
+          self.c_object,
+          CefWrap::to_c(argc),
+          CefWrap::to_c(argv)))
+    }
+  }
+
+  //
+  // Initialize the command line with the string returned by calling
+  // GetCommandLineW(). This function is only supported on Windows.
+  //
+  pub fn init_from_string(&self, command_line: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).init_from_string.unwrap())(
+          self.c_object,
+          CefWrap::to_c(command_line)))
+    }
+  }
+
+  //
+  // Reset the command-line switches and arguments but leave the program
+  // component unchanged.
+  //
+  pub fn reset(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).reset.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Retrieve the original command line string as a vector of strings. The argv
+  // array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
+  //
+  pub fn get_argv(&self, argv: Vec<String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_argv.unwrap())(
+          self.c_object,
+          CefWrap::to_c(argv)))
+    }
+  }
+
+  //
+  // Constructs and returns the represented command line string. Use this
+  // function cautiously because quoting behavior is unclear.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_command_line_string(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_command_line_string.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Get the program part of the command line string (the first item).
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_program(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_program.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Set the program part of the command line string (the first item).
+  //
+  pub fn set_program(&self, program: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_program.unwrap())(
+          self.c_object,
+          CefWrap::to_c(program)))
+    }
+  }
+
+  //
+  // Returns true (1) if the command line has switches.
+  //
+  pub fn has_switches(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_switches.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the command line contains the given switch.
+  //
+  pub fn has_switch(&self, name: &[u16]) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_switch.unwrap())(
+          self.c_object,
+          CefWrap::to_c(name)))
+    }
+  }
+
+  //
+  // Returns the value associated with the given switch. If the switch has no
+  // value or isn't present this function returns the NULL string.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_switch_value(&self, name: &[u16]) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_switch_value.unwrap())(
+          self.c_object,
+          CefWrap::to_c(name)))
+    }
+  }
+
+  //
+  // Returns the map of switch names and values. If a switch has no value an
+  // NULL string is returned.
+  //
+  pub fn get_switches(&self, switches: HashMap<String,String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_switches.unwrap())(
+          self.c_object,
+          CefWrap::to_c(switches)))
+    }
+  }
+
+  //
+  // Add a switch to the end of the command line. If the switch has no value
+  // pass an NULL value string.
+  //
+  pub fn append_switch(&self, name: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).append_switch.unwrap())(
+          self.c_object,
+          CefWrap::to_c(name)))
+    }
+  }
+
+  //
+  // Add a switch with the specified value to the end of the command line.
+  //
+  pub fn append_switch_with_value(&self, name: &[u16], value: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).append_switch_with_value.unwrap())(
+          self.c_object,
+          CefWrap::to_c(name),
+          CefWrap::to_c(value)))
+    }
+  }
+
+  //
+  // True if there are remaining command line arguments.
+  //
+  pub fn has_arguments(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_arguments.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Get the remaining command line arguments.
+  //
+  pub fn get_arguments(&self, arguments: Vec<String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_arguments.unwrap())(
+          self.c_object,
+          CefWrap::to_c(arguments)))
+    }
+  }
+
+  //
+  // Add an argument to the end of the command line.
+  //
+  pub fn append_argument(&self, argument: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).append_argument.unwrap())(
+          self.c_object,
+          CefWrap::to_c(argument)))
+    }
+  }
+
+  //
+  // Insert a command before the current command. Common for debuggers, like
+  // "valgrind" or "gdb --args".
+  //
+  pub fn prepend_wrapper(&self, wrapper: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).prepend_wrapper.unwrap())(
+          self.c_object,
+          CefWrap::to_c(wrapper)))
+    }
+  }
+
+  //
+  // Create a new cef_command_line_t instance.
+  //
+  pub fn create_command_line() -> interfaces::CefCommandLine {
+    unsafe {
+      CefWrap::to_rust(
+        ::command_line::cef_command_line_create_command_line(
+))
+    }
+  }
+
+  //
+  // Returns the singleton global cef_command_line_t object. The returned object
+  // will be read-only.
+  //
+  pub fn get_global_command_line() -> interfaces::CefCommandLine {
+    unsafe {
+      CefWrap::to_rust(
+        ::command_line::cef_command_line_get_global_command_line(
+))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_command_line_t> for CefCommandLine {
+  fn to_c(rust_object: CefCommandLine) -> *mut cef_command_line_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_command_line_t) -> CefCommandLine {
+    CefCommandLine::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_command_line_t> for Option<CefCommandLine> {
+  fn to_c(rust_object: Option<CefCommandLine>) -> *mut cef_command_line_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_command_line_t) -> Option<CefCommandLine> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefCommandLine::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_context_menu_handler.rs
@@ -0,0 +1,825 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Implement this structure to handle context menu events. The functions of this
+// structure will be called on the UI thread.
+//
+#[repr(C)]
+pub struct _cef_context_menu_handler_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Called before a context menu is displayed. |params| provides information
+  // about the context menu state. |model| initially contains the default
+  // context menu. The |model| can be cleared to show no context menu or
+  // modified to show a custom menu. Do not keep references to |params| or
+  // |model| outside of this callback.
+  //
+  pub on_before_context_menu: Option<extern "C" fn(
+      this: *mut cef_context_menu_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      frame: *mut interfaces::cef_frame_t,
+      params: *mut interfaces::cef_context_menu_params_t,
+      model: *mut interfaces::cef_menu_model_t) -> ()>,
+
+  //
+  // Called to execute a command selected from the context menu. Return true (1)
+  // if the command was handled or false (0) for the default implementation. See
+  // cef_menu_id_t for the command ids that have default implementations. All
+  // user-defined command ids should be between MENU_ID_USER_FIRST and
+  // MENU_ID_USER_LAST. |params| will have the same values as what was passed to
+  // on_before_context_menu(). Do not keep a reference to |params| outside of
+  // this callback.
+  //
+  pub on_context_menu_command: Option<extern "C" fn(
+      this: *mut cef_context_menu_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      frame: *mut interfaces::cef_frame_t,
+      params: *mut interfaces::cef_context_menu_params_t,
+      command_id: libc::c_int,
+      event_flags: types::cef_event_flags_t) -> libc::c_int>,
+
+  //
+  // Called when the context menu is dismissed irregardless of whether the menu
+  // was NULL or a command was selected.
+  //
+  pub on_context_menu_dismissed: Option<extern "C" fn(
+      this: *mut cef_context_menu_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      frame: *mut interfaces::cef_frame_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_context_menu_handler_t = _cef_context_menu_handler_t;
+
+
+//
+// Implement this structure to handle context menu events. The functions of this
+// structure will be called on the UI thread.
+//
+pub struct CefContextMenuHandler {
+  c_object: *mut cef_context_menu_handler_t,
+}
+
+impl Clone for CefContextMenuHandler {
+  fn clone(&self) -> CefContextMenuHandler{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefContextMenuHandler {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefContextMenuHandler {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefContextMenuHandler {
+  pub unsafe fn from_c_object(c_object: *mut cef_context_menu_handler_t) -> CefContextMenuHandler {
+    CefContextMenuHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_context_menu_handler_t) -> CefContextMenuHandler {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefContextMenuHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_context_menu_handler_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_context_menu_handler_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Called before a context menu is displayed. |params| provides information
+  // about the context menu state. |model| initially contains the default
+  // context menu. The |model| can be cleared to show no context menu or
+  // modified to show a custom menu. Do not keep references to |params| or
+  // |model| outside of this callback.
+  //
+  pub fn on_before_context_menu(&self, browser: interfaces::CefBrowser,
+      frame: interfaces::CefFrame, params: interfaces::CefContextMenuParams,
+      model: interfaces::CefMenuModel) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_before_context_menu.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(frame),
+          CefWrap::to_c(params),
+          CefWrap::to_c(model)))
+    }
+  }
+
+  //
+  // Called to execute a command selected from the context menu. Return true (1)
+  // if the command was handled or false (0) for the default implementation. See
+  // cef_menu_id_t for the command ids that have default implementations. All
+  // user-defined command ids should be between MENU_ID_USER_FIRST and
+  // MENU_ID_USER_LAST. |params| will have the same values as what was passed to
+  // on_before_context_menu(). Do not keep a reference to |params| outside of
+  // this callback.
+  //
+  pub fn on_context_menu_command(&self, browser: interfaces::CefBrowser,
+      frame: interfaces::CefFrame, params: interfaces::CefContextMenuParams,
+      command_id: libc::c_int,
+      event_flags: types::cef_event_flags_t) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_context_menu_command.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(frame),
+          CefWrap::to_c(params),
+          CefWrap::to_c(command_id),
+          CefWrap::to_c(event_flags)))
+    }
+  }
+
+  //
+  // Called when the context menu is dismissed irregardless of whether the menu
+  // was NULL or a command was selected.
+  //
+  pub fn on_context_menu_dismissed(&self, browser: interfaces::CefBrowser,
+      frame: interfaces::CefFrame) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_context_menu_dismissed.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(frame)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_context_menu_handler_t> for CefContextMenuHandler {
+  fn to_c(rust_object: CefContextMenuHandler) -> *mut cef_context_menu_handler_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_context_menu_handler_t) -> CefContextMenuHandler {
+    CefContextMenuHandler::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_context_menu_handler_t> for Option<CefContextMenuHandler> {
+  fn to_c(rust_object: Option<CefContextMenuHandler>) -> *mut cef_context_menu_handler_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_context_menu_handler_t) -> Option<CefContextMenuHandler> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefContextMenuHandler::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Provides information about the context menu state. The ethods of this
+// structure can only be accessed on browser process the UI thread.
+//
+#[repr(C)]
+pub struct _cef_context_menu_params_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns the X coordinate of the mouse where the context menu was invoked.
+  // Coords are relative to the associated RenderView's origin.
+  //
+  pub get_xcoord: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> libc::c_int>,
+
+  //
+  // Returns the Y coordinate of the mouse where the context menu was invoked.
+  // Coords are relative to the associated RenderView's origin.
+  //
+  pub get_ycoord: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> libc::c_int>,
+
+  //
+  // Returns flags representing the type of node that the context menu was
+  // invoked on.
+  //
+  pub get_type_flags: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_context_menu_type_flags_t>,
+
+  //
+  // Returns the URL of the link, if any, that encloses the node that the
+  // context menu was invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_link_url: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the link URL, if any, to be used ONLY for "copy link address". We
+  // don't validate this field in the frontend process.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_unfiltered_link_url: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the source URL, if any, for the element that the context menu was
+  // invoked on. Example of elements with source URLs are img, audio, and video.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_source_url: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns true (1) if the context menu was invoked on an image which has non-
+  // NULL contents.
+  //
+  pub has_image_contents: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> libc::c_int>,
+
+  //
+  // Returns the URL of the top level page that the context menu was invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_page_url: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the URL of the subframe that the context menu was invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_frame_url: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the character encoding of the subframe that the context menu was
+  // invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_frame_charset: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the type of context node that the context menu was invoked on.
+  //
+  pub get_media_type: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_context_menu_media_type_t>,
+
+  //
+  // Returns flags representing the actions supported by the media element, if
+  // any, that the context menu was invoked on.
+  //
+  pub get_media_state_flags: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_context_menu_media_state_flags_t>,
+
+  //
+  // Returns the text of the selection, if any, that the context menu was
+  // invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_selection_text: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the text of the misspelled word, if any, that the context menu was
+  // invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_misspelled_word: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the hash of the misspelled word, if any, that the context menu was
+  // invoked on.
+  //
+  pub get_misspelling_hash: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if suggestions exist, false (0) otherwise. Fills in
+  // |suggestions| from the spell check service for the misspelled word if there
+  // is one.
+  //
+  pub get_dictionary_suggestions: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t,
+      suggestions: types::cef_string_list_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the context menu was invoked on an editable node.
+  //
+  pub is_editable: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the context menu was invoked on an editable node where
+  // spell-check is enabled.
+  //
+  pub is_spell_check_enabled: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> libc::c_int>,
+
+  //
+  // Returns flags representing the actions supported by the editable node, if
+  // any, that the context menu was invoked on.
+  //
+  pub get_edit_state_flags: Option<extern "C" fn(
+      this: *mut cef_context_menu_params_t) -> types::cef_context_menu_edit_state_flags_t>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_context_menu_params_t = _cef_context_menu_params_t;
+
+
+//
+// Provides information about the context menu state. The ethods of this
+// structure can only be accessed on browser process the UI thread.
+//
+pub struct CefContextMenuParams {
+  c_object: *mut cef_context_menu_params_t,
+}
+
+impl Clone for CefContextMenuParams {
+  fn clone(&self) -> CefContextMenuParams{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefContextMenuParams {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefContextMenuParams {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefContextMenuParams {
+  pub unsafe fn from_c_object(c_object: *mut cef_context_menu_params_t) -> CefContextMenuParams {
+    CefContextMenuParams {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_context_menu_params_t) -> CefContextMenuParams {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefContextMenuParams {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_context_menu_params_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_context_menu_params_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Returns the X coordinate of the mouse where the context menu was invoked.
+  // Coords are relative to the associated RenderView's origin.
+  //
+  pub fn get_xcoord(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_xcoord.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the Y coordinate of the mouse where the context menu was invoked.
+  // Coords are relative to the associated RenderView's origin.
+  //
+  pub fn get_ycoord(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_ycoord.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns flags representing the type of node that the context menu was
+  // invoked on.
+  //
+  pub fn get_type_flags(&self) -> types::cef_context_menu_type_flags_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_type_flags.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the URL of the link, if any, that encloses the node that the
+  // context menu was invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_link_url(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_link_url.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the link URL, if any, to be used ONLY for "copy link address". We
+  // don't validate this field in the frontend process.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_unfiltered_link_url(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_unfiltered_link_url.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the source URL, if any, for the element that the context menu was
+  // invoked on. Example of elements with source URLs are img, audio, and video.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_source_url(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_source_url.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the context menu was invoked on an image which has non-
+  // NULL contents.
+  //
+  pub fn has_image_contents(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_image_contents.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the URL of the top level page that the context menu was invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_page_url(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_page_url.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the URL of the subframe that the context menu was invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_frame_url(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_frame_url.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the character encoding of the subframe that the context menu was
+  // invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_frame_charset(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_frame_charset.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the type of context node that the context menu was invoked on.
+  //
+  pub fn get_media_type(&self) -> types::cef_context_menu_media_type_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_media_type.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns flags representing the actions supported by the media element, if
+  // any, that the context menu was invoked on.
+  //
+  pub fn get_media_state_flags(
+      &self) -> types::cef_context_menu_media_state_flags_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_media_state_flags.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the text of the selection, if any, that the context menu was
+  // invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_selection_text(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_selection_text.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the text of the misspelled word, if any, that the context menu was
+  // invoked on.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_misspelled_word(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_misspelled_word.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the hash of the misspelled word, if any, that the context menu was
+  // invoked on.
+  //
+  pub fn get_misspelling_hash(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_misspelling_hash.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if suggestions exist, false (0) otherwise. Fills in
+  // |suggestions| from the spell check service for the misspelled word if there
+  // is one.
+  //
+  pub fn get_dictionary_suggestions(&self,
+      suggestions: Vec<String>) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_dictionary_suggestions.unwrap())(
+          self.c_object,
+          CefWrap::to_c(suggestions)))
+    }
+  }
+
+  //
+  // Returns true (1) if the context menu was invoked on an editable node.
+  //
+  pub fn is_editable(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_editable.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the context menu was invoked on an editable node where
+  // spell-check is enabled.
+  //
+  pub fn is_spell_check_enabled(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_spell_check_enabled.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns flags representing the actions supported by the editable node, if
+  // any, that the context menu was invoked on.
+  //
+  pub fn get_edit_state_flags(
+      &self) -> types::cef_context_menu_edit_state_flags_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_edit_state_flags.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_context_menu_params_t> for CefContextMenuParams {
+  fn to_c(rust_object: CefContextMenuParams) -> *mut cef_context_menu_params_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_context_menu_params_t) -> CefContextMenuParams {
+    CefContextMenuParams::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_context_menu_params_t> for Option<CefContextMenuParams> {
+  fn to_c(rust_object: Option<CefContextMenuParams>) -> *mut cef_context_menu_params_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_context_menu_params_t) -> Option<CefContextMenuParams> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefContextMenuParams::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_cookie.rs
@@ -0,0 +1,561 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Structure used for managing cookies. The functions of this structure may be
+// called on any thread unless otherwise indicated.
+//
+#[repr(C)]
+pub struct _cef_cookie_manager_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Set the schemes supported by this manager. By default only "http" and
+  // "https" schemes are supported. Must be called before any cookies are
+  // accessed.
+  //
+  pub set_supported_schemes: Option<extern "C" fn(
+      this: *mut cef_cookie_manager_t, schemes: types::cef_string_list_t) -> (
+      )>,
+
+  //
+  // Visit all cookies. The returned cookies are ordered by longest path, then
+  // by earliest creation date. Returns false (0) if cookies cannot be accessed.
+  //
+  pub visit_all_cookies: Option<extern "C" fn(this: *mut cef_cookie_manager_t,
+      visitor: *mut interfaces::cef_cookie_visitor_t) -> libc::c_int>,
+
+  //
+  // Visit a subset of cookies. The results are filtered by the given url
+  // scheme, host, domain and path. If |includeHttpOnly| is true (1) HTTP-only
+  // cookies will also be included in the results. The returned cookies are
+  // ordered by longest path, then by earliest creation date. Returns false (0)
+  // if cookies cannot be accessed.
+  //
+  pub visit_url_cookies: Option<extern "C" fn(this: *mut cef_cookie_manager_t,
+      url: *const types::cef_string_t, includeHttpOnly: libc::c_int,
+      visitor: *mut interfaces::cef_cookie_visitor_t) -> libc::c_int>,
+
+  //
+  // Sets a cookie given a valid URL and explicit user-provided cookie
+  // attributes. This function expects each attribute to be well-formed. It will
+  // check for disallowed characters (e.g. the ';' character is disallowed
+  // within the cookie value attribute) and will return false (0) without
+  // setting the cookie if such characters are found. This function must be
+  // called on the IO thread.
+  //
+  pub set_cookie: Option<extern "C" fn(this: *mut cef_cookie_manager_t,
+      url: *const types::cef_string_t,
+      cookie: *const interfaces::cef_cookie_t) -> libc::c_int>,
+
+  //
+  // Delete all cookies that match the specified parameters. If both |url| and
+  // values |cookie_name| are specified all host and domain cookies matching
+  // both will be deleted. If only |url| is specified all host cookies (but not
+  // domain cookies) irrespective of path will be deleted. If |url| is NULL all
+  // cookies for all hosts and domains will be deleted. Returns false (0) if a
+  // non- NULL invalid URL is specified or if cookies cannot be accessed. This
+  // function must be called on the IO thread.
+  //
+  pub delete_cookies: Option<extern "C" fn(this: *mut cef_cookie_manager_t,
+      url: *const types::cef_string_t,
+      cookie_name: *const types::cef_string_t) -> libc::c_int>,
+
+  //
+  // Sets the directory path that will be used for storing cookie data. If
+  // |path| is NULL data will be stored in memory only. Otherwise, data will be
+  // stored at the specified |path|. To persist session cookies (cookies without
+  // an expiry date or validity interval) set |persist_session_cookies| to true
+  // (1). Session cookies are generally intended to be transient and most Web
+  // browsers do not persist them. Returns false (0) if cookies cannot be
+  // accessed.
+  //
+  pub set_storage_path: Option<extern "C" fn(this: *mut cef_cookie_manager_t,
+      path: *const types::cef_string_t,
+      persist_session_cookies: libc::c_int) -> libc::c_int>,
+
+  //
+  // Flush the backing store (if any) to disk and execute the specified
+  // |callback| on the IO thread when done. Returns false (0) if cookies cannot
+  // be accessed.
+  //
+  pub flush_store: Option<extern "C" fn(this: *mut cef_cookie_manager_t,
+      callback: *mut interfaces::cef_completion_callback_t) -> libc::c_int>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_cookie_manager_t = _cef_cookie_manager_t;
+
+
+//
+// Structure used for managing cookies. The functions of this structure may be
+// called on any thread unless otherwise indicated.
+//
+pub struct CefCookieManager {
+  c_object: *mut cef_cookie_manager_t,
+}
+
+impl Clone for CefCookieManager {
+  fn clone(&self) -> CefCookieManager{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefCookieManager {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefCookieManager {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefCookieManager {
+  pub unsafe fn from_c_object(c_object: *mut cef_cookie_manager_t) -> CefCookieManager {
+    CefCookieManager {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_cookie_manager_t) -> CefCookieManager {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefCookieManager {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_cookie_manager_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_cookie_manager_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Set the schemes supported by this manager. By default only "http" and
+  // "https" schemes are supported. Must be called before any cookies are
+  // accessed.
+  //
+  pub fn set_supported_schemes(&self, schemes: Vec<String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_supported_schemes.unwrap())(
+          self.c_object,
+          CefWrap::to_c(schemes)))
+    }
+  }
+
+  //
+  // Visit all cookies. The returned cookies are ordered by longest path, then
+  // by earliest creation date. Returns false (0) if cookies cannot be accessed.
+  //
+  pub fn visit_all_cookies(&self,
+      visitor: interfaces::CefCookieVisitor) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).visit_all_cookies.unwrap())(
+          self.c_object,
+          CefWrap::to_c(visitor)))
+    }
+  }
+
+  //
+  // Visit a subset of cookies. The results are filtered by the given url
+  // scheme, host, domain and path. If |includeHttpOnly| is true (1) HTTP-only
+  // cookies will also be included in the results. The returned cookies are
+  // ordered by longest path, then by earliest creation date. Returns false (0)
+  // if cookies cannot be accessed.
+  //
+  pub fn visit_url_cookies(&self, url: &[u16], includeHttpOnly: libc::c_int,
+      visitor: interfaces::CefCookieVisitor) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).visit_url_cookies.unwrap())(
+          self.c_object,
+          CefWrap::to_c(url),
+          CefWrap::to_c(includeHttpOnly),
+          CefWrap::to_c(visitor)))
+    }
+  }
+
+  //
+  // Sets a cookie given a valid URL and explicit user-provided cookie
+  // attributes. This function expects each attribute to be well-formed. It will
+  // check for disallowed characters (e.g. the ';' character is disallowed
+  // within the cookie value attribute) and will return false (0) without
+  // setting the cookie if such characters are found. This function must be
+  // called on the IO thread.
+  //
+  pub fn set_cookie(&self, url: &[u16],
+      cookie: &interfaces::CefCookie) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_cookie.unwrap())(
+          self.c_object,
+          CefWrap::to_c(url),
+          CefWrap::to_c(cookie)))
+    }
+  }
+
+  //
+  // Delete all cookies that match the specified parameters. If both |url| and
+  // values |cookie_name| are specified all host and domain cookies matching
+  // both will be deleted. If only |url| is specified all host cookies (but not
+  // domain cookies) irrespective of path will be deleted. If |url| is NULL all
+  // cookies for all hosts and domains will be deleted. Returns false (0) if a
+  // non- NULL invalid URL is specified or if cookies cannot be accessed. This
+  // function must be called on the IO thread.
+  //
+  pub fn delete_cookies(&self, url: &[u16],
+      cookie_name: &[u16]) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).delete_cookies.unwrap())(
+          self.c_object,
+          CefWrap::to_c(url),
+          CefWrap::to_c(cookie_name)))
+    }
+  }
+
+  //
+  // Sets the directory path that will be used for storing cookie data. If
+  // |path| is NULL data will be stored in memory only. Otherwise, data will be
+  // stored at the specified |path|. To persist session cookies (cookies without
+  // an expiry date or validity interval) set |persist_session_cookies| to true
+  // (1). Session cookies are generally intended to be transient and most Web
+  // browsers do not persist them. Returns false (0) if cookies cannot be
+  // accessed.
+  //
+  pub fn set_storage_path(&self, path: &[u16],
+      persist_session_cookies: libc::c_int) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_storage_path.unwrap())(
+          self.c_object,
+          CefWrap::to_c(path),
+          CefWrap::to_c(persist_session_cookies)))
+    }
+  }
+
+  //
+  // Flush the backing store (if any) to disk and execute the specified
+  // |callback| on the IO thread when done. Returns false (0) if cookies cannot
+  // be accessed.
+  //
+  pub fn flush_store(&self,
+      callback: interfaces::CefCompletionCallback) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).flush_store.unwrap())(
+          self.c_object,
+          CefWrap::to_c(callback)))
+    }
+  }
+
+  //
+  // Returns the global cookie manager. By default data will be stored at
+  // CefSettings.cache_path if specified or in memory otherwise.
+  //
+  pub fn get_global_manager() -> interfaces::CefCookieManager {
+    unsafe {
+      CefWrap::to_rust(
+        ::cookie::cef_cookie_manager_get_global_manager(
+))
+    }
+  }
+
+  //
+  // Creates a new cookie manager. If |path| is NULL data will be stored in
+  // memory only. Otherwise, data will be stored at the specified |path|. To
+  // persist session cookies (cookies without an expiry date or validity
+  // interval) set |persist_session_cookies| to true (1). Session cookies are
+  // generally intended to be transient and most Web browsers do not persist
+  // them. Returns NULL if creation fails.
+  //
+  pub fn create_manager(path: &[u16],
+      persist_session_cookies: libc::c_int) -> interfaces::CefCookieManager {
+    unsafe {
+      CefWrap::to_rust(
+        ::cookie::cef_cookie_manager_create_manager(
+          CefWrap::to_c(path),
+          CefWrap::to_c(persist_session_cookies)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_cookie_manager_t> for CefCookieManager {
+  fn to_c(rust_object: CefCookieManager) -> *mut cef_cookie_manager_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_cookie_manager_t) -> CefCookieManager {
+    CefCookieManager::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_cookie_manager_t> for Option<CefCookieManager> {
+  fn to_c(rust_object: Option<CefCookieManager>) -> *mut cef_cookie_manager_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_cookie_manager_t) -> Option<CefCookieManager> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefCookieManager::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Structure to implement for visiting cookie values. The functions of this
+// structure will always be called on the IO thread.
+//
+#[repr(C)]
+pub struct _cef_cookie_visitor_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Method that will be called once for each cookie. |count| is the 0-based
+  // index for the current cookie. |total| is the total number of cookies. Set
+  // |deleteCookie| to true (1) to delete the cookie currently being visited.
+  // Return false (0) to stop visiting cookies. This function may never be
+  // called if no cookies are found.
+  //
+  pub visit: Option<extern "C" fn(this: *mut cef_cookie_visitor_t,
+      cookie: *const interfaces::cef_cookie_t, count: libc::c_int,
+      total: libc::c_int, deleteCookie: *mut libc::c_int) -> libc::c_int>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_cookie_visitor_t = _cef_cookie_visitor_t;
+
+
+//
+// Structure to implement for visiting cookie values. The functions of this
+// structure will always be called on the IO thread.
+//
+pub struct CefCookieVisitor {
+  c_object: *mut cef_cookie_visitor_t,
+}
+
+impl Clone for CefCookieVisitor {
+  fn clone(&self) -> CefCookieVisitor{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefCookieVisitor {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefCookieVisitor {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefCookieVisitor {
+  pub unsafe fn from_c_object(c_object: *mut cef_cookie_visitor_t) -> CefCookieVisitor {
+    CefCookieVisitor {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_cookie_visitor_t) -> CefCookieVisitor {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefCookieVisitor {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_cookie_visitor_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_cookie_visitor_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Method that will be called once for each cookie. |count| is the 0-based
+  // index for the current cookie. |total| is the total number of cookies. Set
+  // |deleteCookie| to true (1) to delete the cookie currently being visited.
+  // Return false (0) to stop visiting cookies. This function may never be
+  // called if no cookies are found.
+  //
+  pub fn visit(&self, cookie: &interfaces::CefCookie, count: libc::c_int,
+      total: libc::c_int, deleteCookie: &mut libc::c_int) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).visit.unwrap())(
+          self.c_object,
+          CefWrap::to_c(cookie),
+          CefWrap::to_c(count),
+          CefWrap::to_c(total),
+          CefWrap::to_c(deleteCookie)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_cookie_visitor_t> for CefCookieVisitor {
+  fn to_c(rust_object: CefCookieVisitor) -> *mut cef_cookie_visitor_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_cookie_visitor_t) -> CefCookieVisitor {
+    CefCookieVisitor::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_cookie_visitor_t> for Option<CefCookieVisitor> {
+  fn to_c(rust_object: Option<CefCookieVisitor>) -> *mut cef_cookie_visitor_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_cookie_visitor_t) -> Option<CefCookieVisitor> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefCookieVisitor::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_dialog_handler.rs
@@ -0,0 +1,374 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Callback structure for asynchronous continuation of file dialog requests.
+//
+#[repr(C)]
+pub struct _cef_file_dialog_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Continue the file selection with the specified |file_paths|. This may be a
+  // single value or a list of values depending on the dialog mode. An NULL
+  // value is treated the same as calling cancel().
+  //
+  pub cont: Option<extern "C" fn(this: *mut cef_file_dialog_callback_t,
+      file_paths: types::cef_string_list_t) -> ()>,
+
+  //
+  // Cancel the file selection.
+  //
+  pub cancel: Option<extern "C" fn(this: *mut cef_file_dialog_callback_t) -> (
+      )>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_file_dialog_callback_t = _cef_file_dialog_callback_t;
+
+
+//
+// Callback structure for asynchronous continuation of file dialog requests.
+//
+pub struct CefFileDialogCallback {
+  c_object: *mut cef_file_dialog_callback_t,
+}
+
+impl Clone for CefFileDialogCallback {
+  fn clone(&self) -> CefFileDialogCallback{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefFileDialogCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefFileDialogCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefFileDialogCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_file_dialog_callback_t) -> CefFileDialogCallback {
+    CefFileDialogCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_file_dialog_callback_t) -> CefFileDialogCallback {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefFileDialogCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_file_dialog_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_file_dialog_callback_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Continue the file selection with the specified |file_paths|. This may be a
+  // single value or a list of values depending on the dialog mode. An NULL
+  // value is treated the same as calling cancel().
+  //
+  pub fn cont(&self, file_paths: Vec<String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cont.unwrap())(
+          self.c_object,
+          CefWrap::to_c(file_paths)))
+    }
+  }
+
+  //
+  // Cancel the file selection.
+  //
+  pub fn cancel(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cancel.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_file_dialog_callback_t> for CefFileDialogCallback {
+  fn to_c(rust_object: CefFileDialogCallback) -> *mut cef_file_dialog_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_file_dialog_callback_t) -> CefFileDialogCallback {
+    CefFileDialogCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_file_dialog_callback_t> for Option<CefFileDialogCallback> {
+  fn to_c(rust_object: Option<CefFileDialogCallback>) -> *mut cef_file_dialog_callback_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_file_dialog_callback_t) -> Option<CefFileDialogCallback> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefFileDialogCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Implement this structure to handle dialog events. The functions of this
+// structure will be called on the browser process UI thread.
+//
+#[repr(C)]
+pub struct _cef_dialog_handler_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Called to run a file chooser dialog. |mode| represents the type of dialog
+  // to display. |title| to the title to be used for the dialog and may be NULL
+  // to show the default title ("Open" or "Save" depending on the mode).
+  // |default_file_name| is the default file name to select in the dialog.
+  // |accept_types| is a list of valid lower-cased MIME types or file extensions
+  // specified in an input element and is used to restrict selectable files to
+  // such types. To display a custom dialog return true (1) and execute
+  // |callback| either inline or at a later time. To display the default dialog
+  // return false (0).
+  //
+  pub on_file_dialog: Option<extern "C" fn(this: *mut cef_dialog_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      mode: types::cef_file_dialog_mode_t, title: *const types::cef_string_t,
+      default_file_name: *const types::cef_string_t,
+      accept_types: types::cef_string_list_t,
+      callback: *mut interfaces::cef_file_dialog_callback_t) -> libc::c_int>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_dialog_handler_t = _cef_dialog_handler_t;
+
+
+//
+// Implement this structure to handle dialog events. The functions of this
+// structure will be called on the browser process UI thread.
+//
+pub struct CefDialogHandler {
+  c_object: *mut cef_dialog_handler_t,
+}
+
+impl Clone for CefDialogHandler {
+  fn clone(&self) -> CefDialogHandler{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDialogHandler {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDialogHandler {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDialogHandler {
+  pub unsafe fn from_c_object(c_object: *mut cef_dialog_handler_t) -> CefDialogHandler {
+    CefDialogHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_dialog_handler_t) -> CefDialogHandler {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDialogHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_dialog_handler_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_dialog_handler_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Called to run a file chooser dialog. |mode| represents the type of dialog
+  // to display. |title| to the title to be used for the dialog and may be NULL
+  // to show the default title ("Open" or "Save" depending on the mode).
+  // |default_file_name| is the default file name to select in the dialog.
+  // |accept_types| is a list of valid lower-cased MIME types or file extensions
+  // specified in an input element and is used to restrict selectable files to
+  // such types. To display a custom dialog return true (1) and execute
+  // |callback| either inline or at a later time. To display the default dialog
+  // return false (0).
+  //
+  pub fn on_file_dialog(&self, browser: interfaces::CefBrowser,
+      mode: types::cef_file_dialog_mode_t, title: &[u16],
+      default_file_name: &[u16], accept_types: Vec<String>,
+      callback: interfaces::CefFileDialogCallback) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_file_dialog.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(mode),
+          CefWrap::to_c(title),
+          CefWrap::to_c(default_file_name),
+          CefWrap::to_c(accept_types),
+          CefWrap::to_c(callback)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_dialog_handler_t> for CefDialogHandler {
+  fn to_c(rust_object: CefDialogHandler) -> *mut cef_dialog_handler_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_dialog_handler_t) -> CefDialogHandler {
+    CefDialogHandler::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_dialog_handler_t> for Option<CefDialogHandler> {
+  fn to_c(rust_object: Option<CefDialogHandler>) -> *mut cef_dialog_handler_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_dialog_handler_t) -> Option<CefDialogHandler> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDialogHandler::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_display_handler.rs
@@ -0,0 +1,303 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Implement this structure to handle events related to browser display state.
+// The functions of this structure will be called on the UI thread.
+//
+#[repr(C)]
+pub struct _cef_display_handler_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Called when a frame's address has changed.
+  //
+  pub on_address_change: Option<extern "C" fn(this: *mut cef_display_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      frame: *mut interfaces::cef_frame_t,
+      url: *const types::cef_string_t) -> ()>,
+
+  //
+  // Called when the page title changes.
+  //
+  pub on_title_change: Option<extern "C" fn(this: *mut cef_display_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      title: *const types::cef_string_t) -> ()>,
+
+  //
+  // Called when the browser is about to display a tooltip. |text| contains the
+  // text that will be displayed in the tooltip. To handle the display of the
+  // tooltip yourself return true (1). Otherwise, you can optionally modify
+  // |text| and then return false (0) to allow the browser to display the
+  // tooltip. When window rendering is disabled the application is responsible
+  // for drawing tooltips and the return value is ignored.
+  //
+  pub on_tooltip: Option<extern "C" fn(this: *mut cef_display_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      text: *mut types::cef_string_t) -> libc::c_int>,
+
+  //
+  // Called when the browser receives a status message. |value| contains the
+  // text that will be displayed in the status message.
+  //
+  pub on_status_message: Option<extern "C" fn(this: *mut cef_display_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      value: *const types::cef_string_t) -> ()>,
+
+  //
+  // Called to display a console message. Return true (1) to stop the message
+  // from being output to the console.
+  //
+  pub on_console_message: Option<extern "C" fn(this: *mut cef_display_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      message: *const types::cef_string_t, source: *const types::cef_string_t,
+      line: libc::c_int) -> libc::c_int>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_display_handler_t = _cef_display_handler_t;
+
+
+//
+// Implement this structure to handle events related to browser display state.
+// The functions of this structure will be called on the UI thread.
+//
+pub struct CefDisplayHandler {
+  c_object: *mut cef_display_handler_t,
+}
+
+impl Clone for CefDisplayHandler {
+  fn clone(&self) -> CefDisplayHandler{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDisplayHandler {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDisplayHandler {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDisplayHandler {
+  pub unsafe fn from_c_object(c_object: *mut cef_display_handler_t) -> CefDisplayHandler {
+    CefDisplayHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_display_handler_t) -> CefDisplayHandler {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDisplayHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_display_handler_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_display_handler_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Called when a frame's address has changed.
+  //
+  pub fn on_address_change(&self, browser: interfaces::CefBrowser,
+      frame: interfaces::CefFrame, url: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_address_change.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(frame),
+          CefWrap::to_c(url)))
+    }
+  }
+
+  //
+  // Called when the page title changes.
+  //
+  pub fn on_title_change(&self, browser: interfaces::CefBrowser,
+      title: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_title_change.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(title)))
+    }
+  }
+
+  //
+  // Called when the browser is about to display a tooltip. |text| contains the
+  // text that will be displayed in the tooltip. To handle the display of the
+  // tooltip yourself return true (1). Otherwise, you can optionally modify
+  // |text| and then return false (0) to allow the browser to display the
+  // tooltip. When window rendering is disabled the application is responsible
+  // for drawing tooltips and the return value is ignored.
+  //
+  pub fn on_tooltip(&self, browser: interfaces::CefBrowser,
+      text: *mut types::cef_string_t) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_tooltip.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(text)))
+    }
+  }
+
+  //
+  // Called when the browser receives a status message. |value| contains the
+  // text that will be displayed in the status message.
+  //
+  pub fn on_status_message(&self, browser: interfaces::CefBrowser,
+      value: &[u16]) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_status_message.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(value)))
+    }
+  }
+
+  //
+  // Called to display a console message. Return true (1) to stop the message
+  // from being output to the console.
+  //
+  pub fn on_console_message(&self, browser: interfaces::CefBrowser,
+      message: &[u16], source: &[u16], line: libc::c_int) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_console_message.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(message),
+          CefWrap::to_c(source),
+          CefWrap::to_c(line)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_display_handler_t> for CefDisplayHandler {
+  fn to_c(rust_object: CefDisplayHandler) -> *mut cef_display_handler_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_display_handler_t) -> CefDisplayHandler {
+    CefDisplayHandler::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_display_handler_t> for Option<CefDisplayHandler> {
+  fn to_c(rust_object: Option<CefDisplayHandler>) -> *mut cef_display_handler_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_display_handler_t) -> Option<CefDisplayHandler> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDisplayHandler::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_dom.rs
@@ -0,0 +1,1295 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Structure to implement for visiting the DOM. The functions of this structure
+// will be called on the render process main thread.
+//
+#[repr(C)]
+pub struct _cef_domvisitor_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Method executed for visiting the DOM. The document object passed to this
+  // function represents a snapshot of the DOM at the time this function is
+  // executed. DOM objects are only valid for the scope of this function. Do not
+  // keep references to or attempt to access any DOM objects outside the scope
+  // of this function.
+  //
+  pub visit: Option<extern "C" fn(this: *mut cef_domvisitor_t,
+      document: *mut interfaces::cef_domdocument_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_domvisitor_t = _cef_domvisitor_t;
+
+
+//
+// Structure to implement for visiting the DOM. The functions of this structure
+// will be called on the render process main thread.
+//
+pub struct CefDOMVisitor {
+  c_object: *mut cef_domvisitor_t,
+}
+
+impl Clone for CefDOMVisitor {
+  fn clone(&self) -> CefDOMVisitor{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDOMVisitor {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDOMVisitor {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDOMVisitor {
+  pub unsafe fn from_c_object(c_object: *mut cef_domvisitor_t) -> CefDOMVisitor {
+    CefDOMVisitor {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_domvisitor_t) -> CefDOMVisitor {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDOMVisitor {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_domvisitor_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_domvisitor_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Method executed for visiting the DOM. The document object passed to this
+  // function represents a snapshot of the DOM at the time this function is
+  // executed. DOM objects are only valid for the scope of this function. Do not
+  // keep references to or attempt to access any DOM objects outside the scope
+  // of this function.
+  //
+  pub fn visit(&self, document: interfaces::CefDOMDocument) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).visit.unwrap())(
+          self.c_object,
+          CefWrap::to_c(document)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_domvisitor_t> for CefDOMVisitor {
+  fn to_c(rust_object: CefDOMVisitor) -> *mut cef_domvisitor_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_domvisitor_t) -> CefDOMVisitor {
+    CefDOMVisitor::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_domvisitor_t> for Option<CefDOMVisitor> {
+  fn to_c(rust_object: Option<CefDOMVisitor>) -> *mut cef_domvisitor_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_domvisitor_t) -> Option<CefDOMVisitor> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDOMVisitor::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Structure used to represent a DOM document. The functions of this structure
+// should only be called on the render process main thread thread.
+//
+#[repr(C)]
+pub struct _cef_domdocument_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns the document type.
+  //
+  pub get_type: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> types::cef_dom_document_type_t>,
+
+  //
+  // Returns the root document node.
+  //
+  pub get_document: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the BODY node of an HTML document.
+  //
+  pub get_body: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the HEAD node of an HTML document.
+  //
+  pub get_head: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the title of an HTML document.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_title: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the document element with the specified ID value.
+  //
+  pub get_element_by_id: Option<extern "C" fn(this: *mut cef_domdocument_t,
+      id: *const types::cef_string_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the node that currently has keyboard focus.
+  //
+  pub get_focused_node: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns true (1) if a portion of the document is selected.
+  //
+  pub has_selection: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> libc::c_int>,
+
+  //
+  // Returns the selection start node.
+  //
+  pub get_selection_start_node: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the selection offset within the start node.
+  //
+  pub get_selection_start_offset: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> libc::c_int>,
+
+  //
+  // Returns the selection end node.
+  //
+  pub get_selection_end_node: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the selection offset within the end node.
+  //
+  pub get_selection_end_offset: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> libc::c_int>,
+
+  //
+  // Returns the contents of this selection as markup.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_selection_as_markup: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the contents of this selection as text.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_selection_as_text: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the base URL for the document.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_base_url: Option<extern "C" fn(
+      this: *mut cef_domdocument_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns a complete URL based on the document base URL and the specified
+  // partial URL.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_complete_url: Option<extern "C" fn(this: *mut cef_domdocument_t,
+      partialURL: *const types::cef_string_t) -> types::cef_string_userfree_t>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_domdocument_t = _cef_domdocument_t;
+
+
+//
+// Structure used to represent a DOM document. The functions of this structure
+// should only be called on the render process main thread thread.
+//
+pub struct CefDOMDocument {
+  c_object: *mut cef_domdocument_t,
+}
+
+impl Clone for CefDOMDocument {
+  fn clone(&self) -> CefDOMDocument{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDOMDocument {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDOMDocument {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDOMDocument {
+  pub unsafe fn from_c_object(c_object: *mut cef_domdocument_t) -> CefDOMDocument {
+    CefDOMDocument {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_domdocument_t) -> CefDOMDocument {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDOMDocument {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_domdocument_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_domdocument_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Returns the document type.
+  //
+  pub fn get_type(&self) -> types::cef_dom_document_type_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_type.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the root document node.
+  //
+  pub fn get_document(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_document.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the BODY node of an HTML document.
+  //
+  pub fn get_body(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_body.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the HEAD node of an HTML document.
+  //
+  pub fn get_head(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_head.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the title of an HTML document.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_title(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_title.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the document element with the specified ID value.
+  //
+  pub fn get_element_by_id(&self, id: &[u16]) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_element_by_id.unwrap())(
+          self.c_object,
+          CefWrap::to_c(id)))
+    }
+  }
+
+  //
+  // Returns the node that currently has keyboard focus.
+  //
+  pub fn get_focused_node(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_focused_node.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if a portion of the document is selected.
+  //
+  pub fn has_selection(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_selection.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the selection start node.
+  //
+  pub fn get_selection_start_node(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_selection_start_node.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the selection offset within the start node.
+  //
+  pub fn get_selection_start_offset(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_selection_start_offset.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the selection end node.
+  //
+  pub fn get_selection_end_node(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_selection_end_node.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the selection offset within the end node.
+  //
+  pub fn get_selection_end_offset(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_selection_end_offset.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the contents of this selection as markup.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_selection_as_markup(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_selection_as_markup.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the contents of this selection as text.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_selection_as_text(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_selection_as_text.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the base URL for the document.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_base_url(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_base_url.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns a complete URL based on the document base URL and the specified
+  // partial URL.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_complete_url(&self, partialURL: &[u16]) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_complete_url.unwrap())(
+          self.c_object,
+          CefWrap::to_c(partialURL)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_domdocument_t> for CefDOMDocument {
+  fn to_c(rust_object: CefDOMDocument) -> *mut cef_domdocument_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_domdocument_t) -> CefDOMDocument {
+    CefDOMDocument::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_domdocument_t> for Option<CefDOMDocument> {
+  fn to_c(rust_object: Option<CefDOMDocument>) -> *mut cef_domdocument_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_domdocument_t) -> Option<CefDOMDocument> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDOMDocument::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Structure used to represent a DOM node. The functions of this structure
+// should only be called on the render process main thread.
+//
+#[repr(C)]
+pub struct _cef_domnode_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns the type for this node.
+  //
+  pub get_type: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> types::cef_dom_node_type_t>,
+
+  //
+  // Returns true (1) if this is a text node.
+  //
+  pub is_text: Option<extern "C" fn(this: *mut cef_domnode_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if this is an element node.
+  //
+  pub is_element: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if this is an editable node.
+  //
+  pub is_editable: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if this is a form control element node.
+  //
+  pub is_form_control_element: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> libc::c_int>,
+
+  //
+  // Returns the type of this form control element node.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_form_control_element_type: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns true (1) if this object is pointing to the same handle as |that|
+  // object.
+  //
+  pub is_same: Option<extern "C" fn(this: *mut cef_domnode_t,
+      that: *mut interfaces::cef_domnode_t) -> libc::c_int>,
+
+  //
+  // Returns the name of this node.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_name: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the value of this node.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_value: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Set the value of this node. Returns true (1) on success.
+  //
+  pub set_value: Option<extern "C" fn(this: *mut cef_domnode_t,
+      value: *const types::cef_string_t) -> libc::c_int>,
+
+  //
+  // Returns the contents of this node as markup.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_as_markup: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the document associated with this node.
+  //
+  pub get_document: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> *mut interfaces::cef_domdocument_t>,
+
+  //
+  // Returns the parent node.
+  //
+  pub get_parent: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the previous sibling node.
+  //
+  pub get_previous_sibling: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the next sibling node.
+  //
+  pub get_next_sibling: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns true (1) if this node has child nodes.
+  //
+  pub has_children: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> libc::c_int>,
+
+  //
+  // Return the first child node.
+  //
+  pub get_first_child: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> *mut interfaces::cef_domnode_t>,
+
+  //
+  // Returns the last child node.
+  //
+  pub get_last_child: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> *mut interfaces::cef_domnode_t>,
+
+
+  // The following functions are valid only for element nodes.
+
+  //
+  // Returns the tag name of this element.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_element_tag_name: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns true (1) if this element has attributes.
+  //
+  pub has_element_attributes: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if this element has an attribute named |attrName|.
+  //
+  pub has_element_attribute: Option<extern "C" fn(this: *mut cef_domnode_t,
+      attrName: *const types::cef_string_t) -> libc::c_int>,
+
+  //
+  // Returns the element attribute named |attrName|.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_element_attribute: Option<extern "C" fn(this: *mut cef_domnode_t,
+      attrName: *const types::cef_string_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns a map of all element attributes.
+  //
+  pub get_element_attributes: Option<extern "C" fn(this: *mut cef_domnode_t,
+      attrMap: types::cef_string_map_t) -> ()>,
+
+  //
+  // Set the value for the element attribute named |attrName|. Returns true (1)
+  // on success.
+  //
+  pub set_element_attribute: Option<extern "C" fn(this: *mut cef_domnode_t,
+      attrName: *const types::cef_string_t,
+      value: *const types::cef_string_t) -> libc::c_int>,
+
+  //
+  // Returns the inner text of the element.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_element_inner_text: Option<extern "C" fn(
+      this: *mut cef_domnode_t) -> types::cef_string_userfree_t>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_domnode_t = _cef_domnode_t;
+
+
+//
+// Structure used to represent a DOM node. The functions of this structure
+// should only be called on the render process main thread.
+//
+pub struct CefDOMNode {
+  c_object: *mut cef_domnode_t,
+}
+
+impl Clone for CefDOMNode {
+  fn clone(&self) -> CefDOMNode{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDOMNode {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDOMNode {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDOMNode {
+  pub unsafe fn from_c_object(c_object: *mut cef_domnode_t) -> CefDOMNode {
+    CefDOMNode {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_domnode_t) -> CefDOMNode {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDOMNode {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_domnode_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_domnode_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Returns the type for this node.
+  //
+  pub fn get_type(&self) -> types::cef_dom_node_type_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_type.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this is a text node.
+  //
+  pub fn is_text(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_text.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this is an element node.
+  //
+  pub fn is_element(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_element.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this is an editable node.
+  //
+  pub fn is_editable(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_editable.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this is a form control element node.
+  //
+  pub fn is_form_control_element(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_form_control_element.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the type of this form control element node.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_form_control_element_type(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_form_control_element_type.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this object is pointing to the same handle as |that|
+  // object.
+  //
+  pub fn is_same(&self, that: interfaces::CefDOMNode) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_same.unwrap())(
+          self.c_object,
+          CefWrap::to_c(that)))
+    }
+  }
+
+  //
+  // Returns the name of this node.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_name(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_name.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the value of this node.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_value(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_value.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Set the value of this node. Returns true (1) on success.
+  //
+  pub fn set_value(&self, value: &[u16]) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_value.unwrap())(
+          self.c_object,
+          CefWrap::to_c(value)))
+    }
+  }
+
+  //
+  // Returns the contents of this node as markup.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_as_markup(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_as_markup.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the document associated with this node.
+  //
+  pub fn get_document(&self) -> interfaces::CefDOMDocument {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_document.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the parent node.
+  //
+  pub fn get_parent(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_parent.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the previous sibling node.
+  //
+  pub fn get_previous_sibling(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_previous_sibling.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the next sibling node.
+  //
+  pub fn get_next_sibling(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_next_sibling.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this node has child nodes.
+  //
+  pub fn has_children(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_children.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Return the first child node.
+  //
+  pub fn get_first_child(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_first_child.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the last child node.
+  //
+  pub fn get_last_child(&self) -> interfaces::CefDOMNode {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_last_child.unwrap())(
+          self.c_object))
+    }
+  }
+
+
+  // The following functions are valid only for element nodes.
+
+  //
+  // Returns the tag name of this element.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_element_tag_name(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_element_tag_name.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this element has attributes.
+  //
+  pub fn has_element_attributes(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_element_attributes.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if this element has an attribute named |attrName|.
+  //
+  pub fn has_element_attribute(&self, attrName: &[u16]) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).has_element_attribute.unwrap())(
+          self.c_object,
+          CefWrap::to_c(attrName)))
+    }
+  }
+
+  //
+  // Returns the element attribute named |attrName|.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_element_attribute(&self, attrName: &[u16]) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_element_attribute.unwrap())(
+          self.c_object,
+          CefWrap::to_c(attrName)))
+    }
+  }
+
+  //
+  // Returns a map of all element attributes.
+  //
+  pub fn get_element_attributes(&self, attrMap: HashMap<String,String>) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_element_attributes.unwrap())(
+          self.c_object,
+          CefWrap::to_c(attrMap)))
+    }
+  }
+
+  //
+  // Set the value for the element attribute named |attrName|. Returns true (1)
+  // on success.
+  //
+  pub fn set_element_attribute(&self, attrName: &[u16],
+      value: &[u16]) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).set_element_attribute.unwrap())(
+          self.c_object,
+          CefWrap::to_c(attrName),
+          CefWrap::to_c(value)))
+    }
+  }
+
+  //
+  // Returns the inner text of the element.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_element_inner_text(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_element_inner_text.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_domnode_t> for CefDOMNode {
+  fn to_c(rust_object: CefDOMNode) -> *mut cef_domnode_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_domnode_t) -> CefDOMNode {
+    CefDOMNode::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_domnode_t> for Option<CefDOMNode> {
+  fn to_c(rust_object: Option<CefDOMNode>) -> *mut cef_domnode_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_domnode_t) -> Option<CefDOMNode> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDOMNode::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_download_handler.rs
@@ -0,0 +1,519 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Callback structure used to asynchronously continue a download.
+//
+#[repr(C)]
+pub struct _cef_before_download_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Call to continue the download. Set |download_path| to the full file path
+  // for the download including the file name or leave blank to use the
+  // suggested name and the default temp directory. Set |show_dialog| to true
+  // (1) if you do wish to show the default "Save As" dialog.
+  //
+  pub cont: Option<extern "C" fn(this: *mut cef_before_download_callback_t,
+      download_path: *const types::cef_string_t, show_dialog: libc::c_int) -> (
+      )>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_before_download_callback_t = _cef_before_download_callback_t;
+
+
+//
+// Callback structure used to asynchronously continue a download.
+//
+pub struct CefBeforeDownloadCallback {
+  c_object: *mut cef_before_download_callback_t,
+}
+
+impl Clone for CefBeforeDownloadCallback {
+  fn clone(&self) -> CefBeforeDownloadCallback{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefBeforeDownloadCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefBeforeDownloadCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefBeforeDownloadCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_before_download_callback_t) -> CefBeforeDownloadCallback {
+    CefBeforeDownloadCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_before_download_callback_t) -> CefBeforeDownloadCallback {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefBeforeDownloadCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_before_download_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_before_download_callback_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Call to continue the download. Set |download_path| to the full file path
+  // for the download including the file name or leave blank to use the
+  // suggested name and the default temp directory. Set |show_dialog| to true
+  // (1) if you do wish to show the default "Save As" dialog.
+  //
+  pub fn cont(&self, download_path: &[u16], show_dialog: libc::c_int) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cont.unwrap())(
+          self.c_object,
+          CefWrap::to_c(download_path),
+          CefWrap::to_c(show_dialog)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_before_download_callback_t> for CefBeforeDownloadCallback {
+  fn to_c(rust_object: CefBeforeDownloadCallback) -> *mut cef_before_download_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_before_download_callback_t) -> CefBeforeDownloadCallback {
+    CefBeforeDownloadCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_before_download_callback_t> for Option<CefBeforeDownloadCallback> {
+  fn to_c(rust_object: Option<CefBeforeDownloadCallback>) -> *mut cef_before_download_callback_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_before_download_callback_t) -> Option<CefBeforeDownloadCallback> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefBeforeDownloadCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Callback structure used to asynchronously cancel a download.
+//
+#[repr(C)]
+pub struct _cef_download_item_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Call to cancel the download.
+  //
+  pub cancel: Option<extern "C" fn(this: *mut cef_download_item_callback_t) -> (
+      )>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_download_item_callback_t = _cef_download_item_callback_t;
+
+
+//
+// Callback structure used to asynchronously cancel a download.
+//
+pub struct CefDownloadItemCallback {
+  c_object: *mut cef_download_item_callback_t,
+}
+
+impl Clone for CefDownloadItemCallback {
+  fn clone(&self) -> CefDownloadItemCallback{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDownloadItemCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDownloadItemCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDownloadItemCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_download_item_callback_t) -> CefDownloadItemCallback {
+    CefDownloadItemCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_download_item_callback_t) -> CefDownloadItemCallback {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDownloadItemCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_download_item_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_download_item_callback_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Call to cancel the download.
+  //
+  pub fn cancel(&self) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).cancel.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_download_item_callback_t> for CefDownloadItemCallback {
+  fn to_c(rust_object: CefDownloadItemCallback) -> *mut cef_download_item_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_download_item_callback_t) -> CefDownloadItemCallback {
+    CefDownloadItemCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_download_item_callback_t> for Option<CefDownloadItemCallback> {
+  fn to_c(rust_object: Option<CefDownloadItemCallback>) -> *mut cef_download_item_callback_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_download_item_callback_t) -> Option<CefDownloadItemCallback> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDownloadItemCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Structure used to handle file downloads. The functions of this structure will
+// called on the browser process UI thread.
+//
+#[repr(C)]
+pub struct _cef_download_handler_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Called before a download begins. |suggested_name| is the suggested name for
+  // the download file. By default the download will be canceled. Execute
+  // |callback| either asynchronously or in this function to continue the
+  // download if desired. Do not keep a reference to |download_item| outside of
+  // this function.
+  //
+  pub on_before_download: Option<extern "C" fn(
+      this: *mut cef_download_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      download_item: *mut interfaces::cef_download_item_t,
+      suggested_name: *const types::cef_string_t,
+      callback: *mut interfaces::cef_before_download_callback_t) -> ()>,
+
+  //
+  // Called when a download's status or progress information has been updated.
+  // This may be called multiple times before and after on_before_download().
+  // Execute |callback| either asynchronously or in this function to cancel the
+  // download if desired. Do not keep a reference to |download_item| outside of
+  // this function.
+  //
+  pub on_download_updated: Option<extern "C" fn(
+      this: *mut cef_download_handler_t,
+      browser: *mut interfaces::cef_browser_t,
+      download_item: *mut interfaces::cef_download_item_t,
+      callback: *mut interfaces::cef_download_item_callback_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_download_handler_t = _cef_download_handler_t;
+
+
+//
+// Structure used to handle file downloads. The functions of this structure will
+// called on the browser process UI thread.
+//
+pub struct CefDownloadHandler {
+  c_object: *mut cef_download_handler_t,
+}
+
+impl Clone for CefDownloadHandler {
+  fn clone(&self) -> CefDownloadHandler{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDownloadHandler {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDownloadHandler {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDownloadHandler {
+  pub unsafe fn from_c_object(c_object: *mut cef_download_handler_t) -> CefDownloadHandler {
+    CefDownloadHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_download_handler_t) -> CefDownloadHandler {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDownloadHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_download_handler_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_download_handler_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Called before a download begins. |suggested_name| is the suggested name for
+  // the download file. By default the download will be canceled. Execute
+  // |callback| either asynchronously or in this function to continue the
+  // download if desired. Do not keep a reference to |download_item| outside of
+  // this function.
+  //
+  pub fn on_before_download(&self, browser: interfaces::CefBrowser,
+      download_item: interfaces::CefDownloadItem, suggested_name: &[u16],
+      callback: interfaces::CefBeforeDownloadCallback) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_before_download.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(download_item),
+          CefWrap::to_c(suggested_name),
+          CefWrap::to_c(callback)))
+    }
+  }
+
+  //
+  // Called when a download's status or progress information has been updated.
+  // This may be called multiple times before and after on_before_download().
+  // Execute |callback| either asynchronously or in this function to cancel the
+  // download if desired. Do not keep a reference to |download_item| outside of
+  // this function.
+  //
+  pub fn on_download_updated(&self, browser: interfaces::CefBrowser,
+      download_item: interfaces::CefDownloadItem,
+      callback: interfaces::CefDownloadItemCallback) -> () {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_download_updated.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(download_item),
+          CefWrap::to_c(callback)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_download_handler_t> for CefDownloadHandler {
+  fn to_c(rust_object: CefDownloadHandler) -> *mut cef_download_handler_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_download_handler_t) -> CefDownloadHandler {
+    CefDownloadHandler::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_download_handler_t> for Option<CefDownloadHandler> {
+  fn to_c(rust_object: Option<CefDownloadHandler>) -> *mut cef_download_handler_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_download_handler_t) -> Option<CefDownloadHandler> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDownloadHandler::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_download_item.rs
@@ -0,0 +1,495 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Structure used to represent a download item.
+//
+#[repr(C)]
+pub struct _cef_download_item_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns true (1) if this object is valid. Do not call any other functions
+  // if this function returns false (0).
+  //
+  pub is_valid: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the download is in progress.
+  //
+  pub is_in_progress: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the download is complete.
+  //
+  pub is_complete: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the download has been canceled or interrupted.
+  //
+  pub is_canceled: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> libc::c_int>,
+
+  //
+  // Returns a simple speed estimate in bytes/s.
+  //
+  pub get_current_speed: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> i64>,
+
+  //
+  // Returns the rough percent complete or -1 if the receive total size is
+  // unknown.
+  //
+  pub get_percent_complete: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> libc::c_int>,
+
+  //
+  // Returns the total number of bytes.
+  //
+  pub get_total_bytes: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> i64>,
+
+  //
+  // Returns the number of received bytes.
+  //
+  pub get_received_bytes: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> i64>,
+
+  //
+  // Returns the time that the download started.
+  //
+  pub get_start_time: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> types::cef_time_t>,
+
+  //
+  // Returns the time that the download ended.
+  //
+  pub get_end_time: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> types::cef_time_t>,
+
+  //
+  // Returns the full path to the downloaded or downloading file.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_full_path: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the unique identifier for this download.
+  //
+  pub get_id: Option<extern "C" fn(this: *mut cef_download_item_t) -> u32>,
+
+  //
+  // Returns the URL.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_url: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the suggested file name.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_suggested_file_name: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the content disposition.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_content_disposition: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Returns the mime type.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_mime_type: Option<extern "C" fn(
+      this: *mut cef_download_item_t) -> types::cef_string_userfree_t>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+} 
+
+pub type cef_download_item_t = _cef_download_item_t;
+
+
+//
+// Structure used to represent a download item.
+//
+pub struct CefDownloadItem {
+  c_object: *mut cef_download_item_t,
+}
+
+impl Clone for CefDownloadItem {
+  fn clone(&self) -> CefDownloadItem{
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDownloadItem {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDownloadItem {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDownloadItem {
+  pub unsafe fn from_c_object(c_object: *mut cef_download_item_t) -> CefDownloadItem {
+    CefDownloadItem {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_download_item_t) -> CefDownloadItem {
+    if !c_object.is_null() {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDownloadItem {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_download_item_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_download_item_t {
+    unsafe {
+      if !self.c_object.is_null() {
+        eutil::add_ref(self.c_object as *mut types::cef_base_t);
+      }
+      self.c_object
+    }
+  }
+
+  pub fn is_null_cef_object(&self) -> bool {
+    self.c_object.is_null()
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null()
+  }
+
+  //
+  // Returns true (1) if this object is valid. Do not call any other functions
+  // if this function returns false (0).
+  //
+  pub fn is_valid(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_valid.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the download is in progress.
+  //
+  pub fn is_in_progress(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_in_progress.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the download is complete.
+  //
+  pub fn is_complete(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_complete.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns true (1) if the download has been canceled or interrupted.
+  //
+  pub fn is_canceled(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).is_canceled.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns a simple speed estimate in bytes/s.
+  //
+  pub fn get_current_speed(&self) -> i64 {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_current_speed.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the rough percent complete or -1 if the receive total size is
+  // unknown.
+  //
+  pub fn get_percent_complete(&self) -> libc::c_int {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_percent_complete.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the total number of bytes.
+  //
+  pub fn get_total_bytes(&self) -> i64 {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_total_bytes.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the number of received bytes.
+  //
+  pub fn get_received_bytes(&self) -> i64 {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_received_bytes.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the time that the download started.
+  //
+  pub fn get_start_time(&self) -> types::cef_time_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_start_time.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the time that the download ended.
+  //
+  pub fn get_end_time(&self) -> types::cef_time_t {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_end_time.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the full path to the downloaded or downloading file.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_full_path(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_full_path.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the unique identifier for this download.
+  //
+  pub fn get_id(&self) -> u32 {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_id.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the URL.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_url(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_url.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the suggested file name.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_suggested_file_name(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_suggested_file_name.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the content disposition.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_content_disposition(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_content_disposition.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Returns the mime type.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_mime_type(&self) -> String {
+    if self.c_object.is_null() {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_mime_type.unwrap())(
+          self.c_object))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_download_item_t> for CefDownloadItem {
+  fn to_c(rust_object: CefDownloadItem) -> *mut cef_download_item_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_download_item_t) -> CefDownloadItem {
+    CefDownloadItem::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_download_item_t> for Option<CefDownloadItem> {
+  fn to_c(rust_object: Option<CefDownloadItem>) -> *mut cef_download_item_t {
+    match rust_object {
+      None => ptr::null_mut(),
+      Some(rust_object) => rust_object.c_object_addrefed(),
+    }
+  }
+  unsafe fn to_rust(c_object: *mut cef_download_item_t) -> Option<CefDownloadItem> {
+    if c_object.is_null() {
+      None
+    } else {
+      Some(CefDownloadItem::from_c_object_addref(c_object))
+    }
+  }
+}
+
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_drag_data.rs
@@ -0,0 +1,653 @@
+// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool and should not be edited
+// by hand. See the translator.README.txt file in the tools directory for
+// more information.
+//
+
+#![allow(non_snake_case, unused_imports)]
+
+use eutil;
+use interfaces;
+use types;
+use wrappers::CefWrap;
+
+use libc;
+use std::collections::HashMap;
+use std::ptr;
+
+//
+// Structure used to represent drag data. The functions of this structure may be
+// called on any thread.
+//
+#[repr(C)]
+pub struct _cef_drag_data_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Returns a copy of the current object.
+  //
+  pub clone: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> *mut interfaces::cef_drag_data_t>,
+
+  //
+  // Returns true (1) if this object is read-only.
+  //
+  pub is_read_only: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the drag data is a link.
+  //
+  pub is_link: Option<extern "C" fn(this: *mut cef_drag_data_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the drag data is a text or html fragment.
+  //
+  pub is_fragment: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> libc::c_int>,
+
+  //
+  // Returns true (1) if the drag data is a file.
+  //
+  pub is_file: Option<extern "C" fn(this: *mut cef_drag_data_t) -> libc::c_int>,
+
+  //
+  // Return the link URL that is being dragged.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_link_url: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Return the title associated with the link being dragged.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_link_title: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Return the metadata, if any, associated with the link being dragged.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_link_metadata: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Return the plain text fragment that is being dragged.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_fragment_text: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Return the text/html fragment that is being dragged.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_fragment_html: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Return the base URL that the fragment came from. This value is used for
+  // resolving relative URLs and may be NULL.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_fragment_base_url: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Return the name of the file being dragged out of the browser window.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_file_name: Option<extern "C" fn(
+      this: *mut cef_drag_data_t) -> types::cef_string_userfree_t>,
+
+  //
+  // Write the contents of the file being dragged out of the web view into
+  // |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL
+  // this function will return the size of the file contents in bytes. Call
+  // get_file_name() to get a suggested name for the file.
+  //
+  pub get_file_contents: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      writer: *mut interfaces::cef_stream_writer_t) -> libc::size_t>,
+
+  //
+  // Retrieve the list of file names that are being dragged into the browser
+  // window.
+  //
+  pub get_file_names: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      names: types::cef_string_list_t) -> libc::c_int>,
+
+  //
+  // Set the link URL that is being dragged.
+  //
+  pub set_link_url: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      url: *const types::cef_string_t) -> ()>,
+
+  //
+  // Set the title associated with the link being dragged.
+  //
+  pub set_link_title: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      title: *const types::cef_string_t) -> ()>,
+
+  //
+  // Set the metadata associated with the link being dragged.
+  //
+  pub set_link_metadata: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      data: *const types::cef_string_t) -> ()>,
+
+  //
+  // Set the plain text fragment that is being dragged.
+  //
+  pub set_fragment_text: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      text: *const types::cef_string_t) -> ()>,
+
+  //
+  // Set the text/html fragment that is being dragged.
+  //
+  pub set_fragment_html: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      html: *const types::cef_string_t) -> ()>,
+
+  //
+  // Set the base URL that the fragment came from.
+  //
+  pub set_fragment_base_url: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      base_url: *const types::cef_string_t) -> ()>,
+
+  //
+  // Reset the file contents. You should do this before calling
+  // cef_browser_host_t::DragTargetDragEnter as the web view does not allow us
+  // to drag in this kind of data.
+  //
+  pub reset_file_contents: Option<extern "C" fn(this: *mut cef_drag_data_t) -> (
+      )>,
+
+  //
+  // Add a file that is being dragged into the webview.
+  //
+  pub add_file: Option<extern "C" fn(this: *mut cef_drag_data_t,
+      path: *const types::cef_string_t,
+      display_name: *const types::cef_string_t) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: uint,
+
+  //