Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedding: revenge of cargo #6175

Merged
merged 27 commits into from May 27, 2015
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d7ad5d6
add cef method for notifying the main loop of work available
May 19, 2015
83e605d
add no_mangle to servo_test() embedding function
May 19, 2015
af1dce5
add new browser process interface method for main loop integration
May 19, 2015
caa8172
implement cef browser title setting callback
May 19, 2015
cf388cd
call compositor.window.set_page_url() on WindowEvent::LoadUrl
May 19, 2015
92d44fb
send ChangeUrl message from constellation on init
May 19, 2015
02606fa
implement on_address_change handler for cef port
May 19, 2015
a809d6b
remove unused cef imports
May 19, 2015
efc75ef
ignore KEYEVENT_RAWKEYDOWN in cef browser events
May 21, 2015
28aed52
improve cef keyboard handling
May 21, 2015
1e4ceb0
more accurately handle key modifiers in cef
May 21, 2015
cd9dab7
implement cef_load_handler::on_load_start()
May 22, 2015
3481c75
add CompositorMsg::LoadStart, implement cef_load_handler::on_loading_…
May 22, 2015
0d46a3b
add navigation state data to LoadComplete messages, finish cef load s…
May 22, 2015
3f8d8a3
add back/forward/loading members to ServoCefBrowser with related brow…
May 22, 2015
68fc512
add error enum for chromium net errors, create window method for erro…
May 26, 2015
8e78feb
make cef_errorcode_t a typedef for net::NetError
May 26, 2015
14a6390
add embedding method for load_handler::on_load_error
May 26, 2015
90169e8
force resize after sending cef_browser::on_after_created() callback
May 26, 2015
aef3218
Revert "temp re-set default url for cef while I figure out wtf is goi…
May 26, 2015
64ff2c4
handle early LoadURL messages without panicking by sending initial ur…
May 26, 2015
45116dc
break out cef app wakeup code into separate pub function
May 27, 2015
fcf4495
handle case of deleted pipeline when preparing to send load_end const…
May 27, 2015
b1ae5e7
make Opts.url an Option<> type, only emit initial url load if url exists
May 27, 2015
81eb426
when creating a cef browser, setup the url to load but don't load it
May 27, 2015
ca1f49a
spawn a task for cef async browser creation to kick the main loop awake
May 27, 2015
8c278d3
fix glutin headless compile errors
May 27, 2015
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

when creating a cef browser, setup the url to load but don't load it

cef apps will expect to enter their main loops before this happens due to
various callbacks being hit, so it's necessary to punt this loading off until
a later time
  • Loading branch information
Mike Blumenkrantz
Mike Blumenkrantz committed May 27, 2015
commit 81eb426b04ab6d68f542fb047bb9706795d0f3a5
@@ -264,7 +264,7 @@ pub fn browser_callback_after_created(browser: CefBrowser) {
life_span_handler.on_after_created(browser.clone());
}
browser.downcast().callback_executed.set(true);
browser.downcast().host.was_resized();
browser.downcast().frame.load();
}

fn browser_host_create(window_info: &cef_window_info_t,
@@ -274,12 +274,12 @@ fn browser_host_create(window_info: &cef_window_info_t,
-> CefBrowser {
let browser = ServoCefBrowser::new(window_info, client).as_cef_interface();
browser.init(window_info);
if url != ptr::null() {
unsafe { browser.downcast().frame.set_url(CefWrap::to_rust(url)); }
}
if callback_executed {
browser_callback_after_created(browser.clone());
}
if url != ptr::null() {
unsafe { browser.downcast().frame.load_url(CefWrap::to_rust(url)); }
}
BROWSERS.with(|browsers| {
browsers.borrow_mut().push(browser.clone());
});
@@ -53,10 +53,20 @@ full_cef_class_impl! {

pub trait ServoCefFrameExtensions {
fn set_browser(&self, browser: CefBrowser);
fn set_url(&self, url: &[u16]);
fn load(&self);
}

impl ServoCefFrameExtensions for CefFrame {
fn set_browser(&self, browser: CefBrowser) {
*self.downcast().browser.borrow_mut() = Some(browser)
}
fn set_url(&self, url: &[u16]) {
let frame = self.downcast();
*frame.url.borrow_mut() = String::from_utf16(url).unwrap();
}
fn load(&self) {
let event = WindowEvent::LoadUrl(self.downcast().url.borrow().clone());
self.downcast().browser.borrow_mut().as_mut().unwrap().send_window_event(event);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.