Backed out 2 changesets (bug 1437551) for build bustages on Android /builds/worker/workspace/build/src/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java a=backout CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Mon, 23 Apr 2018 23:50:55 +0300
changeset 468697 5724b08c3cbd1e09b415b6205f97eb8e3506127d
parent 468696 644cb19702cac87f72ddf282e7653ed42a3bced8
child 468698 5582b64d4a8b25276cfe1f4e035e37fbd7701f6b
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1437551
milestone61.0a1
backs out4b780b06d2ebf392432bcf9a326aeba9a17cef61
a401bb9e1aa43b6e093f86da59160973f29daaaa
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
Backed out 2 changesets (bug 1437551) for build bustages on Android /builds/worker/workspace/build/src/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java a=backout CLOSED TREE Backed out changeset 4b780b06d2eb (bug 1437551) Backed out changeset a401bb9e1aa4 (bug 1437551)
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/RuntimeTelemetry.java
toolkit/components/telemetry/geckoview/GeckoViewTelemetryController.jsm
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
@@ -15,17 +15,16 @@ import android.util.Log;
 
 import org.mozilla.gecko.EventDispatcher;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.GeckoThread;
 import org.mozilla.gecko.PrefsHelper;
 import org.mozilla.gecko.util.BundleEventListener;
 import org.mozilla.gecko.util.EventCallback;
 import org.mozilla.gecko.util.GeckoBundle;
-import org.mozilla.gecko.util.ThreadUtils;
 
 public final class GeckoRuntime implements Parcelable {
     private static final String LOGTAG = "GeckoRuntime";
     private static final boolean DEBUG = false;
 
     private static GeckoRuntime sDefaultRuntime;
 
     /**
@@ -46,17 +45,16 @@ public final class GeckoRuntime implemen
             sDefaultRuntime.init(new GeckoRuntimeSettings());
         }
 
         return sDefaultRuntime;
     }
 
     private GeckoRuntimeSettings mSettings;
     private Delegate mDelegate;
-    private RuntimeTelemetry mTelemetry;
 
     /**
      * Attach the runtime to the given context.
      *
      * @param context The new context to attach to.
      */
     public void attachTo(final @NonNull Context context) {
         if (DEBUG) {
@@ -191,31 +189,16 @@ public final class GeckoRuntime implemen
     public GeckoRuntimeSettings getSettings() {
         return mSettings;
     }
 
     /* package */ void setPref(final String name, final Object value) {
         PrefsHelper.setPref(name, value, /* flush */ false);
     }
 
-    /**
-     * Return the telemetry object for this runtime.
-     *
-     * @return The telemetry object.
-     */
-    public RuntimeTelemetry getTelemetry() {
-        ThreadUtils.assertOnUiThread();
-
-        if (mTelemetry == null) {
-            mTelemetry = new RuntimeTelemetry(this);
-        }
-        return mTelemetry;
-
-    }
-
     @Override // Parcelable
     public int describeContents() {
         return 0;
     }
 
     @Override // Parcelable
     public void writeToParcel(Parcel out, int flags) {
         out.writeParcelable(mSettings, flags);
deleted file mode 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/RuntimeTelemetry.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * vim: ts=4 sw=4 expandtab:
- * 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/. */
-
-package org.mozilla.geckoview;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.support.annotation.IntDef;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.util.Log;
-
-import org.mozilla.gecko.EventDispatcher;
-import org.mozilla.gecko.util.GeckoBundle;
-import org.mozilla.gecko.util.EventCallback;
-
-/**
- * The telemetry API gives access to telemetry data of the Gecko runtime.
- */
-public final class RuntimeTelemetry {
-    private final static String LOGTAG = "GeckoViewTelemetry";
-    private final static boolean DEBUG = false;
-
-    private final GeckoRuntime mRuntime;
-    private final EventDispatcher mEventDispatcher;
-
-    @Retention(RetentionPolicy.SOURCE)
-    @IntDef({ DATASET_BASE, DATASET_EXTENDED })
-    public @interface DatasetType {}
-
-    // Match with nsITelemetry.
-    /**
-     * The base dataset suitable for release builds.
-     */
-    public static final int DATASET_BASE = 0;
-    /**
-     * The extended dataset suitable for pre-release builds.
-     */
-    public static final int DATASET_EXTENDED = 1;
-
-    @IntDef(flag = true,
-            value = { SNAPSHOT_HISTOGRAMS, SNAPSHOT_KEYED_HISTOGRAMS,
-                      SNAPSHOT_SCALARS, SNAPSHOT_KEYED_SCALARS,
-                      SNAPSHOT_ALL })
-    public @interface SnapshotType {}
-
-    // Match with GeckoViewTelemetryController.
-    /**
-     * Adds a "histogram" object entry to the snapshot response.
-     */
-    public static final int SNAPSHOT_HISTOGRAMS = 1 << 0;
-    /**
-     * Adds a "keyedHistogram" object entry to the snapshot response.
-     */
-    public static final int SNAPSHOT_KEYED_HISTOGRAMS = 1 << 1;
-    /**
-     * Adds a "scalars" object entry to the snapshot response.
-     */
-    public static final int SNAPSHOT_SCALARS = 1 << 2;
-    /**
-     * Adds a "keyedScalars" object entry to the snapshot response.
-     */
-    public static final int SNAPSHOT_KEYED_SCALARS = 1 << 3;
-    /**
-     * Adds all snapshot types to the response.
-     */
-    public static final int SNAPSHOT_ALL = (1 << 4) - 1;
-
-    /* package */ RuntimeTelemetry(final @NonNull GeckoRuntime runtime) {
-        mRuntime = runtime;
-        mEventDispatcher = EventDispatcher.getInstance();
-    }
-
-    /**
-     * Retrieve all telemetry snapshots.
-     *
-     * @param dataset The dataset type to retreive.
-     *                One of {@link RuntimeTelemetry.DATASET_BASE DATASET_*} flags.
-     * @param clear Whether the retrieved snapshots should be cleared.
-     * @param response Used to return the async response.
-     */
-    public void getSnapshots(
-          final @DatasetType int dataset,
-          final boolean clear,
-          final @NonNull GeckoResponse<GeckoBundle> response) {
-        getSnapshots(SNAPSHOT_ALL, dataset, clear, response);
-    }
-
-    /**
-     * Retrieve the requested telemetry snapshots.
-     *
-     * @param types The requested snapshot types.
-     *              One or more of {@link RuntimeTelemetry.SNAPSHOT_HISTOGRAMS} flags.
-     * @param dataset The dataset type to retreive.
-     *                One of {@link RuntimeTelemetry.DATASET_BASE DATASET_*} flags.
-     * @param clear Whether the retrieved snapshots should be cleared.
-     * @param response Used to return the async response.
-     */
-    public void getSnapshots(
-          final @SnapshotType int types,
-          final @DatasetType int dataset,
-          final boolean clear,
-          final @NonNull GeckoResponse<GeckoBundle> response) {
-        final GeckoBundle msg = new GeckoBundle(3);
-        msg.putInt("types", types);
-        msg.putInt("dataset", dataset);
-        msg.putBoolean("clear", clear);
-
-        mEventDispatcher.dispatch("GeckoView:TelemetrySnapshots", msg,
-            new EventCallback() {
-                @Override
-                public void sendSuccess(final Object result) {
-                    response.respond((GeckoBundle) result);
-                }
-
-                @Override
-                public void sendError(final Object error) {
-                    Log.e(LOGTAG, "getSnapshots failed: " + error);
-                    response.respond(null);
-                }
-            });
-    }
-}
--- a/toolkit/components/telemetry/geckoview/GeckoViewTelemetryController.jsm
+++ b/toolkit/components/telemetry/geckoview/GeckoViewTelemetryController.jsm
@@ -3,111 +3,32 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/GeckoViewUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
-  EventDispatcher: "resource://gre/modules/Messaging.jsm",
   Services: "resource://gre/modules/Services.jsm",
   TelemetryUtils: "resource://gre/modules/TelemetryUtils.jsm",
 });
 
 GeckoViewUtils.initLogging("GeckoView.TelemetryController", this);
 
 var EXPORTED_SYMBOLS = ["GeckoViewTelemetryController"];
 
 /* global debug warn */
 
-/**
- * Telemetry snapshot API adaptors used to retrieve one or more snapshots
- * for GeckoView:TelemetrySnapshots requests.
- * Match with RuntimeTelemetry.SNAPSHOT_* and nsITelemetry.idl.
- */
-const TelemetrySnapshots = [
-  {
-    type: "histograms",
-    flag: (1 << 0),
-    get: (dataset, clear) => Services.telemetry.snapshotHistograms(
-                               dataset, false, clear)
-  },
-  {
-    type: "keyedHistograms",
-    flag: (1 << 1),
-    get: (dataset, clear) => Services.telemetry.snapshotKeyedHistograms(
-                               dataset, false, clear)
-  },
-  {
-    type: "scalars",
-    flag: (1 << 2),
-    get: (dataset, clear) => Services.telemetry.snapshotScalars(
-                               dataset, clear)
-  },
-  {
-    type: "keyedScalars",
-    flag: (1 << 3),
-    get: (dataset, clear) => Services.telemetry.snapshotKeyedScalars(
-                               dataset, clear)
-  },
-];
-
-const GeckoViewTelemetryController = {
+let GeckoViewTelemetryController = {
   /**
    * Setup the Telemetry recording flags. This must be called
    * in all the processes that need to collect Telemetry.
    */
   setup() {
     debug `setup`;
 
     TelemetryUtils.setTelemetryRecordingFlags();
 
     debug `setup - canRecordPrereleaseData ${Services.telemetry.canRecordPrereleaseData
           }, canRecordReleaseData ${Services.telemetry.canRecordReleaseData}`;
-
-    if (GeckoViewUtils.IS_PARENT_PROCESS) {
-      try {
-        EventDispatcher.instance.registerListener(this, [
-          "GeckoView:TelemetrySnapshots",
-        ]);
-      } catch (e) {
-        warn `Failed registering GeckoView:TelemetrySnapshots listener: ${e}`;
-      }
-    }
-  },
-
-  /**
-   * Handle GeckoView:TelemetrySnapshots requests.
-   * Match with RuntimeTelemetry.getSnapshots.
-   *
-   * @param aEvent Name of the event to dispatch.
-   * @param aData Optional object containing data for the event.
-   * @param aCallback Optional callback implementing nsIAndroidEventCallback.
-   */
-  onEvent(aEvent, aData, aCallback) {
-    debug `onEvent: aEvent=${aEvent}, aData=${aData}`;
-
-    if (aEvent !== "GeckoView:TelemetrySnapshots") {
-      warn `Received unexpected event ${aEvent}`;
-      return;
-    }
-
-    const { clear, types, dataset } = aData;
-    let snapshots = {};
-
-    // Iterate over all snapshot types, retreive and assemble results.
-    for (const tel of TelemetrySnapshots) {
-      if ((tel.flag & types) == 0) {
-        // This snapshot type has not been requested.
-        continue;
-      }
-      const snapshot = tel.get(dataset, clear);
-      if (!snapshot) {
-        aCallback.onError(`Failed retrieving ${tel.type} snapshot!`);
-        return;
-      }
-      snapshots[tel.type] = snapshot;
-    }
-
-    aCallback.onSuccess(snapshots);
   },
 };