Bug 1342508 - [2.1] Make code style consistent across GeckoView. r=jchen
authorEugen Sawin <esawin@mozilla.com>
Fri, 24 Feb 2017 19:39:35 +0100
changeset 374156 35286e286abadc6f2ebdbcd2739a014d2d3e6051
parent 374155 de31af4868b396fb7d80dbfe1d60f1803ff1ee02
child 374157 e00f58c31a85ad03e6eccfa99926f75687041254
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1342508
milestone54.0a1
Bug 1342508 - [2.1] Make code style consistent across GeckoView. r=jchen
mobile/android/base/java/org/mozilla/gecko/PresentationView.java
mobile/android/chrome/content/GeckoViewContent.js
mobile/android/chrome/content/geckoview.js
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoViewFragment.java
mobile/android/modules/GeckoViewContent.jsm
mobile/android/modules/GeckoViewModule.jsm
mobile/android/modules/GeckoViewNavigation.jsm
mobile/android/modules/GeckoViewProgress.jsm
mobile/android/modules/GeckoViewSettings.jsm
--- a/mobile/android/base/java/org/mozilla/gecko/PresentationView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/PresentationView.java
@@ -12,16 +12,16 @@ import org.mozilla.gecko.GeckoView;
 import org.mozilla.gecko.ScreenManagerHelper;
 
 import android.content.Context;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
 
 public class PresentationView extends GeckoView {
     private static final String LOGTAG = "PresentationView";
-    private static final String presentationViewURI = "chrome://browser/content/PresentationView.xul";
+    private static final String PRESENTATION_VIEW_URI = "chrome://browser/content/PresentationView.xul";
 
     public PresentationView(Context context, String deviceId, int screenId) {
         super(context);
-        this.chromeURI = presentationViewURI + "#" + deviceId;
-        this.screenId = screenId;
+        this.mChromeUri = PRESENTATION_VIEW_URI + "#" + deviceId;
+        this.mScreenId = screenId;
     }
 }
--- a/mobile/android/chrome/content/GeckoViewContent.js
+++ b/mobile/android/chrome/content/GeckoViewContent.js
@@ -2,40 +2,39 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.d.bind(null, "ViewContent");
 
-var DEBUG = false;
+function debug(aMsg) {
+  // dump(aMsg);
+}
 
 // This is copied from desktop's tab-content.js. See bug 1153485 about sharing this code somehow.
 var DOMTitleChangedListener = {
   init: function() {
     addEventListener("DOMTitleChanged", this, false);
   },
 
-  receiveMessage: function(message) {
-    if (DEBUG) {
-      dump("receiveMessage " + message.name);
-    }
+  receiveMessage: function(aMsg) {
+    debug("receiveMessage " + aMsg.name);
   },
 
   handleEvent: function(aEvent) {
     if (aEvent.originalTarget.defaultView != content) {
       return;
     }
 
-    if (DEBUG) {
-      dump("handleEvent " + aEvent.type);
-    }
+    debug("handleEvent " + aEvent.type);
 
     switch (aEvent.type) {
       case "DOMTitleChanged":
-        sendAsyncMessage("GeckoView:DOMTitleChanged", { title: content.document.title });
+        sendAsyncMessage("GeckoView:DOMTitleChanged",
+                         { title: content.document.title });
         break;
     }
   },
 };
 
 DOMTitleChangedListener.init();
--- a/mobile/android/chrome/content/geckoview.js
+++ b/mobile/android/chrome/content/geckoview.js
@@ -24,29 +24,30 @@ var dump = Cu.import("resource://gre/mod
 // and remove by calling
 //   remove(<type name>)
 var ModuleManager = {
   init: function() {
     this.browser = document.getElementById("content");
     this.modules = {};
   },
 
-  add: function(resource, type, ...args) {
-    this.remove(type);
+  add: function(aResource, aType, ...aArgs) {
+    this.remove(aType);
     let scope = {};
-    Cu.import(resource, scope);
-    this.modules[type] = new scope[type](
-      window, this.browser, WindowEventDispatcher, ...args);
+    Cu.import(aResource, scope);
+    this.modules[aType] = new scope[aType](
+      window, this.browser, WindowEventDispatcher, ...aArgs
+    );
   },
 
-  remove: function(type) {
-    if (!(type in this.modules)) {
+  remove: function(aType) {
+    if (!(aType in this.modules)) {
       return;
     }
-    delete this.modules[type];
+    delete this.modules[aType];
   }
 };
 
 function startup() {
   ModuleManager.init();
   ModuleManager.add("resource://gre/modules/GeckoViewSettings.jsm",
                     "GeckoViewSettings");
   ModuleManager.add("resource://gre/modules/GeckoViewContent.jsm",
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
@@ -38,38 +38,38 @@ import android.view.inputmethod.InputCon
 public class GeckoView extends LayerView
     implements ContextGetter {
 
     private static final String DEFAULT_SHARED_PREFERENCES_FILE = "GeckoView";
     private static final String LOGTAG = "GeckoView";
 
     private static final boolean DEBUG = false;
 
-    private final EventDispatcher eventDispatcher = new EventDispatcher();
+    private final EventDispatcher mEventDispatcher = new EventDispatcher();
 
     private ChromeDelegate mChromeDelegate;
     /* package */ ContentListener mContentListener;
     /* package */ NavigationListener mNavigationListener;
     /* package */ ProgressListener mProgressListener;
     private InputConnectionListener mInputConnectionListener;
 
     private GeckoViewSettings mSettings;
 
-    protected boolean onAttachedToWindowCalled;
-    protected String chromeURI;
-    protected int screenId = 0; // default to the primary screen
+    protected boolean mOnAttachedToWindowCalled;
+    protected String mChromeUri;
+    protected int mScreenId = 0; // default to the primary screen
 
     @WrapForJNI(dispatchTo = "proxy")
     protected static final class Window extends JNIObject {
         @WrapForJNI(skip = true)
         /* package */ Window() {}
 
         static native void open(Window instance, GeckoView view,
                                 Object compositor, EventDispatcher dispatcher,
-                                String chromeURI, GeckoBundle settings,
+                                String chromeUri, GeckoBundle settings,
                                 int screenId);
 
         @Override protected native void disposeNative();
         native void close();
         native void reattach(GeckoView view, Object compositor, EventDispatcher dispatcher);
         native void loadUri(String uri, int flags);
     }
 
@@ -137,17 +137,17 @@ public class GeckoView extends LayerView
 
             if ("GeckoView:DOMTitleChanged".equals(event)) {
                 if (mContentListener != null) {
                     mContentListener.onTitleChanged(GeckoView.this, message.getString("title"));
                 }
             } else if ("GeckoView:LocationChange".equals(event)) {
                 if (mNavigationListener == null) {
                     // We shouldn't be getting this event.
-                    eventDispatcher.dispatch("GeckoViewNavigation:Inactive", null);
+                    mEventDispatcher.dispatch("GeckoViewNavigation:Inactive", null);
                 } else {
                     mNavigationListener.onLocationChange(GeckoView.this, message.getString("uri"));
                     mNavigationListener.onCanGoBack(GeckoView.this, message.getBoolean("canGoBack"));
                     mNavigationListener.onCanGoForward(GeckoView.this, message.getBoolean("canGoForward"));
                 }
             } else if ("GeckoView:PageStart".equals(event)) {
                 if (mProgressListener != null) {
                     mProgressListener.onPageStart(GeckoView.this, message.getString("uri"));
@@ -195,94 +195,90 @@ public class GeckoView extends LayerView
 
         initializeView();
         listener.registerListeners();
 
         mSettings = new GeckoViewSettings(getEventDispatcher());
     }
 
     @Override
-    protected Parcelable onSaveInstanceState()
-    {
+    protected Parcelable onSaveInstanceState() {
         final Parcelable superState = super.onSaveInstanceState();
         stateSaved = true;
         return new StateBinder(superState, this.window);
     }
 
     @Override
-    protected void onRestoreInstanceState(final Parcelable state)
-    {
+    protected void onRestoreInstanceState(final Parcelable state) {
         final StateBinder stateBinder = (StateBinder) state;
 
         if (stateBinder.window != null) {
             this.window = stateBinder.window;
         }
         stateSaved = false;
 
-        if (onAttachedToWindowCalled) {
+        if (mOnAttachedToWindowCalled) {
             reattachWindow();
         }
 
         // We have to always call super.onRestoreInstanceState because View keeps
         // track of these calls and throws an exception when we don't call it.
         super.onRestoreInstanceState(stateBinder.superState);
     }
 
     protected void openWindow() {
-        if (chromeURI == null) {
-            chromeURI = getGeckoInterface().getDefaultChromeURI();
+        if (mChromeUri == null) {
+            mChromeUri = getGeckoInterface().getDefaultChromeURI();
         }
 
         if (GeckoThread.isStateAtLeast(GeckoThread.State.PROFILE_READY)) {
-            Window.open(window, this, getCompositor(), eventDispatcher,
-                        chromeURI, mSettings.asBundle(), screenId);
+            Window.open(window, this, getCompositor(), mEventDispatcher,
+                        mChromeUri, mSettings.asBundle(), mScreenId);
         } else {
             GeckoThread.queueNativeCallUntil(
                 GeckoThread.State.PROFILE_READY,
                 Window.class, "open", window,
                 GeckoView.class, this,
                 Object.class, getCompositor(),
-                EventDispatcher.class, eventDispatcher,
-                String.class, chromeURI,
+                EventDispatcher.class, mEventDispatcher,
+                String.class, mChromeUri,
                 GeckoBundle.class, mSettings.asBundle(),
-                screenId);
+                mScreenId);
         }
     }
 
     protected void reattachWindow() {
         if (GeckoThread.isStateAtLeast(GeckoThread.State.PROFILE_READY)) {
-            window.reattach(this, getCompositor(), eventDispatcher);
+            window.reattach(this, getCompositor(), mEventDispatcher);
         } else {
             GeckoThread.queueNativeCallUntil(GeckoThread.State.PROFILE_READY,
                     window, "reattach", GeckoView.class, this,
-                    Object.class, getCompositor(), EventDispatcher.class, eventDispatcher);
+                    Object.class, getCompositor(), EventDispatcher.class, mEventDispatcher);
         }
     }
 
     @Override
-    public void onAttachedToWindow()
-    {
+    public void onAttachedToWindow() {
         final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
 
         if (window == null) {
             // Open a new nsWindow if we didn't have one from before.
             window = new Window();
             openWindow();
         } else {
             reattachWindow();
         }
 
         super.onAttachedToWindow();
 
-        onAttachedToWindowCalled = true;
+        mOnAttachedToWindowCalled = true;
     }
 
     @Override
-    public void onDetachedFromWindow()
-    {
+    public void onDetachedFromWindow() {
         super.onDetachedFromWindow();
         super.destroy();
 
         if (stateSaved) {
             // If we saved state earlier, we don't want to close the nsWindow.
             return;
         }
 
@@ -291,17 +287,17 @@ public class GeckoView extends LayerView
             window.disposeNative();
         } else {
             GeckoThread.queueNativeCallUntil(GeckoThread.State.PROFILE_READY,
                     window, "close");
             GeckoThread.queueNativeCallUntil(GeckoThread.State.PROFILE_READY,
                     window, "disposeNative");
         }
 
-        onAttachedToWindowCalled = false;
+        mOnAttachedToWindowCalled = false;
     }
 
     @WrapForJNI public static final int LOAD_DEFAULT = 0;
     @WrapForJNI public static final int LOAD_NEW_TAB = 1;
     @WrapForJNI public static final int LOAD_SWITCH_TAB = 2;
 
     /**
     * Load the given URI.
@@ -319,35 +315,35 @@ public class GeckoView extends LayerView
             GeckoThread.queueNativeCall(window, "loadUri", String.class, uri, flags);
         }
     }
 
     /**
     * Reload the current URI.
     */
     public void reload() {
-        eventDispatcher.dispatch("GeckoView:Reload", null);
+        mEventDispatcher.dispatch("GeckoView:Reload", null);
     }
 
     /* package */ void setInputConnectionListener(final InputConnectionListener icl) {
         mInputConnectionListener = icl;
     }
 
     /**
     * Go back in history.
     */
     public void goBack() {
-        eventDispatcher.dispatch("GeckoView:GoBack", null);
+        mEventDispatcher.dispatch("GeckoView:GoBack", null);
     }
 
     /**
     * Go forward in history.
     */
     public void goForward() {
-        eventDispatcher.dispatch("GeckoView:GoForward", null);
+        mEventDispatcher.dispatch("GeckoView:GoForward", null);
     }
 
     public GeckoViewSettings getSettings() {
         return mSettings;
     }
 
     @Override
     public Handler getHandler() {
@@ -472,19 +468,19 @@ public class GeckoView extends LayerView
     * This will replace the current handler.
     * @param navigation An implementation of NavigationListener.
     */
     public void setNavigationDelegate(NavigationListener listener) {
         if (mNavigationListener == listener) {
             return;
         }
         if (listener == null) {
-            eventDispatcher.dispatch("GeckoViewNavigation:Inactive", null);
+            mEventDispatcher.dispatch("GeckoViewNavigation:Inactive", null);
         } else if (mNavigationListener == null) {
-            eventDispatcher.dispatch("GeckoViewNavigation:Active", null);
+            mEventDispatcher.dispatch("GeckoViewNavigation:Active", null);
         }
 
         mNavigationListener = listener;
     }
 
     /**
     * Get the navigation callback handler.
     * @return The current navigation callback handler.
@@ -506,17 +502,17 @@ public class GeckoView extends LayerView
     }
 
     @Override
     public SharedPreferences getSharedPreferences() {
         return getContext().getSharedPreferences(getSharedPreferencesFile(), 0);
     }
 
     public EventDispatcher getEventDispatcher() {
-        return eventDispatcher;
+        return mEventDispatcher;
     }
 
     /* Provides a means for the client to indicate whether a JavaScript
      * dialog request should proceed. An instance of this class is passed to
      * various GeckoViewChrome callback actions.
      */
     public class PromptResult {
         public PromptResult() {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoViewFragment.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoViewFragment.java
@@ -12,41 +12,41 @@ import android.util.Log;
 import android.util.SparseArray;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 
 public class GeckoViewFragment extends android.support.v4.app.Fragment {
     private static final String LOGTAG = "GeckoViewFragment";
 
-    private static Parcelable state = null;
-    private static GeckoViewFragment lastUsed = null;
-    private GeckoView geckoView = null;
+    private static Parcelable mSavedState = null;
+    private static GeckoViewFragment mLastUsed = null;
+    private GeckoView mGeckoView = null;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         setRetainInstance(true);
         super.onCreate(savedInstanceState);
     }
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        geckoView = new GeckoView(getContext());
-        return geckoView;
+        mGeckoView = new GeckoView(getContext());
+        return mGeckoView;
     }
 
     @Override
     public void onResume() {
-        if (state != null && lastUsed != this) {
+        if (mSavedState != null && mLastUsed != this) {
             // "Restore" the window from the previously used GeckoView to this GeckoView and attach it
-            geckoView.onRestoreInstanceState(state);
-            state = null;
+            mGeckoView.onRestoreInstanceState(mSavedState);
+            mSavedState = null;
         }
         super.onResume();
     }
 
     @Override
     public void onPause() {
-        state = geckoView.onSaveInstanceState();
-        lastUsed = this;
+        mSavedState = mGeckoView.onSaveInstanceState();
+        mLastUsed = this;
         super.onPause();
     }
 }
--- a/mobile/android/modules/GeckoViewContent.jsm
+++ b/mobile/android/modules/GeckoViewContent.jsm
@@ -8,37 +8,38 @@ this.EXPORTED_SYMBOLS = ["GeckoViewConte
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/GeckoViewModule.jsm");
 
 var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {})
            .AndroidLog.d.bind(null, "ViewContent");
 
-var DEBUG = false;
+function debug(aMsg) {
+  // dump(aMsg);
+}
 
 class GeckoViewContent extends GeckoViewModule {
   init() {
     this.window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = this;
 
     this.messageManager.loadFrameScript("chrome://browser/content/GeckoViewContent.js", true);
     this.messageManager.addMessageListener("GeckoView:DOMTitleChanged", this);
   }
 
-  handleEvent(event) {
-    if (DEBUG) {
-      dump("handleEvent: event.type=" + event.type);
-    }
+  handleEvent(aEvent) {
+    debug("handleEvent: aEvent.type=" + aEvent.type);
   }
 
   // Message manager event handler.
-  receiveMessage(msg) {
-    if (DEBUG) {
-      dump("receiveMessage " + msg.name);
-    }
+  receiveMessage(aMsg) {
+    debug("receiveMessage " + aMsg.name);
 
-    switch (msg.name) {
+    switch (aMsg.name) {
       case "GeckoView:DOMTitleChanged":
-        this.eventDispatcher.sendRequest({ type: "GeckoView:DOMTitleChanged", title: msg.data.title });
+        this.eventDispatcher.sendRequest({
+          type: "GeckoView:DOMTitleChanged",
+          title: aMsg.data.title
+        });
         break;
     }
   }
 }
--- a/mobile/android/modules/GeckoViewModule.jsm
+++ b/mobile/android/modules/GeckoViewModule.jsm
@@ -6,25 +6,25 @@
 
 this.EXPORTED_SYMBOLS = ["GeckoViewModule"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {})
            .AndroidLog.d.bind(null, "ViewModule");
 
-function debug(msg) {
-  // dump(msg);
+function debug(aMsg) {
+  // dump(aMsg);
 }
 
 class GeckoViewModule {
-  constructor(window, browser, eventDispatcher) {
-    this.window = window;
-    this.browser = browser;
-    this.eventDispatcher = eventDispatcher;
+  constructor(aWindow, aBrowser, aEventDispatcher) {
+    this.window = aWindow;
+    this.browser = aBrowser;
+    this.eventDispatcher = aEventDispatcher;
 
     this.eventDispatcher.registerListener(
       () => this.onSettingsUpdate(),
       "GeckoView:UpdateSettings");
 
     this.init();
     this.onSettingsUpdate();
   }
--- a/mobile/android/modules/GeckoViewNavigation.jsm
+++ b/mobile/android/modules/GeckoViewNavigation.jsm
@@ -12,18 +12,18 @@ Cu.import("resource://gre/modules/GeckoV
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventDispatcher",
   "resource://gre/modules/Messaging.jsm");
 
 var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {})
            .AndroidLog.d.bind(null, "ViewNavigation");
 
-function debug(msg) {
-  // dump(msg);
+function debug(aMsg) {
+  // dump(aMsg);
 }
 
 // Handles navigation requests between Gecko and a GeckoView.
 // Implements GeckoView.loadUri via openURI.
 // Handles GeckoView:GoBack and :GoForward requests dispatched by
 // GeckoView.goBack and .goForward.
 // Dispatches GeckoView:LocationChange to the GeckoView on location change when
 // active.
@@ -42,20 +42,20 @@ class GeckoViewNavigation extends GeckoV
       "GeckoViewNavigation:Inactive",
       "GeckoView:GoBack",
       "GeckoView:GoForward",
       "GeckoView:Reload",
     ]);
   }
 
   // Bundle event handler.
-  onEvent(event, data, callback) {
-    debug("onEvent: event=" + event + ", data=" + JSON.stringify(data));
+  onEvent(aEvent, aData, aCallback) {
+    debug("onEvent: aEvent=" + aEvent + ", aData=" + JSON.stringify(aData));
 
-    switch (event) {
+    switch (aEvent) {
       case "GeckoViewNavigation:Active":
         this.registerProgressListener();
         break;
       case "GeckoViewNavigation:Inactive":
         this.unregisterProgressListener();
         break;
       case "GeckoView:GoBack":
         this.browser.goBack();
@@ -65,25 +65,25 @@ class GeckoViewNavigation extends GeckoV
         break;
       case "GeckoView:Reload":
         this.browser.reload();
         break;
     }
   }
 
   // Message manager event handler.
-  receiveMessage(msg) {
-    debug("receiveMessage " + msg.name);
+  receiveMessage(aMsg) {
+    debug("receiveMessage " + aMsg.name);
   }
 
   // nsIBrowserDOMWindow::openURI implementation.
-  openURI(uri, opener, where, flags) {
-    debug("openURI: uri.spec=" + uri.spec);
+  openURI(aUri, aOpener, aWhere, aFlags) {
+    debug("openURI: aUri.spec=" + aUri.spec);
     // nsIWebNavigation::loadURI(URI, loadFlags, referrer, postData, headers).
-    this.browser.loadURI(uri.spec, null, null, null);
+    this.browser.loadURI(aUri.spec, null, null, null);
   }
 
   // nsIBrowserDOMWindow::canClose implementation.
   canClose() {
     debug("canClose");
     return false;
   }
 
@@ -102,23 +102,23 @@ class GeckoViewNavigation extends GeckoV
     if (!this.progressFilter) {
       return;
     }
     this.progressFilter.removeProgressListener(this);
     this.browser.removeProgressListener(this.progressFilter);
   }
 
   // WebProgress event handler.
-  onLocationChange(webProgress, request, locationURI, flags) {
+  onLocationChange(aWebProgress, aRequest, aLocationURI, aFlags) {
     debug("onLocationChange");
 
-    let fixedURI = locationURI;
+    let fixedURI = aLocationURI;
 
     try {
-      fixedURI = URIFixup.createExposableURI(locationURI);
+      fixedURI = URIFixup.createExposableURI(aLocationURI);
     } catch (ex) { }
 
     let message = {
       type: "GeckoView:LocationChange",
       uri: fixedURI.spec,
       canGoBack: this.browser.canGoBack,
       canGoForward: this.browser.canGoForward,
     };
--- a/mobile/android/modules/GeckoViewProgress.jsm
+++ b/mobile/android/modules/GeckoViewProgress.jsm
@@ -12,69 +12,66 @@ Cu.import("resource://gre/modules/GeckoV
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventDispatcher",
   "resource://gre/modules/Messaging.jsm");
 
 var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {})
            .AndroidLog.d.bind(null, "ViewNavigation");
 
-var DEBUG = false;
+function debug(aMsg) {
+  // dump(aMsg);
+}
 
 class GeckoViewProgress extends GeckoViewModule {
   init() {
     this.window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = this;
 
     this.registerProgressListener();
   }
 
   registerProgressListener() {
-    if (DEBUG) {
-      dump("registerProgressListeners()");
-    }
+    debug("registerProgressListeners()");
 
     let flags = Ci.nsIWebProgress.NOTIFY_STATE_NETWORK | Ci.nsIWebProgress.NOTIFY_SECURITY;
     this.progressFilter =
       Cc["@mozilla.org/appshell/component/browser-status-filter;1"]
       .createInstance(Ci.nsIWebProgress);
     this.progressFilter.addProgressListener(this, flags);
     this.browser.addProgressListener(this.progressFilter, flags);
   }
 
   onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
-    if (DEBUG) {
-      dump("onStateChange()");
-    }
+    debug("onStateChange()");
 
     if (!aWebProgress.isTopLevel) {
       return;
     }
 
     if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
       let uri = aRequest.QueryInterface(Ci.nsIChannel).URI;
       let message = {
         type: "GeckoView:PageStart",
         uri: uri.spec,
       };
 
       this.eventDispatcher.sendRequest(message);
-    } else if ((aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) && !aWebProgress.isLoadingDocument) {
+    } else if ((aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) &&
+               !aWebProgress.isLoadingDocument) {
       let message = {
         type: "GeckoView:PageStop",
         success: aStatus ? false : true
       };
 
       this.eventDispatcher.sendRequest(message);
     }
   }
 
   onSecurityChange(aWebProgress, aRequest, aState) {
-    if (DEBUG) {
-      dump("onSecurityChange()");
-    }
+    debug("onSecurityChange()");
 
     let message = {
       type: "GeckoView:SecurityChanged",
       status: aState
     };
 
     this.eventDispatcher.sendRequest(message);
   }
--- a/mobile/android/modules/GeckoViewSettings.jsm
+++ b/mobile/android/modules/GeckoViewSettings.jsm
@@ -12,18 +12,18 @@ Cu.import("resource://gre/modules/GeckoV
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "SafeBrowsing",
   "resource://gre/modules/SafeBrowsing.jsm");
 
 var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {})
            .AndroidLog.d.bind(null, "ViewSettings");
 
-function debug(msg) {
-  // dump(msg);
+function debug(aMsg) {
+  // dump(aMsg);
 }
 
 // Handles GeckoView settings including:
 // * tracking protection
 class GeckoViewSettings extends GeckoViewModule {
   init() {
     this._isSafeBrowsingInit = false;
     this._useTrackingProtection = false;
@@ -34,22 +34,22 @@ class GeckoViewSettings extends GeckoVie
 
     this.useTrackingProtection = !!this.settings.useTrackingProtection;
   }
 
   get useTrackingProtection() {
     return this._useTrackingProtection;
   }
 
-  set useTrackingProtection(use) {
-    if (use && !this._isSafeBrowsingInit) {
+  set useTrackingProtection(aUse) {
+    if (aUse && !this._isSafeBrowsingInit) {
       SafeBrowsing.init();
       this._isSafeBrowsingInit = true;
     }
-    if (use != this._useTrackingProtection) {
+    if (aUse != this._useTrackingProtection) {
       this.messageManager.loadFrameScript('data:,' +
-        'docShell.useTrackingProtection = ' + use,
+        'docShell.useTrackingProtection = ' + aUse,
         true
       );
-      this._useTrackingProtection = use;
+      this._useTrackingProtection = aUse;
     }
   }
 }