mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
Remove base conditional code for crash reporter and injector.
This commit is contained in:
parent
87fa26d31e
commit
434f3590e3
131 changed files with 39 additions and 4139 deletions
|
|
@ -63,9 +63,7 @@ var gPluginHandler = {
|
|||
msg.data.pluginID);
|
||||
break;
|
||||
case "PluginContent:SubmitReport":
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
this.submitReport(msg.data.runID, msg.data.keyVals, msg.data.submitURLOptIn);
|
||||
}
|
||||
// Nothing to do here
|
||||
break;
|
||||
case "PluginContent:LinkClickCallback":
|
||||
switch (msg.data.name) {
|
||||
|
|
@ -98,11 +96,8 @@ var gPluginHandler = {
|
|||
},
|
||||
|
||||
submitReport: function submitReport(runID, keyVals, submitURLOptIn) {
|
||||
if (!AppConstants.MOZ_CRASHREPORTER) {
|
||||
return;
|
||||
}
|
||||
Services.prefs.setBoolPref("dom.ipc.plugins.reportCrashURL", submitURLOptIn);
|
||||
PluginCrashReporter.submitCrashReport(runID, keyVals);
|
||||
/*** STUB ***/
|
||||
return;
|
||||
},
|
||||
|
||||
// Callback for user clicking a "reload page" link
|
||||
|
|
@ -461,18 +456,7 @@ var gPluginHandler = {
|
|||
|
||||
// If we don't have a minidumpID, we can't (or didn't) submit anything.
|
||||
// This can happen if the plugin is killed from the task manager.
|
||||
let state;
|
||||
if (!AppConstants.MOZ_CRASHREPORTER || !gCrashReporter.enabled) {
|
||||
// This state tells the user that crash reporting is disabled, so we
|
||||
// cannot send a report.
|
||||
state = "noSubmit";
|
||||
} else if (!pluginDumpID) {
|
||||
// This state tells the user that there is no crash report available.
|
||||
state = "noReport";
|
||||
} else {
|
||||
// This state asks the user to submit a crash report.
|
||||
state = "please";
|
||||
}
|
||||
let state = "noSubmit";
|
||||
|
||||
let mm = window.getGroupMessageManager("browsers");
|
||||
mm.broadcastAsyncMessage("BrowserPlugins:NPAPIPluginProcessCrashed",
|
||||
|
|
@ -513,22 +497,6 @@ var gPluginHandler = {
|
|||
callback: function() { browser.reload(); },
|
||||
}];
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER &&
|
||||
PluginCrashReporter.hasCrashReport(pluginID)) {
|
||||
let submitLabel = gNavigatorBundle.getString("crashedpluginsMessage.submitButton.label");
|
||||
let submitKey = gNavigatorBundle.getString("crashedpluginsMessage.submitButton.accesskey");
|
||||
let submitButton = {
|
||||
label: submitLabel,
|
||||
accessKey: submitKey,
|
||||
popup: null,
|
||||
callback: () => {
|
||||
PluginCrashReporter.submitCrashReport(pluginID);
|
||||
},
|
||||
};
|
||||
|
||||
buttons.push(submitButton);
|
||||
}
|
||||
|
||||
notification = notificationBox.appendNotification(messageString, "plugin-crashed",
|
||||
iconURL, priority, buttons);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,11 +61,6 @@ Cu.import("resource://gre/modules/NotificationDB.jsm");
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "SafeBrowsing",
|
||||
"resource://gre/modules/SafeBrowsing.jsm");
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluginCrashReporter",
|
||||
"resource:///modules/ContentCrashHandlers.jsm");
|
||||
}
|
||||
|
||||
// lazy service getters
|
||||
[
|
||||
["Favicons", "@mozilla.org/browser/favicon-service;1", "mozIAsyncFavicons"],
|
||||
|
|
@ -74,13 +69,6 @@ if (AppConstants.MOZ_CRASHREPORTER) {
|
|||
["gDNSService", "@mozilla.org/network/dns-service;1", "nsIDNSService"],
|
||||
].forEach(([name, cc, ci]) => XPCOMUtils.defineLazyServiceGetter(this, name, cc, ci));
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter",
|
||||
"@mozilla.org/xre/app-info;1",
|
||||
"nsICrashReporter");
|
||||
}
|
||||
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() {
|
||||
let tmp = {};
|
||||
Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", tmp);
|
||||
|
|
@ -4589,23 +4577,6 @@ var XULBrowserWindow = {
|
|||
setTimeout(function () { XULBrowserWindow.asyncUpdateUI(); }, 0);
|
||||
else
|
||||
this.asyncUpdateUI();
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER && aLocationURI) {
|
||||
let uri = aLocationURI.clone();
|
||||
try {
|
||||
// If the current URI contains a username/password, remove it.
|
||||
uri.userPass = "";
|
||||
} catch (ex) { /* Ignore failures on about: URIs. */ }
|
||||
|
||||
try {
|
||||
gCrashReporter.annotateCrashReport("URL", uri.spec);
|
||||
} catch (ex) {
|
||||
// Don't make noise when the crash reporter is built but not enabled.
|
||||
if (ex.result != Components.results.NS_ERROR_NOT_INITIALIZED) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
asyncUpdateUI: function () {
|
||||
|
|
|
|||
|
|
@ -70,15 +70,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s
|
|||
["webrtcUI", "resource:///modules/webrtcUI.jsm"],
|
||||
].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource));
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluginCrashReporter",
|
||||
"resource:///modules/ContentCrashHandlers.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UnsubmittedCrashHandler",
|
||||
"resource:///modules/ContentCrashHandlers.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CrashSubmit",
|
||||
"resource://gre/modules/CrashSubmit.jsm");
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
|
||||
return Services.strings.createBundle('chrome://branding/locale/brand.properties');
|
||||
});
|
||||
|
|
@ -710,10 +701,6 @@ BrowserGlue.prototype = {
|
|||
}
|
||||
|
||||
TabCrashHandler.init();
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
PluginCrashReporter.init();
|
||||
UnsubmittedCrashHandler.init();
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -40,9 +40,6 @@ var gAdvancedPane = {
|
|||
this.updateReadPrefs();
|
||||
}
|
||||
this.updateOfflineApps();
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
this.initSubmitCrashes();
|
||||
}
|
||||
this.initTelemetry();
|
||||
if (AppConstants.MOZ_TELEMETRY_REPORTING) {
|
||||
this.initSubmitHealthReport();
|
||||
|
|
|
|||
|
|
@ -54,13 +54,6 @@
|
|||
type="bool"/>
|
||||
#endif
|
||||
|
||||
<!-- Data Choices tab -->
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
<preference id="browser.crashReports.unsubmittedCheck.autoSubmit2"
|
||||
name="browser.crashReports.unsubmittedCheck.autoSubmit2"
|
||||
type="bool"/>
|
||||
#endif
|
||||
|
||||
<!-- Network tab -->
|
||||
<preference id="browser.cache.disk.capacity"
|
||||
name="browser.cache.disk.capacity"
|
||||
|
|
@ -232,22 +225,6 @@
|
|||
</hbox>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
#endif
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
<groupbox>
|
||||
<caption>
|
||||
<checkbox id="automaticallySubmitCrashesBox"
|
||||
preference="browser.crashReports.unsubmittedCheck.autoSubmit2"
|
||||
label="&alwaysSubmitCrashReports.label;"
|
||||
accesskey="&alwaysSubmitCrashReports.accesskey;"/>
|
||||
</caption>
|
||||
<hbox class="indent">
|
||||
<label flex="1">&crashReporterDesc2.label;</label>
|
||||
<spacer flex="10"/>
|
||||
<label id="crashReporterLearnMore"
|
||||
class="text-link">&crashReporterLearnMore.label;</label>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
#endif
|
||||
</tabpanel>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -785,28 +785,6 @@ bin/libfreebl_32int64_3.so
|
|||
@BINPATH@/maintenanceservice_installer.exe
|
||||
#endif
|
||||
|
||||
; [Crash Reporter]
|
||||
;
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
@RESPATH@/components/CrashService.manifest
|
||||
@RESPATH@/components/CrashService.js
|
||||
@RESPATH@/components/toolkit_crashservice.xpt
|
||||
#ifdef XP_MACOSX
|
||||
@BINPATH@/crashreporter.app/
|
||||
#else
|
||||
@BINPATH@/crashreporter@BIN_SUFFIX@
|
||||
@BINPATH@/minidump-analyzer@BIN_SUFFIX@
|
||||
@RESPATH@/crashreporter.ini
|
||||
#ifdef XP_UNIX
|
||||
@RESPATH@/Throbber-small.gif
|
||||
#endif
|
||||
#endif
|
||||
@RESPATH@/browser/crashreporter-override.ini
|
||||
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
||||
@BINPATH@/breakpadinjector.dll
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@RESPATH@/components/dom_audiochannel.xpt
|
||||
|
||||
; Shutdown Terminator
|
||||
|
|
|
|||
|
|
@ -165,11 +165,6 @@ else
|
|||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_CRASHREPORTER
|
||||
libs:: crashreporter-override.ini
|
||||
$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
|
||||
endif
|
||||
|
||||
ident:
|
||||
@printf 'fx_revision '
|
||||
@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ this.TabCrashHandler = {
|
|||
Services.telemetry
|
||||
.getHistogramById("FX_CONTENT_CRASH_DUMP_UNAVAILABLE")
|
||||
.add(1);
|
||||
} else if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
this.childMap.set(childID, dumpID);
|
||||
}
|
||||
|
||||
if (!this.flushCrashedBrowserQueue(childID)) {
|
||||
|
|
@ -115,15 +113,6 @@ this.TabCrashHandler = {
|
|||
}
|
||||
}
|
||||
|
||||
// check for environment affecting crash reporting
|
||||
let env = Cc["@mozilla.org/process/environment;1"]
|
||||
.getService(Ci.nsIEnvironment);
|
||||
let shutdown = env.exists("MOZ_CRASHREPORTER_SHUTDOWN");
|
||||
|
||||
if (shutdown) {
|
||||
Services.startup.quit(Ci.nsIAppStartup.eForceQuit);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "oop-frameloader-crashed": {
|
||||
|
|
@ -306,105 +295,10 @@ this.TabCrashHandler = {
|
|||
/**
|
||||
* Submits a crash report from about:tabcrashed, if the crash
|
||||
* reporter is enabled and a crash report can be found.
|
||||
*
|
||||
* @param aBrowser
|
||||
* The <xul:browser> that the report was sent from.
|
||||
* @param aFormData
|
||||
* An Object with the following properties:
|
||||
*
|
||||
* includeURL (bool):
|
||||
* Whether to include the URL that the user was on
|
||||
* in the crashed tab before the crash occurred.
|
||||
* URL (String)
|
||||
* The URL that the user was on in the crashed tab
|
||||
* before the crash occurred.
|
||||
* emailMe (bool):
|
||||
* Whether or not to include the user's email address
|
||||
* in the crash report.
|
||||
* email (String):
|
||||
* The email address of the user.
|
||||
* comments (String):
|
||||
* Any additional comments from the user.
|
||||
*
|
||||
* Note that it is expected that all properties are set,
|
||||
* even if they are empty.
|
||||
*/
|
||||
maybeSendCrashReport(message) {
|
||||
if (!AppConstants.MOZ_CRASHREPORTER) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.data.hasReport) {
|
||||
// There was no report, so nothing to do.
|
||||
return;
|
||||
}
|
||||
|
||||
let browser = message.target.browser;
|
||||
|
||||
if (message.data.autoSubmit) {
|
||||
// The user has opted in to autosubmitted backlogged
|
||||
// crash reports in the future.
|
||||
UnsubmittedCrashHandler.autoSubmit = true;
|
||||
}
|
||||
|
||||
let childID = this.browserMap.get(browser.permanentKey);
|
||||
let dumpID = this.childMap.get(childID);
|
||||
if (!dumpID) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.data.sendReport) {
|
||||
Services.telemetry.getHistogramById("FX_CONTENT_CRASH_NOT_SUBMITTED").add(1);
|
||||
this.prefs.setBoolPref("sendReport", false);
|
||||
return;
|
||||
}
|
||||
|
||||
let {
|
||||
includeURL,
|
||||
comments,
|
||||
email,
|
||||
emailMe,
|
||||
URL,
|
||||
} = message.data;
|
||||
|
||||
let extraExtraKeyVals = {
|
||||
"Comments": comments,
|
||||
"Email": email,
|
||||
"URL": URL,
|
||||
};
|
||||
|
||||
// For the entries in extraExtraKeyVals, we only want to submit the
|
||||
// extra data values where they are not the empty string.
|
||||
for (let key in extraExtraKeyVals) {
|
||||
let val = extraExtraKeyVals[key].trim();
|
||||
if (!val) {
|
||||
delete extraExtraKeyVals[key];
|
||||
}
|
||||
}
|
||||
|
||||
// URL is special, since it's already been written to extra data by
|
||||
// default. In order to make sure we don't send it, we overwrite it
|
||||
// with the empty string.
|
||||
if (!includeURL) {
|
||||
extraExtraKeyVals["URL"] = "";
|
||||
}
|
||||
|
||||
CrashSubmit.submit(dumpID, {
|
||||
recordSubmission: true,
|
||||
extraExtraKeyVals,
|
||||
}).then(null, Cu.reportError);
|
||||
|
||||
this.prefs.setBoolPref("sendReport", true);
|
||||
this.prefs.setBoolPref("includeURL", includeURL);
|
||||
this.prefs.setBoolPref("emailMe", emailMe);
|
||||
if (emailMe) {
|
||||
this.prefs.setCharPref("email", email);
|
||||
} else {
|
||||
this.prefs.setCharPref("email", "");
|
||||
}
|
||||
|
||||
this.childMap.set(childID, null); // Avoid resubmission.
|
||||
this.removeSubmitCheckboxesForSameCrash(childID);
|
||||
/*** STUB ***/
|
||||
return;
|
||||
},
|
||||
|
||||
removeSubmitCheckboxesForSameCrash: function(childID) {
|
||||
|
|
@ -518,17 +412,10 @@ this.TabCrashHandler = {
|
|||
/**
|
||||
* For some <xul:browser>, return a crash report dump ID for that browser
|
||||
* if we have been informed of one. Otherwise, return null.
|
||||
*
|
||||
* @param browser (<xul:browser)
|
||||
* The browser to try to get the dump ID for
|
||||
* @returns dumpID (String)
|
||||
*/
|
||||
getDumpID(browser) {
|
||||
if (!AppConstants.MOZ_CRASHREPORTER) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.childMap.get(this.browserMap.get(browser.permanentKey));
|
||||
/*** STUB ***/
|
||||
return null;
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -660,30 +660,8 @@ PluginContent.prototype = {
|
|||
},
|
||||
|
||||
submitReport: function submitReport(plugin) {
|
||||
if (!AppConstants.MOZ_CRASHREPORTER) {
|
||||
return;
|
||||
}
|
||||
if (!plugin) {
|
||||
Cu.reportError("Attempted to submit crash report without an associated plugin.");
|
||||
return;
|
||||
}
|
||||
if (!(plugin instanceof Ci.nsIObjectLoadingContent)) {
|
||||
Cu.reportError("Attempted to submit crash report on plugin that does not" +
|
||||
"implement nsIObjectLoadingContent.");
|
||||
return;
|
||||
}
|
||||
|
||||
let runID = plugin.runID;
|
||||
let submitURLOptIn = this.getPluginUI(plugin, "submitURLOptIn").checked;
|
||||
let keyVals = {};
|
||||
let userComment = this.getPluginUI(plugin, "submitComment").value.trim();
|
||||
if (userComment)
|
||||
keyVals.PluginUserComment = userComment;
|
||||
if (submitURLOptIn)
|
||||
keyVals.PluginContentURL = plugin.ownerDocument.URL;
|
||||
|
||||
this.global.sendAsyncMessage("PluginContent:SubmitReport",
|
||||
{ runID, keyVals, submitURLOptIn });
|
||||
/*** STUB ***/
|
||||
return;
|
||||
},
|
||||
|
||||
reloadPage: function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue