Auto merge of #21364 - jdm:android-stop, r=paulrouget

Avoid crash when pressing stop button on Android

This doesn't actually implement stopping; it just works around the crash that happens when you press it.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21328
- [x] These changes do not require tests because we have no tests for the android UI

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21364)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-08-09 12:40:57 -04:00 committed by GitHub
commit ac7f895204
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View file

@ -194,6 +194,12 @@ impl ServoGlue {
self.process_event(event) self.process_event(event)
} }
/// Stop loading the page.
pub fn stop(&mut self) -> Result<(), &'static str> {
debug!("TODO can't stop won't stop");
Ok(())
}
/// Go back in history. /// Go back in history.
pub fn go_back(&mut self) -> Result<(), &'static str> { pub fn go_back(&mut self) -> Result<(), &'static str> {
debug!("go_back"); debug!("go_back");

View file

@ -138,6 +138,12 @@ pub extern "C" fn reload() {
call(|s| s.reload()); call(|s| s.reload());
} }
#[no_mangle]
pub extern "C" fn stop() {
debug!("stop");
call(|s| s.stop());
}
#[no_mangle] #[no_mangle]
pub extern "C" fn go_back() { pub extern "C" fn go_back() {
debug!("go_back"); debug!("go_back");

View file

@ -139,6 +139,12 @@ pub fn Java_com_mozilla_servoview_JNIServo_reload(env: JNIEnv, _class: JClass) {
call(env, |s| s.reload()); call(env, |s| s.reload());
} }
#[no_mangle]
pub fn Java_com_mozilla_servoview_JNIServo_stop(env: JNIEnv, _class: JClass) {
debug!("stop");
call(env, |s| s.stop());
}
#[no_mangle] #[no_mangle]
pub fn Java_com_mozilla_servoview_JNIServo_goBack(env: JNIEnv, _class: JClass) { pub fn Java_com_mozilla_servoview_JNIServo_goBack(env: JNIEnv, _class: JClass) {
debug!("goBack"); debug!("goBack");