author | Gabriele Svelto <gsvelto@mozilla.com> |
Fri, 02 Aug 2019 08:26:05 +0000 | |
changeset 486048 | 2cf5b09571c6c676cb0629becbe37903b2148d86 |
parent 486047 | cc28b2b49ae7ffe5085307bca9908bf0e784b6f0 |
child 486049 | c41e3317531b1405c68fbb3e7c7a3dbbb9225e99 |
push id | 91609 |
push user | gsvelto@mozilla.com |
push date | Fri, 02 Aug 2019 21:35:30 +0000 |
treeherder | autoland@2cf5b09571c6 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | nalexander, agi |
bugs | 1570789 |
milestone | 70.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
|
--- a/mobile/android/base/java/org/mozilla/gecko/CrashReporterActivity.java +++ b/mobile/android/base/java/org/mozilla/gecko/CrashReporterActivity.java @@ -59,17 +59,16 @@ import android.widget.EditText; // Registered: This activity is only registered in the manifest if MOZ_CRASHREPORTER is set. // CutPasteId: This lint is not worth fixing. To fix it, cache all the findViewById results. @SuppressLint("Registered,CutPasteId") public class CrashReporterActivity extends AppCompatActivity { private static final String LOGTAG = "GeckoCrashReporter"; private static final String PASSED_MINI_DUMP_KEY = "minidumpPath"; - private static final String PASSED_MINI_DUMP_SUCCESS_KEY = "minidumpSuccess"; private static final String MINI_DUMP_PATH_KEY = "upload_file_minidump"; private static final String PAGE_URL_KEY = "URL"; private static final String SERVER_URL_KEY = "ServerURL"; private static final String STACK_TRACES_KEY = "StackTraces"; private static final List<String> IGNORE_KEYS = Arrays.asList( SERVER_URL_KEY, STACK_TRACES_KEY ); @@ -83,17 +82,16 @@ public class CrashReporterActivity exten private static final String PREFS_ALLOW_CONTACT = "allowContact"; private static final String PREFS_CONTACT_EMAIL = "contactEmail"; private Handler mHandler; private ProgressDialog mProgressDialog; private File mPendingMinidumpFile; private File mPendingExtrasFile; private HashMap<String, String> mExtrasStringMap; - private boolean mMinidumpSucceeded; private boolean moveFile(File inFile, File outFile) { Log.i(LOGTAG, "moving " + inFile + " to " + outFile); if (inFile.renameTo(outFile)) return true; try { outFile.createNewFile(); Log.i(LOGTAG, "couldn't rename minidump file"); @@ -143,20 +141,16 @@ public class CrashReporterActivity exten super.onCreate(savedInstanceState); // mHandler is created here so runnables can be run on the main thread mHandler = new Handler(); setContentView(R.layout.crash_reporter); mProgressDialog = new ProgressDialog(this); mProgressDialog.setMessage(getString(R.string.sending_crash_report)); - mMinidumpSucceeded = getIntent().getBooleanExtra(PASSED_MINI_DUMP_SUCCESS_KEY, false); - if (!mMinidumpSucceeded) { - Log.i(LOGTAG, "Failed to get minidump."); - } String passedMinidumpPath = getIntent().getStringExtra(PASSED_MINI_DUMP_KEY); File passedMinidumpFile = new File(passedMinidumpPath); File pendingDir = new File(getFilesDir(), PENDING_SUFFIX); pendingDir.mkdirs(); mPendingMinidumpFile = new File(pendingDir, passedMinidumpFile.getName()); moveFile(passedMinidumpFile, mPendingMinidumpFile); File extrasFile = new File(passedMinidumpPath.replaceAll("\\.dmp", ".extra")); @@ -534,17 +528,16 @@ public class CrashReporterActivity exten sendPart(os, boundary, "Comments", comment); } if (((CheckBox) findViewById(R.id.allow_contact)).isChecked()) { String email = ((EditText) findViewById(R.id.email)).getText().toString(); sendPart(os, boundary, "Email", email); } - sendPart(os, boundary, PASSED_MINI_DUMP_SUCCESS_KEY, mMinidumpSucceeded ? "True" : "False"); sendFile(os, boundary, MINI_DUMP_PATH_KEY, minidumpFile); os.write(("\r\n--" + boundary + "--\r\n").getBytes()); os.flush(); os.close(); BufferedReader br = new BufferedReader( new InputStreamReader(conn.getInputStream())); HashMap<String, String> responseMap = new HashMap<String, String>(); readStringsFromReader(br, responseMap);
--- a/mobile/android/geckoview/api.txt +++ b/mobile/android/geckoview/api.txt @@ -184,18 +184,18 @@ package org.mozilla.geckoview { method @NonNull public ContentBlocking.Settings.Builder cookieLifetime(int); method @NonNull protected ContentBlocking.Settings newSettings(@Nullable ContentBlocking.Settings); } public class CrashReporter { ctor public CrashReporter(); method @AnyThread @NonNull public static GeckoResult<String> sendCrashReport(@NonNull Context, @NonNull Intent, @NonNull String); method @AnyThread @NonNull public static GeckoResult<String> sendCrashReport(@NonNull Context, @NonNull Bundle, @NonNull String); - method @AnyThread @NonNull public static GeckoResult<String> sendCrashReport(@NonNull Context, @NonNull File, @NonNull File, boolean, @NonNull String); - method @AnyThread @NonNull public static GeckoResult<String> sendCrashReport(@NonNull Context, @NonNull File, @NonNull Map<String,String>, boolean, @NonNull String); + method @AnyThread @NonNull public static GeckoResult<String> sendCrashReport(@NonNull Context, @NonNull File, @NonNull File, @NonNull String); + method @AnyThread @NonNull public static GeckoResult<String> sendCrashReport(@NonNull Context, @NonNull File, @NonNull Map<String,String>, @NonNull String); } @UiThread public final class DynamicToolbarAnimator { method @Nullable public DynamicToolbarAnimator.ToolbarChromeProxy getToolbarChromeProxy(); method public void hideToolbar(boolean); method public boolean isPinned(); method public boolean isPinnedBy(@NonNull DynamicToolbarAnimator.PinReason); method public void setMaxToolbarHeight(int); @@ -295,17 +295,16 @@ package org.mozilla.geckoview { method @UiThread public void setDelegate(@Nullable GeckoRuntime.Delegate); method @AnyThread public void shutdown(); method @UiThread @NonNull public GeckoResult<Void> unregisterWebExtension(@NonNull WebExtension); field public static final String ACTION_CRASHED = "org.mozilla.gecko.ACTION_CRASHED"; field public static final Parcelable.Creator<GeckoRuntime> CREATOR; field public static final String EXTRA_CRASH_FATAL = "fatal"; field public static final String EXTRA_EXTRAS_PATH = "extrasPath"; field public static final String EXTRA_MINIDUMP_PATH = "minidumpPath"; - field public static final String EXTRA_MINIDUMP_SUCCESS = "minidumpSuccess"; } public static interface GeckoRuntime.Delegate { method @UiThread public void onShutdown(); } @AnyThread public final class GeckoRuntimeSettings extends RuntimeSettings { method @NonNull public String[] getArguments();
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/CrashTest.kt +++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/CrashTest.kt @@ -43,19 +43,16 @@ class CrashTest { assertThat("Action should match", intent.action, equalTo(GeckoRuntime.ACTION_CRASHED)) assertThat("Dump file should exist", File(intent.getStringExtra(GeckoRuntime.EXTRA_MINIDUMP_PATH)).exists(), equalTo(true)) assertThat("Extras file should exist", File(intent.getStringExtra(GeckoRuntime.EXTRA_EXTRAS_PATH)).exists(), equalTo(true)) - assertThat("Dump should be succcesful", - intent.getBooleanExtra(GeckoRuntime.EXTRA_MINIDUMP_SUCCESS, false), - equalTo(true)) assertThat("Fatality should match", intent.getBooleanExtra(GeckoRuntime.EXTRA_CRASH_FATAL, !fatal), equalTo(fatal)) } @Test fun crashParent() { Assume.assumeFalse(env.isX86) // Too flaky on x86
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java @@ -310,17 +310,16 @@ public class CrashHandler implements Thr return false; } if (context != null) { final Intent intent = new Intent(GeckoRuntime.ACTION_CRASHED); intent.putExtra(GeckoRuntime.EXTRA_MINIDUMP_PATH, dumpFile); intent.putExtra(GeckoRuntime.EXTRA_EXTRAS_PATH, extraFile); intent.putExtra(GeckoRuntime.EXTRA_CRASH_FATAL, true); - intent.putExtra(GeckoRuntime.EXTRA_MINIDUMP_SUCCESS, true); intent.setClass(context, handlerService); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(intent); } else { context.startService(intent); } return true; @@ -330,17 +329,16 @@ public class CrashHandler implements Thr if (deviceSdkVersion < 17) { pb = new ProcessBuilder( "/system/bin/am", "startservice", "-a", GeckoRuntime.ACTION_CRASHED, "-n", getAppPackageName() + '/' + handlerService.getName(), "--es", GeckoRuntime.EXTRA_MINIDUMP_PATH, dumpFile, "--es", GeckoRuntime.EXTRA_EXTRAS_PATH, extraFile, - "--ez", GeckoRuntime.EXTRA_MINIDUMP_SUCCESS, "true", "--ez", GeckoRuntime.EXTRA_CRASH_FATAL, "true"); } else { final String startServiceCommand; if (deviceSdkVersion >= 26) { startServiceCommand = "start-foreground-service"; } else { startServiceCommand = "startservice"; } @@ -348,17 +346,16 @@ public class CrashHandler implements Thr pb = new ProcessBuilder( "/system/bin/am", startServiceCommand, "--user", /* USER_CURRENT_OR_SELF */ "-3", "-a", GeckoRuntime.ACTION_CRASHED, "-n", getAppPackageName() + '/' + handlerService.getName(), "--es", GeckoRuntime.EXTRA_MINIDUMP_PATH, dumpFile, "--es", GeckoRuntime.EXTRA_EXTRAS_PATH, extraFile, - "--ez", GeckoRuntime.EXTRA_MINIDUMP_SUCCESS, "true", "--ez", GeckoRuntime.EXTRA_CRASH_FATAL, "true"); } pb.start().waitFor(); } catch (final IOException e) { Log.e(LOGTAG, "Error launching crash reporter", e); return false;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java @@ -34,17 +34,16 @@ import java.util.zip.GZIPOutputStream; /** * Sends a crash report to the Mozilla <a href="https://wiki.mozilla.org/Socorro">Socorro</a> * crash report server. */ public class CrashReporter { private static final String LOGTAG = "GeckoCrashReporter"; private static final String MINI_DUMP_PATH_KEY = "upload_file_minidump"; - private static final String MINI_DUMP_SUCCESS_KEY = "minidumpSuccess"; private static final String PAGE_URL_KEY = "URL"; private static final String NOTES_KEY = "Notes"; private static final String SERVER_URL_KEY = "ServerURL"; private static final String STACK_TRACES_KEY = "StackTraces"; private static final String PRODUCT_NAME_KEY = "ProductName"; private static final String PRODUCT_ID_KEY = "ProductID"; private static final String PRODUCT_ID = "{eeb82917-e434-4870-8148-5c03d4caa81b}"; private static final List<String> IGNORE_KEYS = Arrays.asList( @@ -98,75 +97,71 @@ public class CrashReporter { */ @AnyThread public static @NonNull GeckoResult<String> sendCrashReport(@NonNull final Context context, @NonNull final Bundle intentExtras, @NonNull final String appName) throws IOException, URISyntaxException { final File dumpFile = new File(intentExtras.getString(GeckoRuntime.EXTRA_MINIDUMP_PATH)); final File extrasFile = new File(intentExtras.getString(GeckoRuntime.EXTRA_EXTRAS_PATH)); - final boolean success = intentExtras.getBoolean(GeckoRuntime.EXTRA_MINIDUMP_SUCCESS, false); - return sendCrashReport(context, dumpFile, extrasFile, success, appName); + return sendCrashReport(context, dumpFile, extrasFile, appName); } /** * Sends a crash report to the Mozilla <a href="https://wiki.mozilla.org/Socorro">Socorro</a> * crash report server. * <br> * The {@code appName} needs to be whitelisted for the server to accept the crash. * <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Socorro">File a bug</a> * if you would like to get your app added to the whitelist. * * @param context The current {@link Context} * @param minidumpFile A {@link File} referring to the minidump. * @param extrasFile A {@link File} referring to the extras file. - * @param success A boolean indicating whether the dump was successfully generated. * @param appName A human-readable app name. * @throws IOException This can be thrown if there was a networking error while sending the report. * @throws URISyntaxException This can be thrown if the crash server URI from the extra data was invalid. * @return A GeckoResult containing the crash ID as a String. * @see GeckoRuntimeSettings.Builder#crashHandler(Class) * @see GeckoRuntime#ACTION_CRASHED */ @AnyThread public static @NonNull GeckoResult<String> sendCrashReport(@NonNull final Context context, @NonNull final File minidumpFile, @NonNull final File extrasFile, - final boolean success, @NonNull final String appName) throws IOException, URISyntaxException { // Compute the minidump hash and generate the stack traces computeMinidumpHash(extrasFile, minidumpFile); // Extract the annotations from the .extra file HashMap<String, String> extrasMap = readStringsFromFile(extrasFile.getPath()); - return sendCrashReport(context, minidumpFile, extrasMap, success, appName); + return sendCrashReport(context, minidumpFile, extrasMap, appName); } /** * Sends a crash report to the Mozilla <a href="https://wiki.mozilla.org/Socorro">Socorro</a> * crash report server. * * @param context The current {@link Context} * @param minidumpFile A {@link File} referring to the minidump. * @param extras A {@link HashMap} with the parsed key-value pairs from the extras file. - * @param success A boolean indicating whether the dump was successfully generated. * @param appName A human-readable app name. * @throws IOException This can be thrown if there was a networking error while sending the report. * @throws URISyntaxException This can be thrown if the crash server URI from the extra data was invalid. * @return A GeckoResult containing the crash ID as a String. * @see GeckoRuntimeSettings.Builder#crashHandler(Class) * @see GeckoRuntime#ACTION_CRASHED */ @AnyThread public static @NonNull GeckoResult<String> sendCrashReport( @NonNull final Context context, @NonNull final File minidumpFile, - @NonNull final Map<String, String> extras, final boolean success, + @NonNull final Map<String, String> extras, @NonNull final String appName) throws IOException, URISyntaxException { Log.d(LOGTAG, "Sending crash report: " + minidumpFile.getPath()); String spec = extras.get(SERVER_URL_KEY); if (spec == null) { return GeckoResult.fromException(new Exception("No server url present")); } @@ -214,17 +209,16 @@ public class CrashReporter { sendPart(os, boundary, "Android_PackageName", context.getPackageName()); try { sendPart(os, boundary, "Android_CPU_ABI2", Build.CPU_ABI2); sendPart(os, boundary, "Android_Hardware", Build.HARDWARE); } catch (Exception ex) { Log.e(LOGTAG, "Exception while sending SDK version 8 keys", ex); } sendPart(os, boundary, "Android_Version", Build.VERSION.SDK_INT + " (" + Build.VERSION.CODENAME + ")"); - sendPart(os, boundary, MINI_DUMP_SUCCESS_KEY, success ? "True" : "False"); sendFile(os, boundary, MINI_DUMP_PATH_KEY, minidumpFile); os.write(("\r\n--" + boundary + "--\r\n").getBytes()); os.flush(); os.close(); BufferedReader br = null; try { br = new BufferedReader(
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java @@ -79,24 +79,16 @@ public final class GeckoRuntime implemen * <pre>Key=Value</pre> * Be aware, it may contain sensitive data such * as the URI that was loaded at the time of the crash. */ public static final String EXTRA_EXTRAS_PATH = "extrasPath"; /** * This is a key for extra data sent with {@link #ACTION_CRASHED}. The value is - * a boolean indicating whether or not the crash dump was succcessfully - * retrieved. If this is false, the dump file referred to in - * {@link #EXTRA_MINIDUMP_PATH} may be corrupted or incomplete. - */ - public static final String EXTRA_MINIDUMP_SUCCESS = "minidumpSuccess"; - - /** - * This is a key for extra data sent with {@link #ACTION_CRASHED}. The value is * a boolean indicating whether or not the crash was fatal or not. If true, the * main application process was affected by the crash. If false, only an internal * process used by Gecko has crashed and the application may be able to recover. * @see GeckoSession.ContentDelegate#onCrash(GeckoSession) */ public static final String EXTRA_CRASH_FATAL = "fatal"; private final class LifecycleListener implements LifecycleObserver { @@ -203,17 +195,16 @@ public final class GeckoRuntime implemen mDelegate.onShutdown(); EventDispatcher.getInstance().unregisterUiThreadListener(mEventListener, "Gecko:Exited"); } else if ("GeckoView:ContentCrashReport".equals(event) && crashHandler != null) { final Context context = GeckoAppShell.getApplicationContext(); Intent i = new Intent(ACTION_CRASHED, null, context, crashHandler); i.putExtra(EXTRA_MINIDUMP_PATH, message.getString(EXTRA_MINIDUMP_PATH)); i.putExtra(EXTRA_EXTRAS_PATH, message.getString(EXTRA_EXTRAS_PATH)); - i.putExtra(EXTRA_MINIDUMP_SUCCESS, true); i.putExtra(EXTRA_CRASH_FATAL, message.getBoolean(EXTRA_CRASH_FATAL, true)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(i); } else { context.startService(i); } }
--- 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 @@ -5,16 +5,23 @@ description: GeckoView API Changelog. nav_exclude: true exclude: true --- <h1> GeckoView API Changelog. </h1> ## v70 +- Removed the obsolete `success` parameter from + [`CrashReporter#sendCrashReport`][70.3] and + [`CrashReporter#sendCrashReport`][70.4]. + +[70.3]: ../CrashReporter.html#sendCrashReport-android.content.Context-java.io.File-java.io.File-java.lang.String- +[70.4]: ../CrashReporter.html#sendCrashReport-android.content.Context-java.io.File-java.util.Map-java.lang.String- + - Added API for session context assignment [`GeckoSessionSettings.Builder.contextId`][70.1] and deletion of data related to a session context [`StorageController.clearDataForSessionContext`][70.2]. [70.1]: ../GeckoSessionSettings.Builder.html#contextId-java.lang.String- [70.2]: ../StorageController.html#clearDataForSessionContext-java.lang.String- @@ -369,9 +376,9 @@ exclude: true [65.23]: ../GeckoSession.FinderResult.html - Update [`CrashReporter#sendCrashReport`][65.24] to return the crash ID as a [`GeckoResult<String>`][65.25]. [65.24]: ../CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String- [65.25]: ../GeckoResult.html -[api-version]: ce03a46188d89b6d2ed5ebc58bdcd640eda216c9 +[api-version]: a378cc7122deed44920fd8f3aad8627ed7a7960d
--- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/ExampleCrashHandler.java +++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/ExampleCrashHandler.java @@ -40,18 +40,16 @@ public class ExampleCrashHandler extends if (GeckoRuntime.ACTION_CRASHED.equals(intent.getAction())) { mCrashIntent = intent; Log.d(LOGTAG, "Dump File: " + mCrashIntent.getStringExtra(GeckoRuntime.EXTRA_MINIDUMP_PATH)); Log.d(LOGTAG, "Extras File: " + mCrashIntent.getStringExtra(GeckoRuntime.EXTRA_EXTRAS_PATH)); - Log.d(LOGTAG, "Dump Success: " + - mCrashIntent.getBooleanExtra(GeckoRuntime.EXTRA_MINIDUMP_SUCCESS, false)); Log.d(LOGTAG, "Fatal: " + mCrashIntent.getBooleanExtra(GeckoRuntime.EXTRA_CRASH_FATAL, false)); String id = createNotificationChannel(); PendingIntent reportIntent = PendingIntent.getService( this, 0, new Intent(ACTION_REPORT_CRASH, null,
--- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -869,21 +869,20 @@ static bool LaunchProgram(const XP_CHAR* #else /** * Launch the crash reporter activity on Android * * @param aProgramPath The path of the program to be launched * @param aMinidumpPath The path to the crash minidump file - * @param aSucceeded True if the minidump was obtained successfully */ static bool LaunchCrashHandlerService(XP_CHAR* aProgramPath, - XP_CHAR* aMinidumpPath, bool aSucceeded) { + XP_CHAR* aMinidumpPath) { static XP_CHAR extrasPath[XP_PATH_MAX]; size_t size = XP_PATH_MAX; XP_CHAR* p = Concat(extrasPath, aMinidumpPath, &size); p = Concat(p - 3, "extra", &size); pid_t pid = sys_fork(); @@ -891,25 +890,23 @@ static bool LaunchCrashHandlerService(XP return false; else if (pid == 0) { // Invoke the crash handler service using am if (androidUserSerial) { Unused << execlp( "/system/bin/am", "/system/bin/am", androidStartServiceCommand, "--user", androidUserSerial, "-a", "org.mozilla.gecko.ACTION_CRASHED", "-n", aProgramPath, "--es", "minidumpPath", aMinidumpPath, "--es", - "extrasPath", extrasPath, "--ez", "minidumpSuccess", - aSucceeded ? "true" : "false", "--ez", "fatal", "true", (char*)0); + "extrasPath", extrasPath, "--ez", "fatal", "true", (char*)0); } else { Unused << execlp( "/system/bin/am", "/system/bin/am", androidStartServiceCommand, "-a", "org.mozilla.gecko.ACTION_CRASHED", "-n", aProgramPath, "--es", "minidumpPath", aMinidumpPath, "--es", "extrasPath", extrasPath, - "--ez", "minidumpSuccess", aSucceeded ? "true" : "false", "--ez", - "fatal", "true", (char*)0); + "--ez", "fatal", "true", (char*)0); } _exit(1); } else { // We need to wait on the 'am start' command above to finish, otherwise // everything will be killed by the ActivityManager as soon as the signal // handler exits int status; @@ -1180,18 +1177,17 @@ bool MinidumpCallback( if (!doReport) { #ifdef XP_WIN TerminateProcess(GetCurrentProcess(), 1); #endif // XP_WIN return returnValue; } #if defined(MOZ_WIDGET_ANDROID) // Android - returnValue = - LaunchCrashHandlerService(crashReporterPath, minidumpPath, succeeded); + returnValue = LaunchCrashHandlerService(crashReporterPath, minidumpPath); #else // Windows, Mac, Linux, etc... returnValue = LaunchProgram(crashReporterPath, minidumpPath); # ifdef XP_WIN TerminateProcess(GetCurrentProcess(), 1); # endif #endif return returnValue;