Skip to content

Instantly share code, notes, and snippets.

diff --git a/ports/cef/core.rs b/ports/cef/core.rs
index aa49bb1..b878181 100644
--- a/ports/cef/core.rs
+++ b/ports/cef/core.rs
@@ -3,12 +3,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use command_line::command_line_init;
-use interfaces::cef_app_t;
+use interfaces::{cef_app_t,CefApp};
match keycode {
KeyboardCode::VKEY_RIGHT => Some(constellation_msg::Key::Right),
KeyboardCode::VKEY_LEFT => Some(constellation_msg::Key::Left),
KeyboardCode::VKEY_UP => Some(constellation_msg::Key::Up),
KeyboardCode::VKEY_DOWN => Some(constellation_msg::Key::Down),
KeyboardCode::VKEY_RSHIFT => Some(constellation_msg::Key::RightShift),
KeyboardCode::VKEY_SHIFT | KeyboardCode::VKEY_LSHIFT => Some(constellation_msg::Key::LeftShift),
KeyboardCode::VKEY_RCONTROL => Some(constellation_msg::Key::RightControl),
KeyboardCode::VKEY_CONTROL | KeyboardCode::VKEY_LCONTROL => Some(constellation_msg::Key::LeftControl),
KeyboardCode::VKEY_LWIN => Some(constellation_msg::Key::LeftSuper),
enum KeyboardCode {
VKEY_BACK = 0x08,
VKEY_TAB = 0x09,
VKEY_BACKTAB = 0x0A,
VKEY_CLEAR = 0x0C,
VKEY_RETURN = 0x0D,
VKEY_SHIFT = 0x10,
VKEY_CONTROL = 0x11,
VKEY_MENU = 0x12,
VKEY_PAUSE = 0x13,
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 18f6618..56db74d 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -384,6 +384,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.scroll_fragment_to_point(pipeline_id, layer_id, point);
}
+ (Msg::Status(message), ShutdownState::NotShuttingDown) => {
+ self.window.status(message);
pub struct ServoCefFrame {
pub title_visitor: RefCell<Option<CefStringVisitor>>,
pub url: RefCell<String>,
/// A reference to the browser.
pub browser: RefCell<Option<CefBrowser>>,
}
fn set_url(&self, url: &[u16]) {
let frame = self.downcast();
impl<'a> CefWrap<*const cef_string_utf16_t> for String {
fn to_c(_: String) -> *const cef_string_utf16_t {
panic!("unimplemented CEF type conversion: cef_string_t");
}
unsafe fn to_rust(string: *const cef_string_utf16_t) -> String {
String::from_utf16(slice::from_raw_parts((*string).str, (*string).length as usize)).unwrap();
}
}
impl<'a> CefWrap<*mut cef_string_utf16_t> for String {
/* 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_app_t, CefApp, cef_drag_data_t, cef_post_data_element_t, cef_v8value_t, CefPostDataElement};
use interfaces::{CefV8Value};
use interfaces::{cef_download_handler_t, cef_drag_handler_t, cef_context_menu_handler_t};
use interfaces::{cef_dialog_handler_t, cef_focus_handler_t};
use interfaces::{cef_load_handler_t, cef_request_handler_t};
use interfaces::{cef_geolocation_handler_t, cef_jsdialog_handler_t, cef_keyboard_handler_t};
@zmike
zmike / gist:9115f37d88380e5e9fc9
Created June 20, 2015 17:03
cef valgrind errors
==20775== Invalid read of size 8
==20775== at 0x4A0B060: memcpy@GLIBC_2.2.5 (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20775== by 0x579176D: string::cef_string_utf16_set::__rust_abi (string.rs:178)
==20775== by 0x570B3DF: cef_string_utf16_set (in /home/zmike/src/servo-pr/target/debug/libembedding.so)
==20775== by 0x579AD78: string_map::cef_string_map_append::closure.36539 (string_map.rs:34)
==20775== by 0x579AC52: result::Result$LT$T$C$$u20$E$GT$::map::h12235557764119884889 (result.rs:477)
==20775== by 0x579AB98: eutil::slice_to_str::h1744020717738111721 (eutil.rs:25)
==20775== by 0x579AADD: string_map::cef_string_map_append::__rust_abi (string_map.rs:32)
==20775== by 0x579AA49: cef_string_map_append (in /home/zmike/src/servo-pr/target/debug/libembedding.so)
==20775== by 0x400E11: test_all (cef_test_string_map.c:74)
[1159157.316] -> [email protected](7, "wl_shell", 1)
[1159157.363] -> [email protected](8, "xdg_shell", 1)
[1159157.460] [email protected](7, "wl_shell", 1)
[1159157.496] -> [email protected](7, "wl_shell", 1, new id [unknown]@16)
[1159157.537] [email protected](8, "xdg_shell", 1)
[1159157.554] -> [email protected](8, "xdg_shell", 1, new id [unknown]@17)
[1159157.576] -> [email protected]_unstable_version(5)
ESTART: 9.56785 [0.01736] - SLEEP
[1159158.355] [email protected](7, "wl_shell", 1, new id [unknown]@16)
[1159158.383] [email protected](8, "xdg_shell", 1, new id [unknown]@17)
#0 0x0000003cd8c0936e in __pthread_mutex_lock_full () from /lib64/libpthread.so.0
#1 0x0000003a96a0590e in wl_proxy_marshal_array_constructor (proxy=0x1575c50, opcode=1, args=0x7ffd93530a70,
interface=0x7ded80 <wl_registry_interface>) at src/wayland-client.c:587
#2 0x0000003a96a05bf5 in wl_proxy_marshal_constructor (proxy=0x1575c50, opcode=1,
interface=0x7ded80 <wl_registry_interface>) at src/wayland-client.c:680
#3 0x00000000005848d0 in wl_display_get_registry (wl_display=0x1575c50)
at /usr/include/wayland-client-protocol.h:189
#4 0x000000000058c391 in e_comp_wl_init () at src/bin/e_comp_wl.c:2808
#5 0x00007fba39801518 in e_modapi_init (m=0x14ee500) at src/modules/wl_drm/e_mod_main.c:696
#6 0x0000000000519062 in e_module_enable (m=0x14ee500) at src/bin/e_module.c:487