mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Remove readfile callback
This commit is contained in:
parent
b7e9bab267
commit
475756ec2f
6 changed files with 42 additions and 119 deletions
|
@ -111,7 +111,6 @@ android {
|
|||
|
||||
sourceSets {
|
||||
main {
|
||||
assets.srcDirs = [rootDir.absolutePath + "/../../../target/android/resources"]
|
||||
}
|
||||
armDebug {
|
||||
jniLibs.srcDirs = [getJniLibsPath(true, 'arm')]
|
||||
|
|
|
@ -97,8 +97,6 @@ public class JNIServo {
|
|||
void onHistoryChanged(boolean canGoBack, boolean canGoForward);
|
||||
|
||||
void onShutdownComplete();
|
||||
|
||||
byte[] readfile(String file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,9 @@
|
|||
package org.mozilla.servoview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.AssetManager;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.FutureTask;
|
||||
|
||||
|
@ -20,7 +17,6 @@ import org.mozilla.servoview.JNIServo.ServoOptions;
|
|||
|
||||
public class Servo {
|
||||
private static final String LOGTAG = "Servo";
|
||||
private AssetManager mAssetMgr;
|
||||
private JNIServo mJNI = new JNIServo();
|
||||
private RunCallback mRunCallback;
|
||||
private boolean mShuttingDown;
|
||||
|
@ -37,8 +33,6 @@ public class Servo {
|
|||
|
||||
mRunCallback = runCallback;
|
||||
|
||||
mAssetMgr = activity.getResources().getAssets();
|
||||
|
||||
mServoCallbacks = new Callbacks(client, gfxcb);
|
||||
|
||||
mRunCallback.inGLThread(() -> {
|
||||
|
@ -262,18 +256,5 @@ public class Servo {
|
|||
public void onRedrawing(boolean redrawing) {
|
||||
mRunCallback.inUIThread(() -> mClient.onRedrawing(redrawing));
|
||||
}
|
||||
|
||||
public byte[] readfile(String file) {
|
||||
try {
|
||||
InputStream stream = mAssetMgr.open(file);
|
||||
byte[] bytes = new byte[stream.available()];
|
||||
stream.read(bytes);
|
||||
stream.close();
|
||||
return bytes;
|
||||
} catch (IOException e) {
|
||||
Log.e(LOGTAG, "readfile error: " + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue