org.chromium.chrome.browser.crash.MinidumpUploadService Java Examples

The following examples show how to use org.chromium.chrome.browser.crash.MinidumpUploadService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Tab.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Performs any subclass-specific tasks when the Tab crashes.
 */
void handleTabCrash() {
    mIsLoading = false;
    mIsBeingRestored = false;

    if (mTabUma != null) mTabUma.onRendererCrashed();

    if (!TextUtils.equals("true", VariationsAssociatedData.getVariationParamValue(
            MinidumpDirectoryObserver.MINIDUMP_EXPERIMENT_NAME, "Enabled"))) {
        try {
            // Update the most recent minidump file with the logcat. Doing this asynchronously
            // adds a race condition in the case of multiple simultaneously renderer crashses
            // but because the data will be the same for all of them it is innocuous. We can
            // attempt to do this regardless of whether it was a foreground tab in the event
            // that it's a real crash and not just android killing the tab.
            Context context = getApplicationContext();
            Intent intent = MinidumpUploadService.createFindAndUploadLastCrashIntent(context);
            context.startService(intent);
            RecordUserAction.record("MobileBreakpadUploadAttempt");
        } catch (SecurityException e) {
            // For KitKat and below, there was a framework bug which cause us to not be able to
            // find our own crash uploading service. Ignore a SecurityException here on older
            // OS versions since the crash will eventually get uploaded on next start.
            // crbug/542533
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                throw e;
            }
        }
    }
}