servo: Merge #5955 - Embedding rebase rage (from zmike:embedding-REBASE_RAGE); r=larsbergstrom
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 07 May 2015 14:10:29 -0500
changeset 382973 496bf169306f2cbc5f23cc529a5f6be30851e0b3
parent 382972 b34260916b938601d9d167545aeccd6e2e848d95
child 382974 c820e899d8295ff5fcc17bc20f0aa8fddeb77a6d
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 #5955 - Embedding rebase rage (from zmike:embedding-REBASE_RAGE); r=larsbergstrom This updates all the CEF interface stuff to the current CEF codebase. Source-Repo: https://github.com/servo/servo Source-Revision: 92f46e3149df7de59aa5aa6700c1878958e2f273
servo/ports/cef/README.md
servo/ports/cef/cookie.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_find_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_navigation_entry.rs
servo/ports/cef/interfaces/cef_origin_whitelist.rs
servo/ports/cef/interfaces/cef_parser.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_ssl_info.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/regen_interface_mod_rs.sh
servo/ports/cef/request_context.rs
servo/ports/cef/types.rs
servo/ports/cef/urlrequest.rs
servo/ports/cef/values.rs
servo/ports/cef/window.rs
servo/ports/cef/wrappers.rs
--- a/servo/ports/cef/README.md
+++ b/servo/ports/cef/README.md
@@ -5,17 +5,11 @@ 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/
+* The contents of `interfaces/` are entirely autogenerated. To
+  regenerate, see https://github.com/zmike/cef-rebase/blob/master/README.md for full instructions
 
--- a/servo/ports/cef/cookie.rs
+++ b/servo/ports/cef/cookie.rs
@@ -1,16 +1,17 @@
 /* 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 interfaces::{cef_completion_callback_t, 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_get_global_manager(callback: *mut cef_completion_callback_t) -> *mut cef_cookie_manager_t
     fn cef_cookie_manager_create_manager(path: *const cef_string_t,
-                                         persist_session_cookies: c_int)
+                                         persist_session_cookies: c_int,
+                                         callback: *mut cef_completion_callback_t)
                                          -> *mut cef_cookie_manager_t
 }
 
--- a/servo/ports/cef/interfaces/cef_app.rs
+++ b/servo/ports/cef/interfaces/cef_app.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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 {
@@ -101,108 +102,113 @@ pub struct _cef_app_t {
   // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -212,17 +218,18 @@ impl CefApp {
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -231,49 +238,52 @@ impl CefApp {
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_render_process_handler.unwrap())(
           self.c_object))
     }
   }
@@ -290,16 +300,17 @@ impl CefWrap<*mut cef_app_t> for CefApp 
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefApp::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_auth_callback.rs
+++ b/servo/ports/cef/interfaces/cef_auth_callback.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Callback structure used for asynchronous continuation of authentication
 // requests.
 //
 #[repr(C)]
 pub struct _cef_auth_callback_t {
@@ -66,115 +67,121 @@ pub struct _cef_auth_callback_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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Continue the authentication request.
   //
   pub fn cont(&self, username: &[u16], password: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cancel.unwrap())(
           self.c_object))
     }
   }
@@ -191,16 +198,17 @@ impl CefWrap<*mut cef_auth_callback_t> f
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefAuthCallback::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_browser.rs
+++ b/servo/ports/cef/interfaces/cef_browser.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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.
 //
@@ -181,23 +182,23 @@ pub struct _cef_browser_t {
   //
   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: usize,
+  pub ref_count: u32,
 
   //
   // 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
@@ -205,368 +206,393 @@ pub type cef_browser_t = _cef_browser_t;
 //
 pub struct CefBrowser {
   c_object: *mut cef_browser_t,
 }
 
 impl Clone for CefBrowser {
   fn clone(&self) -> CefBrowser{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -585,17 +611,18 @@ impl CefWrap<*mut cef_browser_t> for Cef
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefBrowser::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -606,122 +633,130 @@ impl CefWrap<*mut cef_browser_t> for Opt
 #[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.
+  // Called asynchronously after the file dialog is dismissed.
+  // |selected_accept_filter| is the 0-based index of the value selected from
+  // the accept filters array passed to cef_browser_host_t::RunFileDialog.
+  // |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,
+  pub on_file_dialog_dismissed: Option<extern "C" fn(
+      this: *mut cef_run_file_dialog_callback_t,
+      selected_accept_filter: libc::c_int,
       file_paths: types::cef_string_list_t) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
-  // 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.
+  // Called asynchronously after the file dialog is dismissed.
+  // |selected_accept_filter| is the 0-based index of the value selected from
+  // the accept filters array passed to cef_browser_host_t::RunFileDialog.
+  // |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,
+  pub fn on_file_dialog_dismissed(&self, selected_accept_filter: libc::c_int,
       file_paths: Vec<String>) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
-        ((*self.c_object).cont.unwrap())(
+        ((*self.c_object).on_file_dialog_dismissed.unwrap())(
           self.c_object,
-          CefWrap::to_c(browser_host),
+          CefWrap::to_c(selected_accept_filter),
           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()
@@ -733,26 +768,186 @@ impl CefWrap<*mut cef_run_file_dialog_ca
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefRunFileDialogCallback::from_c_object_addref(c_object))
     }
   }
 }
 
 
 //
+// Callback structure for cef_browser_host_t::GetNavigationEntries. The
+// functions of this structure will be called on the browser process UI thread.
+//
+#[repr(C)]
+pub struct _cef_navigation_entry_visitor_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Method that will be executed. Do not keep a reference to |entry| outside of
+  // this callback. Return true (1) to continue visiting entries or false (0) to
+  // stop. |current| is true (1) if this entry is the currently loaded
+  // navigation entry. |index| is the 0-based index of this entry and |total| is
+  // the total number of entries.
+  //
+  pub visit: Option<extern "C" fn(this: *mut cef_navigation_entry_visitor_t,
+      entry: *mut interfaces::cef_navigation_entry_t, current: libc::c_int,
+      index: libc::c_int, total: libc::c_int) -> libc::c_int>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: u32,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+}
+
+pub type cef_navigation_entry_visitor_t = _cef_navigation_entry_visitor_t;
+
+
+//
+// Callback structure for cef_browser_host_t::GetNavigationEntries. The
+// functions of this structure will be called on the browser process UI thread.
+//
+pub struct CefNavigationEntryVisitor {
+  c_object: *mut cef_navigation_entry_visitor_t,
+}
+
+impl Clone for CefNavigationEntryVisitor {
+  fn clone(&self) -> CefNavigationEntryVisitor{
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefNavigationEntryVisitor {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefNavigationEntryVisitor {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefNavigationEntryVisitor {
+  pub unsafe fn from_c_object(c_object: *mut cef_navigation_entry_visitor_t) -> CefNavigationEntryVisitor {
+    CefNavigationEntryVisitor {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_navigation_entry_visitor_t) -> CefNavigationEntryVisitor {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefNavigationEntryVisitor {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_navigation_entry_visitor_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_navigation_entry_visitor_t {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        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() || self.c_object as usize == mem::POST_DROP_USIZE
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
+  }
+
+  //
+  // Method that will be executed. Do not keep a reference to |entry| outside of
+  // this callback. Return true (1) to continue visiting entries or false (0) to
+  // stop. |current| is true (1) if this entry is the currently loaded
+  // navigation entry. |index| is the 0-based index of this entry and |total| is
+  // the total number of entries.
+  //
+  pub fn visit(&self, entry: interfaces::CefNavigationEntry,
+      current: libc::c_int, index: libc::c_int,
+      total: libc::c_int) -> libc::c_int {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).visit.unwrap())(
+          self.c_object,
+          CefWrap::to_c(entry),
+          CefWrap::to_c(current),
+          CefWrap::to_c(index),
+          CefWrap::to_c(total)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_navigation_entry_visitor_t> for CefNavigationEntryVisitor {
+  fn to_c(rust_object: CefNavigationEntryVisitor) -> *mut cef_navigation_entry_visitor_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_navigation_entry_visitor_t) -> CefNavigationEntryVisitor {
+    CefNavigationEntryVisitor::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_navigation_entry_visitor_t> for Option<CefNavigationEntryVisitor> {
+  fn to_c(rust_object: Option<CefNavigationEntryVisitor>) -> *mut cef_navigation_entry_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_navigation_entry_visitor_t) -> Option<CefNavigationEntryVisitor> {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
+      None
+    } else {
+      Some(CefNavigationEntryVisitor::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 {
   //
@@ -832,47 +1027,53 @@ pub struct _cef_browser_host_t {
   //
   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.
+  // default title ("Open" or "Save" depending on the mode). |default_file_path|
+  // is the path with optional directory and/or file name component that will be
+  // initially selected in the dialog. |accept_filters| are used to restrict the
+  // selectable file types and may any combination of (a) valid lower-cased MIME
+  // types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g.
+  // ".txt" or ".png"), or (c) combined description and file extension delimited
+  // using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg").
+  // |selected_accept_filter| is the 0-based index of the filter that will be
+  // selected by default. |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,
+      default_file_path: *const types::cef_string_t,
+      accept_filters: types::cef_string_list_t,
+      selected_accept_filter: libc::c_int,
       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 simultaneously. |forward| indicates whether to search forward or
+  // 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.
+  // or a follow-up. The cef_find_handler_t instance, if any, returned via
+  // cef_client_t::GetFindHandler will be called to report find results.
   //
   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.
@@ -893,16 +1094,28 @@ pub struct _cef_browser_host_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) -> (
       )>,
 
   //
+  // Retrieve a snapshot of current navigation entries as values sent to the
+  // specified visitor. If |current_only| is true (1) only the current
+  // navigation entry will be sent, otherwise all navigation entries will be
+  // sent.
+  //
+  //
+  pub get_navigation_entries: Option<extern "C" fn(
+      this: *mut cef_browser_host_t,
+      visitor: *mut interfaces::cef_navigation_entry_visitor_t,
+      current_only: libc::c_int) -> ()>,
+
+  //
   // 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.
   //
@@ -1084,52 +1297,52 @@ pub struct _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* methods. This function is only used when window rendering is
+  // 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* methods.
+  // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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
@@ -1137,77 +1350,82 @@ pub type cef_browser_host_t = _cef_brows
 //
 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Returns the hosted browser object.
   //
   pub fn get_browser(&self) -> interfaces::CefBrowser {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_browser.unwrap())(
           self.c_object))
     }
   }
@@ -1218,218 +1436,238 @@ impl CefBrowserHost {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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.
+  // default title ("Open" or "Save" depending on the mode). |default_file_path|
+  // is the path with optional directory and/or file name component that will be
+  // initially selected in the dialog. |accept_filters| are used to restrict the
+  // selectable file types and may any combination of (a) valid lower-cased MIME
+  // types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g.
+  // ".txt" or ".png"), or (c) combined description and file extension delimited
+  // using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg").
+  // |selected_accept_filter| is the 0-based index of the filter that will be
+  // selected by default. |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>,
+      title: &[u16], default_file_path: &[u16], accept_filters: Vec<String>,
+      selected_accept_filter: libc::c_int,
       callback: interfaces::CefRunFileDialogCallback) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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(default_file_path),
+          CefWrap::to_c(accept_filters),
+          CefWrap::to_c(selected_accept_filter),
           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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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 simultaneously. |forward| indicates whether to search forward or
+  // 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.
+  // or a follow-up. The cef_find_handler_t instance, if any, returned via
+  // cef_client_t::GetFindHandler will be called to report find results.
   //
   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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -1438,17 +1676,18 @@ impl CefBrowserHost {
           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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -1456,17 +1695,18 @@ impl CefBrowserHost {
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -1475,124 +1715,155 @@ impl CefBrowserHost {
     }
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).close_dev_tools.unwrap())(
           self.c_object))
     }
   }
 
   //
+  // Retrieve a snapshot of current navigation entries as values sent to the
+  // specified visitor. If |current_only| is true (1) only the current
+  // navigation entry will be sent, otherwise all navigation entries will be
+  // sent.
+  //
+  //
+  pub fn get_navigation_entries(&self,
+      visitor: interfaces::CefNavigationEntryVisitor,
+      current_only: libc::c_int) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_navigation_entries.unwrap())(
+          self.c_object,
+          CefWrap::to_c(visitor),
+          CefWrap::to_c(current_only)))
+    }
+  }
+
+  //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -1602,48 +1873,51 @@ impl CefBrowserHost {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -1651,17 +1925,18 @@ impl CefBrowserHost {
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -1671,17 +1946,18 @@ impl CefBrowserHost {
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -1692,111 +1968,118 @@ impl CefBrowserHost {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -1809,17 +2092,18 @@ impl CefBrowserHost {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -1830,17 +2114,18 @@ impl CefBrowserHost {
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -1848,17 +2133,18 @@ impl CefBrowserHost {
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).drag_target_drag_leave.unwrap())(
           self.c_object))
     }
   }
@@ -1866,39 +2152,41 @@ impl CefBrowserHost {
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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* methods. This function is only used when window rendering is
+  // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -1906,37 +2194,39 @@ impl CefBrowserHost {
     }
   }
 
   //
   // 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* methods.
+  // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).initialize_compositing.unwrap())(
           self.c_object))
     }
   }
@@ -1995,16 +2285,17 @@ impl CefWrap<*mut cef_browser_host_t> fo
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefBrowserHost::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_browser_process_handler.rs
+++ b/servo/ports/cef/interfaces/cef_browser_process_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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)]
@@ -91,101 +92,106 @@ pub struct _cef_browser_process_handler_
   // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_context_initialized.unwrap())(
           self.c_object))
     }
   }
@@ -194,17 +200,18 @@ impl CefBrowserProcessHandler {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -214,33 +221,35 @@ impl CefBrowserProcessHandler {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_print_handler.unwrap())(
           self.c_object))
     }
   }
@@ -257,16 +266,17 @@ impl CefWrap<*mut cef_browser_process_ha
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefBrowserProcessHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_callback.rs
+++ b/servo/ports/cef/interfaces/cef_callback.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Generic callback structure used for asynchronous continuation.
 //
 #[repr(C)]
 pub struct _cef_callback_t {
   //
@@ -63,112 +64,118 @@ pub struct _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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Continue processing.
   //
   pub fn cont(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cancel.unwrap())(
           self.c_object))
     }
   }
@@ -185,17 +192,18 @@ impl CefWrap<*mut cef_callback_t> for Ce
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefCallback::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -213,98 +221,103 @@ pub struct _cef_completion_callback_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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Method that will be called once the task is complete.
   //
   pub fn on_complete(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_complete.unwrap())(
           self.c_object))
     }
   }
@@ -321,16 +334,17 @@ impl CefWrap<*mut cef_completion_callbac
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefCompletionCallback::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_client.rs
+++ b/servo/ports/cef/interfaces/cef_client.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Implement this structure to provide handler implementations.
 //
 #[repr(C)]
 pub struct _cef_client_t {
   //
@@ -84,16 +85,22 @@ pub struct _cef_client_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 find result events.
+  //
+  pub get_find_handler: Option<extern "C" fn(
+      this: *mut cef_client_t) -> *mut interfaces::cef_find_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.
@@ -146,271 +153,303 @@ pub struct _cef_client_t {
   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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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 find result events.
+  //
+  pub fn get_find_handler(&self) -> interfaces::CefFindHandler {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_find_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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_request_handler.unwrap())(
           self.c_object))
     }
   }
@@ -418,17 +457,18 @@ impl CefClient {
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -448,16 +488,17 @@ impl CefWrap<*mut cef_client_t> for CefC
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefClient::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_command_line.rs
+++ b/servo/ports/cef/interfaces/cef_command_line.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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
@@ -195,23 +196,23 @@ pub struct _cef_command_line_t {
   // "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: usize,
+  pub ref_count: u32,
 
   //
   // 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
@@ -223,371 +224,395 @@ pub type cef_command_line_t = _cef_comma
 //
 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -628,16 +653,17 @@ impl CefWrap<*mut cef_command_line_t> fo
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefCommandLine::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_context_menu_handler.rs
+++ b/servo/ports/cef/interfaces/cef_context_menu_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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 {
@@ -94,105 +95,110 @@ pub struct _cef_context_menu_handler_t {
   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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -209,17 +215,18 @@ impl CefContextMenuHandler {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -230,17 +237,18 @@ impl CefContextMenuHandler {
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -259,27 +267,28 @@ impl CefWrap<*mut cef_context_menu_handl
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefContextMenuHandler::from_c_object_addref(c_object))
     }
   }
 }
 
 
 //
-// Provides information about the context menu state. The methods of this
+// 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,
@@ -383,23 +392,16 @@ pub struct _cef_context_menu_params_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>,
 
@@ -421,379 +423,386 @@ pub struct _cef_context_menu_params_t {
   // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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 methods of this
+// 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_edit_state_flags.unwrap())(
           self.c_object))
     }
   }
@@ -810,16 +819,17 @@ impl CefWrap<*mut cef_context_menu_param
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefContextMenuParams::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_cookie.rs
+++ b/servo/ports/cef/interfaces/cef_cookie.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,352 +38,389 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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.
+  // "https" schemes are supported. If |callback| is non-NULL it will be
+  // executed asnychronously on the IO thread after the change has been applied.
+  // 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) -> (
-      )>,
+      this: *mut cef_cookie_manager_t, schemes: types::cef_string_list_t,
+      callback: *mut interfaces::cef_completion_callback_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.
+  // Visit all cookies on the IO thread. 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.
+  // Visit a subset of cookies on the IO thread. 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.
+  // within the cookie value attribute) and fail without setting the cookie if
+  // such characters are found. If |callback| is non-NULL it will be executed
+  // asnychronously on the IO thread after the cookie has been set. Returns
+  // false (0) if an invalid URL is specified or if cookies cannot be accessed.
   //
   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>,
+      url: *const types::cef_string_t, cookie: *const interfaces::cef_cookie_t,
+      callback: *mut interfaces::cef_set_cookie_callback_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
+  // |cookie_name| values 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.
+  // cookies for all hosts and domains will be deleted. If |callback| is non-
+  // NULL it will be executed asnychronously on the IO thread after the cookies
+  // have been deleted. Returns false (0) if a non-NULL invalid URL is specified
+  // or if cookies cannot be accessed. Cookies can alternately be deleted using
+  // the Visit*Cookies() functions.
   //
   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>,
+      url: *const types::cef_string_t, cookie_name: *const types::cef_string_t,
+      callback: *mut interfaces::cef_delete_cookies_callback_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.
+  // browsers do not persist them. If |callback| is non-NULL it will be executed
+  // asnychronously on the IO thread after the manager's storage has been
+  // initialized. 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>,
+      path: *const types::cef_string_t, persist_session_cookies: libc::c_int,
+      callback: *mut interfaces::cef_completion_callback_t) -> 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.
+  // Flush the backing store (if any) to disk. If |callback| is non-NULL it will
+  // be executed asnychronously on the IO thread after the flush is complete.
+  // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Set the schemes supported by this manager. By default only "http" and
-  // "https" schemes are supported. Must be called before any cookies are
-  // accessed.
+  // "https" schemes are supported. If |callback| is non-NULL it will be
+  // executed asnychronously on the IO thread after the change has been applied.
+  // Must be called before any cookies are accessed.
   //
-  pub fn set_supported_schemes(&self, schemes: Vec<String>) -> () {
-    if self.c_object.is_null() {
+  pub fn set_supported_schemes(&self, schemes: Vec<String>,
+      callback: interfaces::CefCompletionCallback) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
+          CefWrap::to_c(schemes),
+          CefWrap::to_c(callback)))
     }
   }
 
   //
-  // Visit all cookies. The returned cookies are ordered by longest path, then
-  // by earliest creation date. Returns false (0) if cookies cannot be accessed.
+  // Visit all cookies on the IO thread. 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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.
+  // Visit a subset of cookies on the IO thread. 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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.
+  // within the cookie value attribute) and fail without setting the cookie if
+  // such characters are found. If |callback| is non-NULL it will be executed
+  // asnychronously on the IO thread after the cookie has been set. Returns
+  // false (0) if an invalid URL is specified or if cookies cannot be accessed.
   //
-  pub fn set_cookie(&self, url: &[u16],
-      cookie: &interfaces::CefCookie) -> libc::c_int {
-    if self.c_object.is_null() {
+  pub fn set_cookie(&self, url: &[u16], cookie: &interfaces::CefCookie,
+      callback: interfaces::CefSetCookieCallback) -> libc::c_int {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
+          CefWrap::to_c(cookie),
+          CefWrap::to_c(callback)))
     }
   }
 
   //
   // Delete all cookies that match the specified parameters. If both |url| and
-  // values |cookie_name| are specified all host and domain cookies matching
+  // |cookie_name| values 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.
+  // cookies for all hosts and domains will be deleted. If |callback| is non-
+  // NULL it will be executed asnychronously on the IO thread after the cookies
+  // have been deleted. Returns false (0) if a non-NULL invalid URL is specified
+  // or if cookies cannot be accessed. Cookies can alternately be deleted using
+  // the Visit*Cookies() functions.
   //
-  pub fn delete_cookies(&self, url: &[u16],
-      cookie_name: &[u16]) -> libc::c_int {
-    if self.c_object.is_null() {
+  pub fn delete_cookies(&self, url: &[u16], cookie_name: &[u16],
+      callback: interfaces::CefDeleteCookiesCallback) -> libc::c_int {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
+          CefWrap::to_c(cookie_name),
+          CefWrap::to_c(callback)))
     }
   }
 
   //
   // 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.
+  // browsers do not persist them. If |callback| is non-NULL it will be executed
+  // asnychronously on the IO thread after the manager's storage has been
+  // initialized. 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() {
+      persist_session_cookies: libc::c_int,
+      callback: interfaces::CefCompletionCallback) -> libc::c_int {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
+          CefWrap::to_c(persist_session_cookies),
+          CefWrap::to_c(callback)))
     }
   }
 
   //
-  // 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.
+  // Flush the backing store (if any) to disk. If |callback| is non-NULL it will
+  // be executed asnychronously on the IO thread after the flush is complete.
+  // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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.
+  // CefSettings.cache_path if specified or in memory otherwise. If |callback|
+  // is non-NULL it will be executed asnychronously on the IO thread after the
+  // manager's storage has been initialized. Using this function is equivalent
+  // to calling cef_request_tContext::cef_request_context_get_global_context()->
+  // get_default_cookie_manager().
   //
-  pub fn get_global_manager() -> interfaces::CefCookieManager {
+  pub fn get_global_manager(
+      callback: interfaces::CefCompletionCallback) -> interfaces::CefCookieManager {
     unsafe {
       CefWrap::to_rust(
         ::cookie::cef_cookie_manager_get_global_manager(
-))
+          CefWrap::to_c(callback)))
     }
   }
 
   //
   // 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.
+  // them. If |callback| is non-NULL it will be executed asnychronously on the
+  // IO thread after the manager's storage has been initialized.
   //
-  pub fn create_manager(path: &[u16],
-      persist_session_cookies: libc::c_int) -> interfaces::CefCookieManager {
+  pub fn create_manager(path: &[u16], persist_session_cookies: libc::c_int,
+      callback: interfaces::CefCompletionCallback) -> interfaces::CefCookieManager {
     unsafe {
       CefWrap::to_rust(
         ::cookie::cef_cookie_manager_create_manager(
           CefWrap::to_c(path),
-          CefWrap::to_c(persist_session_cookies)))
+          CefWrap::to_c(persist_session_cookies),
+          CefWrap::to_c(callback)))
     }
   }
 } 
 
 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()
   }
@@ -394,17 +431,18 @@ impl CefWrap<*mut cef_cookie_manager_t> 
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefCookieManager::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -428,104 +466,109 @@ pub struct _cef_cookie_visitor_t {
   //
   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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -546,16 +589,312 @@ impl CefWrap<*mut cef_cookie_visitor_t> 
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefCookieVisitor::from_c_object_addref(c_object))
     }
   }
 }
 
+
+//
+// Structure to implement to be notified of asynchronous completion via
+// cef_cookie_manager_t::set_cookie().
+//
+#[repr(C)]
+pub struct _cef_set_cookie_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Method that will be called upon completion. |success| will be true (1) if
+  // the cookie was set successfully.
+  //
+  pub on_complete: Option<extern "C" fn(this: *mut cef_set_cookie_callback_t,
+      success: libc::c_int) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: u32,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+}
+
+pub type cef_set_cookie_callback_t = _cef_set_cookie_callback_t;
+
+
+//
+// Structure to implement to be notified of asynchronous completion via
+// cef_cookie_manager_t::set_cookie().
+//
+pub struct CefSetCookieCallback {
+  c_object: *mut cef_set_cookie_callback_t,
+}
+
+impl Clone for CefSetCookieCallback {
+  fn clone(&self) -> CefSetCookieCallback{
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefSetCookieCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefSetCookieCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefSetCookieCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_set_cookie_callback_t) -> CefSetCookieCallback {
+    CefSetCookieCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_set_cookie_callback_t) -> CefSetCookieCallback {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefSetCookieCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_set_cookie_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_set_cookie_callback_t {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        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() || self.c_object as usize == mem::POST_DROP_USIZE
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
+  }
+
+  //
+  // Method that will be called upon completion. |success| will be true (1) if
+  // the cookie was set successfully.
+  //
+  pub fn on_complete(&self, success: libc::c_int) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_complete.unwrap())(
+          self.c_object,
+          CefWrap::to_c(success)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_set_cookie_callback_t> for CefSetCookieCallback {
+  fn to_c(rust_object: CefSetCookieCallback) -> *mut cef_set_cookie_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_set_cookie_callback_t) -> CefSetCookieCallback {
+    CefSetCookieCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_set_cookie_callback_t> for Option<CefSetCookieCallback> {
+  fn to_c(rust_object: Option<CefSetCookieCallback>) -> *mut cef_set_cookie_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_set_cookie_callback_t) -> Option<CefSetCookieCallback> {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
+      None
+    } else {
+      Some(CefSetCookieCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
+
+//
+// Structure to implement to be notified of asynchronous completion via
+// cef_cookie_manager_t::delete_cookies().
+//
+#[repr(C)]
+pub struct _cef_delete_cookies_callback_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Method that will be called upon completion. |num_deleted| will be the
+  // number of cookies that were deleted or -1 if unknown.
+  //
+  pub on_complete: Option<extern "C" fn(
+      this: *mut cef_delete_cookies_callback_t, num_deleted: libc::c_int) -> (
+      )>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: u32,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+}
+
+pub type cef_delete_cookies_callback_t = _cef_delete_cookies_callback_t;
+
+
+//
+// Structure to implement to be notified of asynchronous completion via
+// cef_cookie_manager_t::delete_cookies().
+//
+pub struct CefDeleteCookiesCallback {
+  c_object: *mut cef_delete_cookies_callback_t,
+}
+
+impl Clone for CefDeleteCookiesCallback {
+  fn clone(&self) -> CefDeleteCookiesCallback{
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefDeleteCookiesCallback {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefDeleteCookiesCallback {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefDeleteCookiesCallback {
+  pub unsafe fn from_c_object(c_object: *mut cef_delete_cookies_callback_t) -> CefDeleteCookiesCallback {
+    CefDeleteCookiesCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_delete_cookies_callback_t) -> CefDeleteCookiesCallback {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefDeleteCookiesCallback {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_delete_cookies_callback_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_delete_cookies_callback_t {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        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() || self.c_object as usize == mem::POST_DROP_USIZE
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
+  }
+
+  //
+  // Method that will be called upon completion. |num_deleted| will be the
+  // number of cookies that were deleted or -1 if unknown.
+  //
+  pub fn on_complete(&self, num_deleted: libc::c_int) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_complete.unwrap())(
+          self.c_object,
+          CefWrap::to_c(num_deleted)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_delete_cookies_callback_t> for CefDeleteCookiesCallback {
+  fn to_c(rust_object: CefDeleteCookiesCallback) -> *mut cef_delete_cookies_callback_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_delete_cookies_callback_t) -> CefDeleteCookiesCallback {
+    CefDeleteCookiesCallback::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_delete_cookies_callback_t> for Option<CefDeleteCookiesCallback> {
+  fn to_c(rust_object: Option<CefDeleteCookiesCallback>) -> *mut cef_delete_cookies_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_delete_cookies_callback_t) -> Option<CefDeleteCookiesCallback> {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
+      None
+    } else {
+      Some(CefDeleteCookiesCallback::from_c_object_addref(c_object))
+    }
+  }
+}
+
--- a/servo/ports/cef/interfaces/cef_dialog_handler.rs
+++ b/servo/ports/cef/interfaces/cef_dialog_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,144 +38,158 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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
+  // Continue the file selection. |selected_accept_filter| should be the 0-based
+  // index of the value selected from the accept filters array passed to
+  // cef_dialog_handler_t::OnFileDialog. |file_paths| should be a single value
+  // or a list of values depending on the dialog mode. An NULL |file_paths|
   // value is treated the same as calling cancel().
   //
   pub cont: Option<extern "C" fn(this: *mut cef_file_dialog_callback_t,
+      selected_accept_filter: libc::c_int,
       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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
-  // 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
+  // Continue the file selection. |selected_accept_filter| should be the 0-based
+  // index of the value selected from the accept filters array passed to
+  // cef_dialog_handler_t::OnFileDialog. |file_paths| should be a single value
+  // or a list of values depending on the dialog mode. An NULL |file_paths|
   // value is treated the same as calling cancel().
   //
-  pub fn cont(&self, file_paths: Vec<String>) -> () {
-    if self.c_object.is_null() {
+  pub fn cont(&self, selected_accept_filter: libc::c_int,
+      file_paths: Vec<String>) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cont.unwrap())(
           self.c_object,
+          CefWrap::to_c(selected_accept_filter),
           CefWrap::to_c(file_paths)))
     }
   }
 
   //
   // Cancel the file selection.
   //
   pub fn cancel(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cancel.unwrap())(
           self.c_object))
     }
   }
@@ -192,17 +206,18 @@ impl CefWrap<*mut cef_file_dialog_callba
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefFileDialogCallback::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -216,138 +231,154 @@ 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).
+  // |default_file_path| is the path with optional directory and/or file name
+  // component that should be initially selected in the dialog. |accept_filters|
+  // are used to restrict the selectable file types and may any combination of
+  // (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
+  // individual file extensions (e.g. ".txt" or ".png"), or (c) combined
+  // description and file extension delimited using "|" and ";" (e.g. "Image
+  // Types|.png;.gif;.jpg"). |selected_accept_filter| is the 0-based index of
+  // the filter that should be selected by default. 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,
+      default_file_path: *const types::cef_string_t,
+      accept_filters: types::cef_string_list_t,
+      selected_accept_filter: libc::c_int,
       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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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).
+  // |default_file_path| is the path with optional directory and/or file name
+  // component that should be initially selected in the dialog. |accept_filters|
+  // are used to restrict the selectable file types and may any combination of
+  // (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
+  // individual file extensions (e.g. ".txt" or ".png"), or (c) combined
+  // description and file extension delimited using "|" and ";" (e.g. "Image
+  // Types|.png;.gif;.jpg"). |selected_accept_filter| is the 0-based index of
+  // the filter that should be selected by default. 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>,
+      default_file_path: &[u16], accept_filters: Vec<String>,
+      selected_accept_filter: libc::c_int,
       callback: interfaces::CefFileDialogCallback) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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(default_file_path),
+          CefWrap::to_c(accept_filters),
+          CefWrap::to_c(selected_accept_filter),
           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()
@@ -359,16 +390,17 @@ impl CefWrap<*mut cef_dialog_handler_t> 
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDialogHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_display_handler.rs
+++ b/servo/ports/cef/interfaces/cef_display_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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 {
@@ -67,16 +68,23 @@ pub struct _cef_display_handler_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 page icon changes.
+  //
+  pub on_favicon_urlchange: Option<extern "C" fn(
+      this: *mut cef_display_handler_t, browser: *mut interfaces::cef_browser_t,
+      icon_urls: types::cef_string_list_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,
@@ -98,100 +106,105 @@ pub struct _cef_display_handler_t {
   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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -199,39 +212,59 @@ impl CefDisplayHandler {
     }
   }
 
   //
   // Called when the page title changes.
   //
   pub fn on_title_change(&self, browser: interfaces::CefBrowser,
       title: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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 page icon changes.
+  //
+  pub fn on_favicon_urlchange(&self, browser: interfaces::CefBrowser,
+      icon_urls: Vec<String>) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_favicon_urlchange.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(icon_urls)))
+    }
+  }
+
+  //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -239,17 +272,18 @@ impl CefDisplayHandler {
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -257,17 +291,18 @@ impl CefDisplayHandler {
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -288,16 +323,17 @@ impl CefWrap<*mut cef_display_handler_t>
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDisplayHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_dom.rs
+++ b/servo/ports/cef/interfaces/cef_dom.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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 {
@@ -64,103 +65,108 @@ pub struct _cef_domvisitor_t {
   // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -178,17 +184,18 @@ impl CefWrap<*mut cef_domvisitor_t> for 
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDOMVisitor::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -248,34 +255,22 @@ pub struct _cef_domdocument_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.
   //
@@ -303,316 +298,306 @@ pub struct _cef_domdocument_t {
   //
   // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Returns the document type.
   //
   pub fn get_type(&self) -> types::cef_dom_document_type_t {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
     }
@@ -630,17 +615,18 @@ impl CefWrap<*mut cef_domdocument_t> for
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDOMDocument::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -815,344 +801,366 @@ pub struct _cef_domnode_t {
   //
   // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Returns the type for this node.
   //
   pub fn get_type(&self) -> types::cef_dom_node_type_t {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_last_child.unwrap())(
           self.c_object))
     }
   }
@@ -1160,110 +1168,117 @@ impl CefDOMNode {
 
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_element_inner_text.unwrap())(
           self.c_object))
     }
   }
@@ -1280,16 +1295,17 @@ impl CefWrap<*mut cef_domnode_t> for Cef
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDOMNode::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_download_handler.rs
+++ b/servo/ports/cef/interfaces/cef_download_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Callback structure used to asynchronously continue a download.
 //
 #[repr(C)]
 pub struct _cef_before_download_callback_t {
   //
@@ -63,101 +64,106 @@ pub struct _cef_before_download_callback
   //
   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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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)))
@@ -176,17 +182,18 @@ impl CefWrap<*mut cef_before_download_ca
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefBeforeDownloadCallback::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -202,108 +209,155 @@ pub struct _cef_download_item_callback_t
 
   //
   // Call to cancel the download.
   //
   pub cancel: Option<extern "C" fn(this: *mut cef_download_item_callback_t) -> (
       )>,
 
   //
+  // Call to pause the download.
+  //
+  pub pause: Option<extern "C" fn(this: *mut cef_download_item_callback_t) -> (
+      )>,
+
+  //
+  // Call to resume the download.
+  //
+  pub resume: 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Call to cancel the download.
   //
   pub fn cancel(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cancel.unwrap())(
           self.c_object))
     }
   }
+
+  //
+  // Call to pause the download.
+  //
+  pub fn pause(&self) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).pause.unwrap())(
+          self.c_object))
+    }
+  }
+
+  //
+  // Call to resume the download.
+  //
+  pub fn resume(&self) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).resume.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)
@@ -312,17 +366,18 @@ impl CefWrap<*mut cef_download_item_call
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDownloadItemCallback::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -362,105 +417,110 @@ pub struct _cef_download_handler_t {
       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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -474,17 +534,18 @@ impl CefDownloadHandler {
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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),
@@ -504,16 +565,17 @@ impl CefWrap<*mut cef_download_handler_t
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDownloadHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_download_item.rs
+++ b/servo/ports/cef/interfaces/cef_download_item.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Structure used to represent a download item.
 //
 #[repr(C)]
 pub struct _cef_download_item_t {
   //
@@ -132,16 +133,23 @@ pub struct _cef_download_item_t {
   //
   // 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 original URL before any redirections.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub get_original_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.
@@ -155,315 +163,351 @@ pub struct _cef_download_item_t {
   //
   // 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: usize,
+  pub ref_count: u32,
 
   //
   // 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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*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() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*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() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_url.unwrap())(
           self.c_object))
     }
   }
 
   //
+  // Returns the original URL before any redirections.
+  //
+  // The resulting string must be freed by calling cef_string_userfree_free().
+  pub fn get_original_url(&self) -> String {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).get_original_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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_mime_type.unwrap())(
           self.c_object))
     }
   }
@@ -480,16 +524,17 @@ impl CefWrap<*mut cef_download_item_t> f
 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() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDownloadItem::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_drag_data.rs
+++ b/servo/ports/cef/interfaces/cef_drag_data.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 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 {
@@ -199,261 +200,277 @@ pub struct _cef_drag_data_t {
   //
   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: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_drag_data_t = _cef_drag_data_t;
 
 
 //
 // Structure used to represent drag data. The functions of this structure may be
 // called on any thread.
 //
 pub struct CefDragData {
   c_object: *mut cef_drag_data_t,
 }
 
 impl Clone for CefDragData {
   fn clone(&self) -> CefDragData{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefDragData {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefDragData {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefDragData {
   pub unsafe fn from_c_object(c_object: *mut cef_drag_data_t) -> CefDragData {
     CefDragData {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_drag_data_t) -> CefDragData {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefDragData {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_drag_data_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_drag_data_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Returns a copy of the current object.
   //
   pub fn clone(&self) -> interfaces::CefDragData {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).clone.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns true (1) if this object is read-only.
   //
   pub fn is_read_only(&self) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).is_read_only.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns true (1) if the drag data is a link.
   //
   pub fn is_link(&self) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).is_link.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns true (1) if the drag data is a text or html fragment.
   //
   pub fn is_fragment(&self) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).is_fragment.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns true (1) if the drag data is a file.
   //
   pub fn is_file(&self) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).is_file.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Return the link URL that is being dragged.
   //
   // 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() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_link_url.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Return the title associated with the link being dragged.
   //
   // The resulting string must be freed by calling cef_string_userfree_free().
   pub fn get_link_title(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_link_title.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Return the metadata, if any, associated with the link being dragged.
   //
   // The resulting string must be freed by calling cef_string_userfree_free().
   pub fn get_link_metadata(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_link_metadata.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Return the plain text fragment that is being dragged.
   //
   // The resulting string must be freed by calling cef_string_userfree_free().
   pub fn get_fragment_text(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_fragment_text.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Return the text/html fragment that is being dragged.
   //
   // The resulting string must be freed by calling cef_string_userfree_free().
   pub fn get_fragment_html(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_fragment_html.unwrap())(
           self.c_object))
     }
   }
 
   //
   // 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 fn get_fragment_base_url(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_fragment_base_url.unwrap())(
           self.c_object))
     }
   }
 
   //
   // 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 fn get_file_name(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_file_name.unwrap())(
           self.c_object))
     }
   }
@@ -461,154 +478,164 @@ impl CefDragData {
   //
   // 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 fn get_file_contents(&self,
       writer: interfaces::CefStreamWriter) -> libc::size_t {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_file_contents.unwrap())(
           self.c_object,
           CefWrap::to_c(writer)))
     }
   }
 
   //
   // Retrieve the list of file names that are being dragged into the browser
   // window.
   //
   pub fn get_file_names(&self, names: Vec<String>) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_file_names.unwrap())(
           self.c_object,
           CefWrap::to_c(names)))
     }
   }
 
   //
   // Set the link URL that is being dragged.
   //
   pub fn set_link_url(&self, url: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).set_link_url.unwrap())(
           self.c_object,
           CefWrap::to_c(url)))
     }
   }
 
   //
   // Set the title associated with the link being dragged.
   //
   pub fn set_link_title(&self, title: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).set_link_title.unwrap())(
           self.c_object,
           CefWrap::to_c(title)))
     }
   }
 
   //
   // Set the metadata associated with the link being dragged.
   //
   pub fn set_link_metadata(&self, data: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).set_link_metadata.unwrap())(
           self.c_object,
           CefWrap::to_c(data)))
     }
   }
 
   //
   // Set the plain text fragment that is being dragged.
   //
   pub fn set_fragment_text(&self, text: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).set_fragment_text.unwrap())(
           self.c_object,
           CefWrap::to_c(text)))
     }
   }
 
   //
   // Set the text/html fragment that is being dragged.
   //
   pub fn set_fragment_html(&self, html: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).set_fragment_html.unwrap())(
           self.c_object,
           CefWrap::to_c(html)))
     }
   }
 
   //
   // Set the base URL that the fragment came from.
   //
   pub fn set_fragment_base_url(&self, base_url: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).set_fragment_base_url.unwrap())(
           self.c_object,
           CefWrap::to_c(base_url)))
     }
   }
 
   //
   // 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 fn reset_file_contents(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).reset_file_contents.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Add a file that is being dragged into the webview.
   //
   pub fn add_file(&self, path: &[u16], display_name: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).add_file.unwrap())(
           self.c_object,
           CefWrap::to_c(path),
           CefWrap::to_c(display_name)))
@@ -638,16 +665,17 @@ impl CefWrap<*mut cef_drag_data_t> for C
 impl CefWrap<*mut cef_drag_data_t> for Option<CefDragData> {
   fn to_c(rust_object: Option<CefDragData>) -> *mut cef_drag_data_t {
     match rust_object {
       None => ptr::null_mut(),
       Some(rust_object) => rust_object.c_object_addrefed(),
     }
   }
   unsafe fn to_rust(c_object: *mut cef_drag_data_t) -> Option<CefDragData> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDragData::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_drag_handler.rs
+++ b/servo/ports/cef/interfaces/cef_drag_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Implement this structure to handle events related to dragging. The functions
 // of this structure will be called on the UI thread.
 //
 #[repr(C)]
 pub struct _cef_drag_handler_t {
@@ -65,104 +66,109 @@ pub struct _cef_drag_handler_t {
   pub on_drag_enter: Option<extern "C" fn(this: *mut cef_drag_handler_t,
       browser: *mut interfaces::cef_browser_t,
       dragData: *mut interfaces::cef_drag_data_t,
       mask: types::cef_drag_operations_mask_t) -> libc::c_int>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_drag_handler_t = _cef_drag_handler_t;
 
 
 //
 // Implement this structure to handle events related to dragging. The functions
 // of this structure will be called on the UI thread.
 //
 pub struct CefDragHandler {
   c_object: *mut cef_drag_handler_t,
 }
 
 impl Clone for CefDragHandler {
   fn clone(&self) -> CefDragHandler{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefDragHandler {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefDragHandler {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefDragHandler {
   pub unsafe fn from_c_object(c_object: *mut cef_drag_handler_t) -> CefDragHandler {
     CefDragHandler {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_drag_handler_t) -> CefDragHandler {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefDragHandler {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_drag_handler_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_drag_handler_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Called when an external drag event enters the browser window. |dragData|
   // contains the drag event data and |mask| represents the type of drag
   // operation. Return false (0) for default drag handling behavior or true (1)
   // to cancel the drag event.
   //
   pub fn on_drag_enter(&self, browser: interfaces::CefBrowser,
       dragData: interfaces::CefDragData,
       mask: types::cef_drag_operations_mask_t) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_drag_enter.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(dragData),
@@ -182,16 +188,17 @@ impl CefWrap<*mut cef_drag_handler_t> fo
 impl CefWrap<*mut cef_drag_handler_t> for Option<CefDragHandler> {
   fn to_c(rust_object: Option<CefDragHandler>) -> *mut cef_drag_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_drag_handler_t) -> Option<CefDragHandler> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefDragHandler::from_c_object_addref(c_object))
     }
   }
 }
 
new file mode 100644
--- /dev/null
+++ b/servo/ports/cef/interfaces/cef_find_handler.rs
@@ -0,0 +1,212 @@
+// Copyright (c) 2015 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::mem;
+use std::ptr;
+
+//
+// Implement this structure to handle events related to find results. The
+// functions of this structure will be called on the UI thread.
+//
+#[repr(C)]
+pub struct _cef_find_handler_t {
+  //
+  // Base structure.
+  //
+  pub base: types::cef_base_t,
+
+  //
+  // Called to report find results returned by cef_browser_host_t::find().
+  // |identifer| is the identifier passed to find(), |count| is the number of
+  // matches currently identified, |selectionRect| is the location of where the
+  // match was found (in window coordinates), |activeMatchOrdinal| is the
+  // current position in the search results, and |finalUpdate| is true (1) if
+  // this is the last find notification.
+  //
+  pub on_find_result: Option<extern "C" fn(this: *mut cef_find_handler_t,
+      browser: *mut interfaces::cef_browser_t, identifier: libc::c_int,
+      count: libc::c_int, selectionRect: *const types::cef_rect_t,
+      activeMatchOrdinal: libc::c_int, finalUpdate: libc::c_int) -> ()>,
+
+  //
+  // The reference count. This will only be present for Rust instances!
+  //
+  pub ref_count: u32,
+
+  //
+  // Extra data. This will only be present for Rust instances!
+  //
+  pub extra: u8,
+}
+
+pub type cef_find_handler_t = _cef_find_handler_t;
+
+
+//
+// Implement this structure to handle events related to find results. The
+// functions of this structure will be called on the UI thread.
+//
+pub struct CefFindHandler {
+  c_object: *mut cef_find_handler_t,
+}
+
+impl Clone for CefFindHandler {
+  fn clone(&self) -> CefFindHandler{
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
+      }
+      CefFindHandler {
+        c_object: self.c_object,
+      }
+    }
+  }
+}
+
+impl Drop for CefFindHandler {
+  fn drop(&mut self) {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
+      }
+    }
+  }
+}
+
+impl CefFindHandler {
+  pub unsafe fn from_c_object(c_object: *mut cef_find_handler_t) -> CefFindHandler {
+    CefFindHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub unsafe fn from_c_object_addref(c_object: *mut cef_find_handler_t) -> CefFindHandler {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
+      ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
+    }
+    CefFindHandler {
+      c_object: c_object,
+    }
+  }
+
+  pub fn c_object(&self) -> *mut cef_find_handler_t {
+    self.c_object
+  }
+
+  pub fn c_object_addrefed(&self) -> *mut cef_find_handler_t {
+    unsafe {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
+        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() || self.c_object as usize == mem::POST_DROP_USIZE
+  }
+  pub fn is_not_null_cef_object(&self) -> bool {
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
+  }
+
+  //
+  // Called to report find results returned by cef_browser_host_t::find().
+  // |identifer| is the identifier passed to find(), |count| is the number of
+  // matches currently identified, |selectionRect| is the location of where the
+  // match was found (in window coordinates), |activeMatchOrdinal| is the
+  // current position in the search results, and |finalUpdate| is true (1) if
+  // this is the last find notification.
+  //
+  pub fn on_find_result(&self, browser: interfaces::CefBrowser,
+      identifier: libc::c_int, count: libc::c_int,
+      selectionRect: &types::cef_rect_t, activeMatchOrdinal: libc::c_int,
+      finalUpdate: libc::c_int) -> () {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
+      panic!("called a CEF method on a null object")
+    }
+    unsafe {
+      CefWrap::to_rust(
+        ((*self.c_object).on_find_result.unwrap())(
+          self.c_object,
+          CefWrap::to_c(browser),
+          CefWrap::to_c(identifier),
+          CefWrap::to_c(count),
+          CefWrap::to_c(selectionRect),
+          CefWrap::to_c(activeMatchOrdinal),
+          CefWrap::to_c(finalUpdate)))
+    }
+  }
+} 
+
+impl CefWrap<*mut cef_find_handler_t> for CefFindHandler {
+  fn to_c(rust_object: CefFindHandler) -> *mut cef_find_handler_t {
+    rust_object.c_object_addrefed()
+  }
+  unsafe fn to_rust(c_object: *mut cef_find_handler_t) -> CefFindHandler {
+    CefFindHandler::from_c_object_addref(c_object)
+  }
+}
+impl CefWrap<*mut cef_find_handler_t> for Option<CefFindHandler> {
+  fn to_c(rust_object: Option<CefFindHandler>) -> *mut cef_find_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_find_handler_t) -> Option<CefFindHandler> {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
+      None
+    } else {
+      Some(CefFindHandler::from_c_object_addref(c_object))
+    }
+  }
+}
+
--- a/servo/ports/cef/interfaces/cef_focus_handler.rs
+++ b/servo/ports/cef/interfaces/cef_focus_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Implement this structure to handle events related to focus. The functions of
 // this structure will be called on the UI thread.
 //
 #[repr(C)]
 pub struct _cef_focus_handler_t {
@@ -78,103 +79,108 @@ pub struct _cef_focus_handler_t {
   // Called when the browser component has received focus.
   //
   pub on_got_focus: Option<extern "C" fn(this: *mut cef_focus_handler_t,
       browser: *mut interfaces::cef_browser_t) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_focus_handler_t = _cef_focus_handler_t;
 
 
 //
 // Implement this structure to handle events related to focus. The functions of
 // this structure will be called on the UI thread.
 //
 pub struct CefFocusHandler {
   c_object: *mut cef_focus_handler_t,
 }
 
 impl Clone for CefFocusHandler {
   fn clone(&self) -> CefFocusHandler{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefFocusHandler {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefFocusHandler {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefFocusHandler {
   pub unsafe fn from_c_object(c_object: *mut cef_focus_handler_t) -> CefFocusHandler {
     CefFocusHandler {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_focus_handler_t) -> CefFocusHandler {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefFocusHandler {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_focus_handler_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_focus_handler_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Called when the browser component is about to loose focus. For instance, if
   // focus was on the last HTML element and the user pressed the TAB key. |next|
   // will be true (1) if the browser is giving focus to the next component and
   // false (0) if the browser is giving focus to the previous component.
   //
   pub fn on_take_focus(&self, browser: interfaces::CefBrowser,
       next: libc::c_int) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_take_focus.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(next)))
@@ -183,33 +189,35 @@ impl CefFocusHandler {
 
   //
   // Called when the browser component is requesting focus. |source| indicates
   // where the focus request is originating from. Return false (0) to allow the
   // focus to be set or true (1) to cancel setting the focus.
   //
   pub fn on_set_focus(&self, browser: interfaces::CefBrowser,
       source: types::cef_focus_source_t) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_set_focus.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(source)))
     }
   }
 
   //
   // Called when the browser component has received focus.
   //
   pub fn on_got_focus(&self, browser: interfaces::CefBrowser) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_got_focus.unwrap())(
           self.c_object,
           CefWrap::to_c(browser)))
     }
@@ -227,16 +235,17 @@ impl CefWrap<*mut cef_focus_handler_t> f
 impl CefWrap<*mut cef_focus_handler_t> for Option<CefFocusHandler> {
   fn to_c(rust_object: Option<CefFocusHandler>) -> *mut cef_focus_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_focus_handler_t) -> Option<CefFocusHandler> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefFocusHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_frame.rs
+++ b/servo/ports/cef/interfaces/cef_frame.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Structure used to represent a frame in the 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.
 //
@@ -209,23 +210,23 @@ pub struct _cef_frame_t {
   // process.
   //
   pub visit_dom: Option<extern "C" fn(this: *mut cef_frame_t,
       visitor: *mut interfaces::cef_domvisitor_t) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_frame_t = _cef_frame_t;
 
 
 //
 // Structure used to represent a frame in the 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
@@ -233,269 +234,287 @@ pub type cef_frame_t = _cef_frame_t;
 //
 pub struct CefFrame {
   c_object: *mut cef_frame_t,
 }
 
 impl Clone for CefFrame {
   fn clone(&self) -> CefFrame{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefFrame {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefFrame {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefFrame {
   pub unsafe fn from_c_object(c_object: *mut cef_frame_t) -> CefFrame {
     CefFrame {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_frame_t) -> CefFrame {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefFrame {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_frame_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_frame_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // True if this object is currently attached to a valid frame.
   //
   pub fn is_valid(&self) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).is_valid.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Execute undo in this frame.
   //
   pub fn undo(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).undo.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Execute redo in this frame.
   //
   pub fn redo(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).redo.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Execute cut in this frame.
   //
   pub fn cut(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cut.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Execute copy in this frame.
   //
   pub fn copy(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).copy.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Execute paste in this frame.
   //
   pub fn paste(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).paste.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Execute delete in this frame.
   //
   pub fn del(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).del.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Execute select all in this frame.
   //
   pub fn select_all(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).select_all.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Save this frame's HTML source to a temporary file and open it in the
   // default text viewing application. This function can only be called from the
   // browser process.
   //
   pub fn view_source(&self) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).view_source.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Retrieve this frame's HTML source as a string sent to the specified
   // visitor.
   //
   pub fn get_source(&self, visitor: interfaces::CefStringVisitor) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_source.unwrap())(
           self.c_object,
           CefWrap::to_c(visitor)))
     }
   }
 
   //
   // Retrieve this frame's display text as a string sent to the specified
   // visitor.
   //
   pub fn get_text(&self, visitor: interfaces::CefStringVisitor) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_text.unwrap())(
           self.c_object,
           CefWrap::to_c(visitor)))
     }
   }
 
   //
   // Load the request represented by the |request| object.
   //
   pub fn load_request(&self, request: interfaces::CefRequest) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).load_request.unwrap())(
           self.c_object,
           CefWrap::to_c(request)))
     }
   }
 
   //
   // Load the specified |url|.
   //
   pub fn load_url(&self, url: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).load_url.unwrap())(
           self.c_object,
           CefWrap::to_c(url)))
     }
   }
 
   //
   // Load the contents of |string_val| with the specified dummy |url|. |url|
   // should have a standard scheme (for example, http scheme) or behaviors like
   // link clicks and web security restrictions may not behave as expected.
   //
   pub fn load_string(&self, string_val: &[u16], url: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).load_string.unwrap())(
           self.c_object,
           CefWrap::to_c(string_val),
           CefWrap::to_c(url)))
@@ -506,48 +525,51 @@ impl CefFrame {
   // Execute a string of JavaScript code in this frame. The |script_url|
   // parameter is the URL where the script in question can be found, if any. The
   // renderer may request this URL to show the developer the source of the
   // error.  The |start_line| parameter is the base line number to use for error
   // reporting.
   //
   pub fn execute_java_script(&self, code: &[u16], script_url: &[u16],
       start_line: libc::c_int) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).execute_java_script.unwrap())(
           self.c_object,
           CefWrap::to_c(code),
           CefWrap::to_c(script_url),
           CefWrap::to_c(start_line)))
     }
   }
 
   //
   // Returns true (1) if this is the main (top-level) frame.
   //
   pub fn is_main(&self) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).is_main.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns true (1) if this is the focused frame.
   //
   pub fn is_focused(&self) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).is_focused.unwrap())(
           self.c_object))
     }
   }
@@ -556,105 +578,112 @@ impl CefFrame {
   // Returns the name for this frame. If the frame has an assigned name (for
   // example, set via the iframe "name" attribute) then that value will be
   // returned. Otherwise a unique name will be constructed based on the frame
   // parent hierarchy. The main (top-level) frame will always have an NULL name
   // value.
   //
   // The resulting string must be freed by calling cef_string_userfree_free().
   pub fn get_name(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_name.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns the globally unique identifier for this frame.
   //
   pub fn get_identifier(&self) -> i64 {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_identifier.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns the parent of this frame or NULL if this is the main (top-level)
   // frame.
   //
   pub fn get_parent(&self) -> interfaces::CefFrame {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_parent.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns the URL currently loaded in this frame.
   //
   // The resulting string must be freed by calling cef_string_userfree_free().
   pub fn get_url(&self) -> String {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_url.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Returns the browser that this frame belongs to.
   //
   pub fn get_browser(&self) -> interfaces::CefBrowser {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_browser.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Get the V8 context associated with the frame. This function can only be
   // called from the render process.
   //
   pub fn get_v8context(&self) -> interfaces::CefV8Context {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).get_v8context.unwrap())(
           self.c_object))
     }
   }
 
   //
   // Visit the DOM document. This function can only be called from the render
   // process.
   //
   pub fn visit_dom(&self, visitor: interfaces::CefDOMVisitor) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).visit_dom.unwrap())(
           self.c_object,
           CefWrap::to_c(visitor)))
     }
@@ -672,16 +701,17 @@ impl CefWrap<*mut cef_frame_t> for CefFr
 impl CefWrap<*mut cef_frame_t> for Option<CefFrame> {
   fn to_c(rust_object: Option<CefFrame>) -> *mut cef_frame_t {
     match rust_object {
       None => ptr::null_mut(),
       Some(rust_object) => rust_object.c_object_addrefed(),
     }
   }
   unsafe fn to_rust(c_object: *mut cef_frame_t) -> Option<CefFrame> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefFrame::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_geolocation.rs
+++ b/servo/ports/cef/interfaces/cef_geolocation.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Implement this structure to receive geolocation updates. The functions of
 // this structure will be called on the browser process UI thread.
 //
 #[repr(C)]
 pub struct _cef_get_geolocation_callback_t {
@@ -62,101 +63,106 @@ pub struct _cef_get_geolocation_callback
   //
   pub on_location_update: Option<extern "C" fn(
       this: *mut cef_get_geolocation_callback_t,
       position: *const interfaces::cef_geoposition_t) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_get_geolocation_callback_t = _cef_get_geolocation_callback_t;
 
 
 //
 // Implement this structure to receive geolocation updates. The functions of
 // this structure will be called on the browser process UI thread.
 //
 pub struct CefGetGeolocationCallback {
   c_object: *mut cef_get_geolocation_callback_t,
 }
 
 impl Clone for CefGetGeolocationCallback {
   fn clone(&self) -> CefGetGeolocationCallback{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefGetGeolocationCallback {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefGetGeolocationCallback {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefGetGeolocationCallback {
   pub unsafe fn from_c_object(c_object: *mut cef_get_geolocation_callback_t) -> CefGetGeolocationCallback {
     CefGetGeolocationCallback {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_get_geolocation_callback_t) -> CefGetGeolocationCallback {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefGetGeolocationCallback {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_get_geolocation_callback_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_get_geolocation_callback_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Called with the 'best available' location information or, if the location
   // update failed, with error information.
   //
   pub fn on_location_update(&self, position: &interfaces::CefGeoposition) -> (
       ) {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_location_update.unwrap())(
           self.c_object,
           CefWrap::to_c(position)))
     }
@@ -174,16 +180,17 @@ impl CefWrap<*mut cef_get_geolocation_ca
 impl CefWrap<*mut cef_get_geolocation_callback_t> for Option<CefGetGeolocationCallback> {
   fn to_c(rust_object: Option<CefGetGeolocationCallback>) -> *mut cef_get_geolocation_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_get_geolocation_callback_t) -> Option<CefGetGeolocationCallback> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefGetGeolocationCallback::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_geolocation_handler.rs
+++ b/servo/ports/cef/interfaces/cef_geolocation_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Callback structure used for asynchronous continuation of geolocation
 // permission requests.
 //
 #[repr(C)]
 pub struct _cef_geolocation_callback_t {
@@ -60,99 +61,104 @@ pub struct _cef_geolocation_callback_t {
   // Call to allow or deny geolocation access.
   //
   pub cont: Option<extern "C" fn(this: *mut cef_geolocation_callback_t,
       allow: libc::c_int) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_geolocation_callback_t = _cef_geolocation_callback_t;
 
 
 //
 // Callback structure used for asynchronous continuation of geolocation
 // permission requests.
 //
 pub struct CefGeolocationCallback {
   c_object: *mut cef_geolocation_callback_t,
 }
 
 impl Clone for CefGeolocationCallback {
   fn clone(&self) -> CefGeolocationCallback{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefGeolocationCallback {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefGeolocationCallback {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefGeolocationCallback {
   pub unsafe fn from_c_object(c_object: *mut cef_geolocation_callback_t) -> CefGeolocationCallback {
     CefGeolocationCallback {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_geolocation_callback_t) -> CefGeolocationCallback {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefGeolocationCallback {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_geolocation_callback_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_geolocation_callback_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Call to allow or deny geolocation access.
   //
   pub fn cont(&self, allow: libc::c_int) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cont.unwrap())(
           self.c_object,
           CefWrap::to_c(allow)))
     }
@@ -170,17 +176,18 @@ impl CefWrap<*mut cef_geolocation_callba
 impl CefWrap<*mut cef_geolocation_callback_t> for Option<CefGeolocationCallback> {
   fn to_c(rust_object: Option<CefGeolocationCallback>) -> *mut cef_geolocation_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_geolocation_callback_t) -> Option<CefGeolocationCallback> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefGeolocationCallback::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -219,108 +226,113 @@ pub struct _cef_geolocation_handler_t {
       this: *mut cef_geolocation_handler_t,
       browser: *mut interfaces::cef_browser_t,
       requesting_url: *const types::cef_string_t, request_id: libc::c_int) -> (
       )>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_geolocation_handler_t = _cef_geolocation_handler_t;
 
 
 //
 // Implement this structure to handle events related to geolocation permission
 // requests. The functions of this structure will be called on the browser
 // process UI thread.
 //
 pub struct CefGeolocationHandler {
   c_object: *mut cef_geolocation_handler_t,
 }
 
 impl Clone for CefGeolocationHandler {
   fn clone(&self) -> CefGeolocationHandler{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefGeolocationHandler {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefGeolocationHandler {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefGeolocationHandler {
   pub unsafe fn from_c_object(c_object: *mut cef_geolocation_handler_t) -> CefGeolocationHandler {
     CefGeolocationHandler {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_geolocation_handler_t) -> CefGeolocationHandler {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefGeolocationHandler {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_geolocation_handler_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_geolocation_handler_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Called when a page requests permission to access geolocation information.
   // |requesting_url| is the URL requesting permission and |request_id| is the
   // unique ID for the permission request. Return true (1) and call
   // cef_geolocation_callback_t::cont() either in this function or at a later
   // time to continue or cancel the request. Return false (0) to cancel the
   // request immediately.
   //
   pub fn on_request_geolocation_permission(&self,
       browser: interfaces::CefBrowser, requesting_url: &[u16],
       request_id: libc::c_int,
       callback: interfaces::CefGeolocationCallback) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_request_geolocation_permission.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(requesting_url),
@@ -332,17 +344,18 @@ impl CefGeolocationHandler {
   //
   // Called when a geolocation access request is canceled. |requesting_url| is
   // the URL that originally requested permission and |request_id| is the unique
   // ID for the permission request.
   //
   pub fn on_cancel_geolocation_permission(&self,
       browser: interfaces::CefBrowser, requesting_url: &[u16],
       request_id: libc::c_int) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_cancel_geolocation_permission.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(requesting_url),
@@ -362,16 +375,17 @@ impl CefWrap<*mut cef_geolocation_handle
 impl CefWrap<*mut cef_geolocation_handler_t> for Option<CefGeolocationHandler> {
   fn to_c(rust_object: Option<CefGeolocationHandler>) -> *mut cef_geolocation_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_geolocation_handler_t) -> Option<CefGeolocationHandler> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefGeolocationHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_jsdialog_handler.rs
+++ b/servo/ports/cef/interfaces/cef_jsdialog_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Callback structure used for asynchronous continuation of JavaScript dialog
 // requests.
 //
 #[repr(C)]
 pub struct _cef_jsdialog_callback_t {
@@ -61,100 +62,105 @@ pub struct _cef_jsdialog_callback_t {
   // was pressed. The |user_input| value should be specified for prompt dialogs.
   //
   pub cont: Option<extern "C" fn(this: *mut cef_jsdialog_callback_t,
       success: libc::c_int, user_input: *const types::cef_string_t) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_jsdialog_callback_t = _cef_jsdialog_callback_t;
 
 
 //
 // Callback structure used for asynchronous continuation of JavaScript dialog
 // requests.
 //
 pub struct CefJSDialogCallback {
   c_object: *mut cef_jsdialog_callback_t,
 }
 
 impl Clone for CefJSDialogCallback {
   fn clone(&self) -> CefJSDialogCallback{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefJSDialogCallback {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefJSDialogCallback {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefJSDialogCallback {
   pub unsafe fn from_c_object(c_object: *mut cef_jsdialog_callback_t) -> CefJSDialogCallback {
     CefJSDialogCallback {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_jsdialog_callback_t) -> CefJSDialogCallback {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefJSDialogCallback {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_jsdialog_callback_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_jsdialog_callback_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Continue the JS dialog request. Set |success| to true (1) if the OK button
   // was pressed. The |user_input| value should be specified for prompt dialogs.
   //
   pub fn cont(&self, success: libc::c_int, user_input: &[u16]) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).cont.unwrap())(
           self.c_object,
           CefWrap::to_c(success),
           CefWrap::to_c(user_input)))
@@ -173,17 +179,18 @@ impl CefWrap<*mut cef_jsdialog_callback_
 impl CefWrap<*mut cef_jsdialog_callback_t> for Option<CefJSDialogCallback> {
   fn to_c(rust_object: Option<CefJSDialogCallback>) -> *mut cef_jsdialog_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_jsdialog_callback_t) -> Option<CefJSDialogCallback> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefJSDialogCallback::from_c_object_addref(c_object))
     }
   }
 }
 
 
@@ -250,92 +257,96 @@ pub struct _cef_jsdialog_handler_t {
   // Called when the default implementation dialog is closed.
   //
   pub on_dialog_closed: Option<extern "C" fn(this: *mut cef_jsdialog_handler_t,
       browser: *mut interfaces::cef_browser_t) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_jsdialog_handler_t = _cef_jsdialog_handler_t;
 
 
 //
 // Implement this structure to handle events related to JavaScript dialogs. The
 // functions of this structure will be called on the UI thread.
 //
 pub struct CefJSDialogHandler {
   c_object: *mut cef_jsdialog_handler_t,
 }
 
 impl Clone for CefJSDialogHandler {
   fn clone(&self) -> CefJSDialogHandler{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefJSDialogHandler {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefJSDialogHandler {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefJSDialogHandler {
   pub unsafe fn from_c_object(c_object: *mut cef_jsdialog_handler_t) -> CefJSDialogHandler {
     CefJSDialogHandler {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_jsdialog_handler_t) -> CefJSDialogHandler {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefJSDialogHandler {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_jsdialog_handler_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_jsdialog_handler_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
   // Called to run a JavaScript dialog. The |default_prompt_text| value will be
   // specified for prompt dialogs only. Set |suppress_message| to true (1) and
   // return false (0) to suppress the message (suppressing messages is
   // preferable to immediately executing the callback as this is used to detect
   // presumably malicious behavior like spamming alert messages in
@@ -348,17 +359,18 @@ impl CefJSDialogHandler {
   // the application must execute |callback| once the custom dialog is
   // dismissed.
   //
   pub fn on_jsdialog(&self, browser: interfaces::CefBrowser, origin_url: &[u16],
       accept_lang: &[u16], dialog_type: types::cef_jsdialog_type_t,
       message_text: &[u16], default_prompt_text: &[u16],
       callback: interfaces::CefJSDialogCallback,
       suppress_message: &mut libc::c_int) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_jsdialog.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(origin_url),
@@ -377,17 +389,18 @@ impl CefJSDialogHandler {
   // application will use a custom dialog or if the callback has been executed
   // immediately. Custom dialogs may be either modal or modeless. If a custom
   // dialog is used the application must execute |callback| once the custom
   // dialog is dismissed.
   //
   pub fn on_before_unload_dialog(&self, browser: interfaces::CefBrowser,
       message_text: &[u16], is_reload: libc::c_int,
       callback: interfaces::CefJSDialogCallback) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_before_unload_dialog.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(message_text),
@@ -397,32 +410,34 @@ impl CefJSDialogHandler {
   }
 
   //
   // Called to cancel any pending dialogs and reset any saved dialog state. Will
   // be called due to events like page navigation irregardless of whether any
   // dialogs are currently pending.
   //
   pub fn on_reset_dialog_state(&self, browser: interfaces::CefBrowser) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_reset_dialog_state.unwrap())(
           self.c_object,
           CefWrap::to_c(browser)))
     }
   }
 
   //
   // Called when the default implementation dialog is closed.
   //
   pub fn on_dialog_closed(&self, browser: interfaces::CefBrowser) -> () {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_dialog_closed.unwrap())(
           self.c_object,
           CefWrap::to_c(browser)))
     }
@@ -440,16 +455,17 @@ impl CefWrap<*mut cef_jsdialog_handler_t
 impl CefWrap<*mut cef_jsdialog_handler_t> for Option<CefJSDialogHandler> {
   fn to_c(rust_object: Option<CefJSDialogHandler>) -> *mut cef_jsdialog_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_jsdialog_handler_t) -> Option<CefJSDialogHandler> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefJSDialogHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_keyboard_handler.rs
+++ b/servo/ports/cef/interfaces/cef_keyboard_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,16 +38,17 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Implement this structure to handle events related to keyboard input. The
 // functions of this structure will be called on the UI thread.
 //
 #[repr(C)]
 pub struct _cef_keyboard_handler_t {
@@ -76,103 +77,108 @@ pub struct _cef_keyboard_handler_t {
   pub on_key_event: Option<extern "C" fn(this: *mut cef_keyboard_handler_t,
       browser: *mut interfaces::cef_browser_t,
       event: *const interfaces::cef_key_event_t,
       os_event: types::cef_event_handle_t) -> libc::c_int>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_keyboard_handler_t = _cef_keyboard_handler_t;
 
 
 //
 // Implement this structure to handle events related to keyboard input. The
 // functions of this structure will be called on the UI thread.
 //
 pub struct CefKeyboardHandler {
   c_object: *mut cef_keyboard_handler_t,
 }
 
 impl Clone for CefKeyboardHandler {
   fn clone(&self) -> CefKeyboardHandler{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefKeyboardHandler {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefKeyboardHandler {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefKeyboardHandler {
   pub unsafe fn from_c_object(c_object: *mut cef_keyboard_handler_t) -> CefKeyboardHandler {
     CefKeyboardHandler {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_keyboard_handler_t) -> CefKeyboardHandler {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefKeyboardHandler {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_keyboard_handler_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_keyboard_handler_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   // Called before a keyboard event is sent to the renderer. |event| contains
   // information about the keyboard event. |os_event| is the operating system
   // event message, if any. Return true (1) if the event was handled or false
   // (0) otherwise. If the event will be handled in on_key_event() as a keyboard
   // shortcut set |is_keyboard_shortcut| to true (1) and return false (0).
   pub fn on_pre_key_event(&self, browser: interfaces::CefBrowser,
       event: &interfaces::CefKeyEvent, os_event: types::cef_event_handle_t,
       is_keyboard_shortcut: &mut libc::c_int) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_pre_key_event.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(event),
@@ -185,17 +191,18 @@ impl CefKeyboardHandler {
   // Called after the renderer and JavaScript in the page has had a chance to
   // handle the event. |event| contains information about the keyboard event.
   // |os_event| is the operating system event message, if any. Return true (1)
   // if the keyboard event was handled or false (0) otherwise.
   //
   pub fn on_key_event(&self, browser: interfaces::CefBrowser,
       event: &interfaces::CefKeyEvent,
       os_event: types::cef_event_handle_t) -> libc::c_int {
-    if self.c_object.is_null() {
+    if self.c_object.is_null() ||
+       self.c_object as usize == mem::POST_DROP_USIZE {
       panic!("called a CEF method on a null object")
     }
     unsafe {
       CefWrap::to_rust(
         ((*self.c_object).on_key_event.unwrap())(
           self.c_object,
           CefWrap::to_c(browser),
           CefWrap::to_c(event),
@@ -215,16 +222,17 @@ impl CefWrap<*mut cef_keyboard_handler_t
 impl CefWrap<*mut cef_keyboard_handler_t> for Option<CefKeyboardHandler> {
   fn to_c(rust_object: Option<CefKeyboardHandler>) -> *mut cef_keyboard_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_keyboard_handler_t) -> Option<CefKeyboardHandler> {
-    if c_object.is_null() {
+    if c_object.is_null() &&
+       c_object as usize != mem::POST_DROP_USIZE {
       None
     } else {
       Some(CefKeyboardHandler::from_c_object_addref(c_object))
     }
   }
 }
 
--- a/servo/ports/cef/interfaces/cef_life_span_handler.rs
+++ b/servo/ports/cef/interfaces/cef_life_span_handler.rs
@@ -1,9 +1,9 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2015 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
@@ -38,47 +38,55 @@
 
 use eutil;
 use interfaces;
 use types;
 use wrappers::CefWrap;
 
 use libc;
 use std::collections::HashMap;
+use std::mem;
 use std::ptr;
 
 //
 // Implement this structure to handle events related to browser life span. The
 // functions of this structure will be called on the UI thread unless otherwise
 // indicated.
 //
 #[repr(C)]
 pub struct _cef_life_span_handler_t {
   //
   // Base structure.
   //
   pub base: types::cef_base_t,
 
   //
-  // Called on the IO thread before a new popup window is created. The |browser|
-  // and |frame| parameters represent the source of the popup request. The
-  // |target_url| and |target_frame_name| values may be NULL if none were
-  // specified with the request. The |popupFeatures| structure contains
-  // information about the requested popup window. To allow creation of the
-  // popup window optionally modify |windowInfo|, |client|, |settings| and
-  // |no_javascript_access| and return false (0). To cancel creation of the
-  // popup window return true (1). The |client| and |settings| values will
-  // default to the source browser's values. The |no_javascript_access| value
-  // indicates whether the new browser window should be scriptable and in the
-  // same process as the source browser.
+  // Called on the IO thread before a new popup browser is created. The
+  // |browser| and |frame| values represent the source of the popup request. The
+  // |target_url| and |target_frame_name| values indicate where the popup
+  // browser should navigate and may be NULL if not specified with the request.
+  // The |target_disposition| value indicates where the user intended to open
+  // the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
+  // be true (1) if the popup was opened via explicit user gesture (e.g.
+  // clicking a link) or false (0) if the popup opened automatically (e.g. via
+  // the DomContentLoaded event). The |popupFeatures| structure contains
+  // additional information about the requested popup window. To allow creation
+  // of the popup browser optionally modify |windowInfo|, |client|, |settings|
+  // and |no_javascript_access| and return false (0). To cancel creation of the
+  // popup browser return true (1). The |client| and |settings| values will
+  // default to the source browser's values. If the |no_javascript_access| value
+  // is set to false (0) the new browser will not be scriptable and may not be
+  // hosted in the same renderer process as the source browser.
   pub on_before_popup: Option<extern "C" fn(this: *mut cef_life_span_handler_t,
       browser: *mut interfaces::cef_browser_t,
       frame: *mut interfaces::cef_frame_t,
       target_url: *const types::cef_string_t,
       target_frame_name: *const types::cef_string_t,
+      target_disposition: types::cef_window_open_disposition_t,
+      user_gesture: libc::c_int,
       popupFeatures: *const interfaces::cef_popup_features_t,
       windowInfo: *mut interfaces::cef_window_info_t,
       client: *mut interfaces::cef_client_t,
       settings: *mut interfaces::cef_browser_settings_t,
       no_javascript_access: *mut libc::c_int) -> libc::c_int>,
 
   //
   // Called after a new browser is created.
@@ -90,17 +98,17 @@ pub struct _cef_life_span_handler_t {
   // Called when a modal window is about to display and the modal loop should
   // begin running. Return false (0) to use the default modal loop
   // implementation or true (1) to use a custom implementation.
   //
   pub run_modal: Option<extern "C" fn(this: *mut cef_life_span_handler_t,
       browser: *mut interfaces::cef_browser_t) -> libc::c_int>,
 
   //
-  // Called when a browser has received a request to close. This may result
+  // Called when a browser has recieved a request to close. This may result
   // directly from a call to cef_browser_host_t::close_browser() or indirectly
   // if the browser is a top-level OS window created by CEF and the user
   // attempts to close the window. This function will be called after the
   // JavaScript 'onunload' event has been fired. It will not be called for
   // browsers after the associated OS window has been destroyed (for those
   // browsers it is no longer possible to cancel the close).
   //
   // If CEF created an OS window for the browser returning false (0) will send
@@ -163,167 +171,183 @@ pub struct _cef_life_span_handler_t {
   // additional usage information.
   //
   pub on_before_close: Option<extern "C" fn(this: *mut cef_life_span_handler_t,
       browser: *mut interfaces::cef_browser_t) -> ()>,
 
   //
   // The reference count. This will only be present for Rust instances!
   //
-  pub ref_count: usize,
+  pub ref_count: u32,
 
   //
   // Extra data. This will only be present for Rust instances!
   //
   pub extra: u8,
-} 
+}
 
 pub type cef_life_span_handler_t = _cef_life_span_handler_t;
 
 
 //
 // Implement this structure to handle events related to browser life span. The
 // functions of this structure will be called on the UI thread unless otherwise
 // indicated.
 //
 pub struct CefLifeSpanHandler {
   c_object: *mut cef_life_span_handler_t,
 }
 
 impl Clone for CefLifeSpanHandler {
   fn clone(&self) -> CefLifeSpanHandler{
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
       }
       CefLifeSpanHandler {
         c_object: self.c_object,
       }
     }
   }
 }
 
 impl Drop for CefLifeSpanHandler {
   fn drop(&mut self) {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         ((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
       }
     }
   }
 }
 
 impl CefLifeSpanHandler {
   pub unsafe fn from_c_object(c_object: *mut cef_life_span_handler_t) -> CefLifeSpanHandler {
     CefLifeSpanHandler {
       c_object: c_object,
     }
   }
 
   pub unsafe fn from_c_object_addref(c_object: *mut cef_life_span_handler_t) -> CefLifeSpanHandler {
-    if !c_object.is_null() {
+    if !c_object.is_null() &&
+        c_object as usize != mem::POST_DROP_USIZE {
       ((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
     }
     CefLifeSpanHandler {
       c_object: c_object,
     }
   }
 
   pub fn c_object(&self) -> *mut cef_life_span_handler_t {
     self.c_object
   }
 
   pub fn c_object_addrefed(&self) -> *mut cef_life_span_handler_t {
     unsafe {
-      if !self.c_object.is_null() {
+      if !self.c_object.is_null() &&
+          self.c_object as usize != mem::POST_DROP_USIZE {
         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()
+    self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
   }
   pub fn is_not_null_cef_object(&self) -> bool {
-    !self.c_object.is_null()
+    !self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
   }
 
   //
-  // Called on the IO thread before a new popup window is created. The |browser|
-  // and |frame| parameters represent the source of the popup request. The
-  // |target_url| and |target_frame_name| values may be NULL if none were
-  // specified with the request. The |popupFeatures| structure contains
-  // information about the requested popup window. To allow creation of the
-  // popup window optionally modify |windowInfo|, |client|, |settings| and
-  // |no_javascript_access| and return false (0). To cancel creation of the
-  // popup window return true (1). The |client| and |settings| values will
-  // default to the source browser's values. The |no_javascript_access| value
-  // indicates whether the new browser window should be scriptable and in the
-  // same process as the source browser.
+  // Called on the IO thread before a new popup browser is created. The
+  // |browser| and |frame| values represent the source of the popup request. The