Bug 938827 - Part 4: Remove remaining reflection from FennecNativeDriver. r=rnewman
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 06 Dec 2013 11:43:11 -0800
changeset 174918 fc610be8d6754483a55e00c883e24832c50946cf
parent 174917 4c1017736f23b6137c6baa86ce04b34e513555d5
child 174919 334bc44411df112e7538715e3816d3e50447e62d
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs938827
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 938827 - Part 4: Remove remaining reflection from FennecNativeDriver. r=rnewman
build/mobile/robocop/FennecNativeDriver.java
--- a/build/mobile/robocop/FennecNativeDriver.java
+++ b/build/mobile/robocop/FennecNativeDriver.java
@@ -19,21 +19,16 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.nio.IntBuffer;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.InvocationHandler;
-
 import android.app.Activity;
 import android.opengl.GLSurfaceView;
 import android.view.View;
 import android.util.Log;
 
 import org.json.*;
 
 import com.jayway.android.robotium.solo.Solo;
@@ -45,21 +40,16 @@ public class FennecNativeDriver implemen
     private HashMap mLocators = null;
     private Activity mActivity;
     private Solo mSolo;
     private String mRootPath;
 
     private static String mLogFile = null;
     private static LogLevel mLogLevel = LogLevel.INFO;
 
-    // Objects for reflexive access of fennec classes.
-    private ClassLoader mClassLoader;
-    private Class mApiClass;
-    private Object mRobocopApi;
-
     public enum LogLevel {
         DEBUG(1),
         INFO(2),
         WARN(3),
         ERROR(4);
 
         private int mValue;
         LogLevel(int value) {
@@ -75,27 +65,16 @@ public class FennecNativeDriver implemen
 
     public FennecNativeDriver(Activity activity, Solo robocop, String rootPath) {
         mActivity = activity;
         mSolo = robocop;
         mRootPath = rootPath;
 
         // Set up table of fennec_ids.
         mLocators = convertTextToTable(getFile(mRootPath + "/fennec_ids.txt"));
-
-        // Set up reflexive access of java classes and methods.
-        try {
-            mClassLoader = activity.getClassLoader();
-
-            mApiClass = mClassLoader.loadClass("org.mozilla.gecko.RobocopAPI");
-
-            mRobocopApi = mApiClass.getConstructor(Activity.class).newInstance(activity);
-        } catch (Exception e) {
-            log(LogLevel.ERROR, e);
-        }
     }
 
     //Information on the location of the Gecko Frame.
     private boolean mGeckoInfo = false;
     private int mGeckoTop = 100;
     private int mGeckoLeft = 0;
     private int mGeckoHeight= 700;
     private int mGeckoWidth = 1024;