aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-09-10 10:39:24 -0400
committerGitHub <noreply@github.com>2018-09-10 10:39:24 -0400
commitf37124563bf3332c3f1a441bb77ec1fba3ce431b (patch)
treeda8749b8d02d1fab88b2b5ac778dfd0c81f6b765
parent78ad1df0b008c782cc496bed45c5898c2ba545ac (diff)
parent77f38a07890fa6b734d00d77c2602ce36f4ba858 (diff)
downloadservo-f37124563bf3332c3f1a441bb77ec1fba3ce431b.tar.gz
servo-f37124563bf3332c3f1a441bb77ec1fba3ce431b.zip
Auto merge of #21658 - paulrouget:loaduri, r=jdm
Save initial URI even for all loadUri methods <!-- 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/21658) <!-- Reviewable:end -->
-rw-r--r--support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoSurface.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoSurface.java b/support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoSurface.java
index b2848e764fc..305dbb7a885 100644
--- a/support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoSurface.java
+++ b/support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoSurface.java
@@ -38,7 +38,7 @@ public class ServoSurface {
private Servo mServo;
private Client mClient = null;
private String mServoArgs = "";
- private Uri mInitialUri = null;
+ private String mInitialUri = null;
private Activity mActivity;
public ServoSurface(Surface surface, int width, int height) {
@@ -82,7 +82,15 @@ public class ServoSurface {
}
public void loadUri(String uri) {
- mServo.loadUri(uri);
+ if (mServo != null) {
+ mServo.loadUri(uri);
+ } else {
+ mInitialUri = uri;
+ }
+ }
+
+ public void loadUri(Uri uri) {
+ loadUri(uri.toString());
}
public void scrollStart(int dx, int dy, int x, int y) {
@@ -105,14 +113,6 @@ public class ServoSurface {
mServo.resize(width, height);
}
- public void loadUri(Uri uri) {
- if (mServo != null) {
- mServo.loadUri(uri.toString());
- } else {
- mInitialUri = uri;
- }
- }
-
static class GLSurface implements GfxCallbacks {
private EGLConfig[] mEGLConfigs;
private EGLDisplay mEglDisplay;
@@ -196,15 +196,14 @@ public class ServoSurface {
GLSurface surface = new GLSurface(mASurface);
- final boolean showLogs = true;
- String uri = mInitialUri == null ? null : mInitialUri.toString();
-
mGLLooperHandler = new Handler() {
public void handleMessage(Message msg) {
}
};
inUIThread(() -> {
+ final boolean showLogs = true;
+ String uri = mInitialUri == null ? null : mInitialUri;
mServo = new Servo(this, surface, mClient, mActivity, mServoArgs, uri, mWidth, mHeight, showLogs);
});