Bug 1620395 - [1.0] Deprecate GeckoView Snapshot Telemetry API. r=geckoview-reviewers,snorp,agi
authorEugen Sawin <esawin@mozilla.com>
Thu, 12 Mar 2020 20:42:27 +0000
changeset 518478 ead0580541add564ee40c9fdc1b55bd12c2eb96c
parent 518477 6138c3118672ff636cb360cb077c20d03410f5da
child 518479 5a44f20eccdf1ef08351eeb28a7efd02b2f3f7ef
push id37210
push userdvarga@mozilla.com
push dateFri, 13 Mar 2020 04:24:24 +0000
treeherdermozilla-central@7fd4c0e31fde [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, snorp, agi
bugs1620395
milestone76.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 1620395 - [1.0] Deprecate GeckoView Snapshot Telemetry API. r=geckoview-reviewers,snorp,agi Differential Revision: https://phabricator.services.mozilla.com/D66077
mobile/android/geckoview/api.txt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/RuntimeTelemetry.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
--- a/mobile/android/geckoview/api.txt
+++ b/mobile/android/geckoview/api.txt
@@ -1363,17 +1363,17 @@ package org.mozilla.geckoview {
   public abstract static class RuntimeSettings.Builder<Settings extends RuntimeSettings> {
     ctor public Builder();
     method @AnyThread @NonNull public Settings build();
     method @AnyThread @NonNull protected Settings getSettings();
     method @AnyThread @NonNull protected abstract Settings newSettings(@Nullable Settings);
   }
 
   public final class RuntimeTelemetry {
-    method @AnyThread @NonNull public GeckoResult<JSONObject> getSnapshots(boolean);
+    method @Deprecated @AnyThread @NonNull public GeckoResult<JSONObject> getSnapshots(boolean);
   }
 
   public static interface RuntimeTelemetry.Delegate {
     method @AnyThread default public void onBooleanScalar(@NonNull RuntimeTelemetry.Metric<Boolean>);
     method @AnyThread default public void onHistogram(@NonNull RuntimeTelemetry.Histogram);
     method @AnyThread default public void onLongScalar(@NonNull RuntimeTelemetry.Metric<Long>);
     method @AnyThread default public void onStringScalar(@NonNull RuntimeTelemetry.Metric<String>);
   }
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt
@@ -672,16 +672,17 @@ class NavigationDelegateTest : BaseSessi
         sessionRule.session.reload()
         sessionRule.session.waitForPageStop()
 
         innerWidth = sessionRule.session.evaluateJS(innerWidthJs) as Double
         assertThat("innerWidth should be equal to $mobileInnerWidth again",
                 innerWidth, closeTo(mobileInnerWidth, 0.1))
     }
 
+    @Suppress("deprecation")
     @Ignore // This test needs to set RuntimeSettings, TODO: Bug 1572245
     @Test fun telemetrySnapshots() {
         sessionRule.session.loadTestPath(HELLO_HTML_PATH)
         sessionRule.waitForPageStop()
 
         val telemetry = sessionRule.runtime.telemetry
         val result = sessionRule.waitForResult(telemetry.getSnapshots(false))
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/RuntimeTelemetry.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/RuntimeTelemetry.java
@@ -35,17 +35,20 @@ public final class RuntimeTelemetry {
      * <li>histograms</li>
      * <li>keyedHistograms</li>
      * <li>scalars</li>
      * <li>keyedScalars</li>
      * </ul>
      *
      * @param clear Whether the retrieved snapshots should be cleared.
      * @return A {@link GeckoResult} with the GeckoBundle snapshot results.
+     *
+     * @deprecated Use Glean instead. Planned removal in 79 (bug 1620656).
      */
+    @Deprecated
     @AnyThread
     public @NonNull GeckoResult<JSONObject> getSnapshots(final boolean clear) {
         final GeckoBundle msg = new GeckoBundle(1);
         msg.putBoolean("clear", clear);
 
         final CallbackResult<JSONObject> result = new CallbackResult<JSONObject>() {
             @Override
             public void sendSuccess(final Object value) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
@@ -10,16 +10,19 @@ exclude: true
 {% capture bugzilla %}https://bugzilla.mozilla.org/show_bug.cgi?id={% endcapture %}
 
 # GeckoView API Changelog.
 
 ⚠️  breaking change
 
 ## v76
 - Added [`GeckoSession.PermissionDelegate.PERMISSION_MEDIA_KEY_SYSTEM_ACCESS`][76.1] to control EME media key access.
+- [`RuntimeTelemetry#getSnapshots`][68.10] is deprecated and will be removed
+  in 79. Use Glean to handle Gecko telemetry.
+  ([bug 1620395]({{bugzilla}}1620395))
 
 [76.1]: {{javadoc_uri}}/GeckoSession.PermissionDelegate.html#PERMISSION_MEDIA_KEY_SYSTEM_ACCESS
 
 ## v75
 - ⚠️ Remove `GeckoRuntimeSettings.Builder#useContentProcessHint`. The content
   process is now preloaded by default if
   [`GeckoRuntimeSettings.Builder#useMultiprocess`][75.1] is enabled.
 - ⚠️ Move `GeckoSessionSettings.Builder#useMultiprocess` to
@@ -653,9 +656,9 @@ exclude: true
 [65.19]: {{javadoc_uri}}/GeckoSession.NavigationDelegate.LoadRequest.html#isRedirect
 [65.20]: {{javadoc_uri}}/GeckoSession.html#LOAD_FLAGS_BYPASS_CLASSIFIER
 [65.21]: {{javadoc_uri}}/GeckoSession.ContentDelegate.ContextElement.html
 [65.22]: {{javadoc_uri}}/GeckoSession.ContentDelegate.html#onContextMenu-org.mozilla.geckoview.GeckoSession-int-int-org.mozilla.geckoview.GeckoSession.ContentDelegate.ContextElement-
 [65.23]: {{javadoc_uri}}/GeckoSession.FinderResult.html
 [65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
 [65.25]: {{javadoc_uri}}/GeckoResult.html
 
-[api-version]: 3ccce953759d39a8b9b0b1b01dcc75c8ad6654aa
+[api-version]: 62cfb90bd471769c2e7366f8f4957fb7fa4edc4e