forked from mirrors/gecko-dev
Merge mozilla central to autoland r=merge a=merge on a CLOSED TREE
This commit is contained in:
commit
61b76d3643
134 changed files with 1358 additions and 1068 deletions
|
|
@ -53,10 +53,7 @@
|
||||||
#include "Logging.h"
|
#include "Logging.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "nsImageFrame.h"
|
#include "nsImageFrame.h"
|
||||||
#include "nsINamed.h"
|
#include "nsINamed.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
|
|
@ -1374,11 +1371,9 @@ nsAccessibilityService::Init()
|
||||||
NS_ADDREF(gApplicationAccessible); // will release in Shutdown()
|
NS_ADDREF(gApplicationAccessible); // will release in Shutdown()
|
||||||
gApplicationAccessible->Init();
|
gApplicationAccessible->Init();
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::
|
CrashReporter::
|
||||||
AnnotateCrashReport(NS_LITERAL_CSTRING("Accessibility"),
|
AnnotateCrashReport(NS_LITERAL_CSTRING("Accessibility"),
|
||||||
NS_LITERAL_CSTRING("Active"));
|
NS_LITERAL_CSTRING("Active"));
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
sPendingPlugins = new nsTArray<nsCOMPtr<nsIContent> >;
|
sPendingPlugins = new nsTArray<nsCOMPtr<nsIContent> >;
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,8 @@
|
||||||
#include "Compatibility.h"
|
#include "Compatibility.h"
|
||||||
|
|
||||||
#include "mozilla/WindowsVersion.h"
|
#include "mozilla/WindowsVersion.h"
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsWindowsDllInterceptor.h"
|
#include "nsWindowsDllInterceptor.h"
|
||||||
#include "nsWinUtils.h"
|
#include "nsWinUtils.h"
|
||||||
|
|
@ -219,11 +217,9 @@ Compatibility::Init()
|
||||||
// Note we collect some AT statistics/telemetry here for convenience.
|
// Note we collect some AT statistics/telemetry here for convenience.
|
||||||
InitConsumers();
|
InitConsumers();
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::
|
CrashReporter::
|
||||||
AnnotateCrashReport(NS_LITERAL_CSTRING("AccessibilityInProcClient"),
|
AnnotateCrashReport(NS_LITERAL_CSTRING("AccessibilityInProcClient"),
|
||||||
nsPrintfCString("0x%X", sConsumers));
|
nsPrintfCString("0x%X", sConsumers));
|
||||||
#endif
|
|
||||||
|
|
||||||
// Gather telemetry
|
// Gather telemetry
|
||||||
uint32_t temp = sConsumers;
|
uint32_t temp = sConsumers;
|
||||||
|
|
@ -411,13 +407,11 @@ UseIAccessibleProxyStub()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
// If we reach this point then something is seriously wrong with the
|
// If we reach this point then something is seriously wrong with the
|
||||||
// IAccessible configuration in the computer's registry. Let's annotate this
|
// IAccessible configuration in the computer's registry. Let's annotate this
|
||||||
// so that we can easily determine this condition during crash analysis.
|
// so that we can easily determine this condition during crash analysis.
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IAccessibleConfig"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IAccessibleConfig"),
|
||||||
NS_LITERAL_CSTRING("NoSystemTypeLibOrPS"));
|
NS_LITERAL_CSTRING("NoSystemTypeLibOrPS"));
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
#include "nsAccessibilityService.h"
|
#include "nsAccessibilityService.h"
|
||||||
#include "nsWindowsHelpers.h"
|
#include "nsWindowsHelpers.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
#include "nsXPCOM.h"
|
#include "nsXPCOM.h"
|
||||||
#include "RootAccessibleWrap.h"
|
#include "RootAccessibleWrap.h"
|
||||||
|
|
@ -26,10 +27,6 @@
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <oaidl.h>
|
#include <oaidl.h>
|
||||||
|
|
||||||
#if !defined(STATE_SYSTEM_NORMAL)
|
#if !defined(STATE_SYSTEM_NORMAL)
|
||||||
|
|
@ -305,7 +302,7 @@ LazyInstantiator::ShouldInstantiate(const DWORD aClientTid)
|
||||||
a11y::SetInstantiator(filePath);
|
a11y::SetInstantiator(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#if defined(MOZ_TELEMETRY_REPORTING)
|
||||||
if (!mTelemetryThread) {
|
if (!mTelemetryThread) {
|
||||||
// Call GatherTelemetry on a background thread because it does I/O on
|
// Call GatherTelemetry on a background thread because it does I/O on
|
||||||
// the executable file to retrieve version information.
|
// the executable file to retrieve version information.
|
||||||
|
|
@ -318,12 +315,12 @@ LazyInstantiator::ShouldInstantiate(const DWORD aClientTid)
|
||||||
new AccumulateRunnable(this)));
|
new AccumulateRunnable(this)));
|
||||||
NS_NewThread(getter_AddRefs(mTelemetryThread), runnable);
|
NS_NewThread(getter_AddRefs(mTelemetryThread), runnable);
|
||||||
}
|
}
|
||||||
#endif // defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#if defined(MOZ_TELEMETRY_REPORTING)
|
||||||
/**
|
/**
|
||||||
* Appends version information in the format "|a.b.c.d".
|
* Appends version information in the format "|a.b.c.d".
|
||||||
* If there is no version information, we append nothing.
|
* If there is no version information, we append nothing.
|
||||||
|
|
@ -406,11 +403,9 @@ LazyInstantiator::AccumulateTelemetry(const nsString& aValue)
|
||||||
Telemetry::ScalarSet(Telemetry::ScalarID::A11Y_INSTANTIATORS,
|
Telemetry::ScalarSet(Telemetry::ScalarID::A11Y_INSTANTIATORS,
|
||||||
aValue);
|
aValue);
|
||||||
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::
|
CrashReporter::
|
||||||
AnnotateCrashReport(NS_LITERAL_CSTRING("AccessibilityClient"),
|
AnnotateCrashReport(NS_LITERAL_CSTRING("AccessibilityClient"),
|
||||||
NS_ConvertUTF16toUTF8(aValue));
|
NS_ConvertUTF16toUTF8(aValue));
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mTelemetryThread) {
|
if (mTelemetryThread) {
|
||||||
|
|
@ -418,7 +413,7 @@ LazyInstantiator::AccumulateTelemetry(const nsString& aValue)
|
||||||
mTelemetryThread = nullptr;
|
mTelemetryThread = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||||
|
|
||||||
RootAccessibleWrap*
|
RootAccessibleWrap*
|
||||||
LazyInstantiator::ResolveRootAccWrap()
|
LazyInstantiator::ResolveRootAccWrap()
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ private:
|
||||||
bool ShouldInstantiate(const DWORD aClientTid);
|
bool ShouldInstantiate(const DWORD aClientTid);
|
||||||
|
|
||||||
bool GetClientExecutableName(const DWORD aClientTid, nsIFile** aOutClientExe);
|
bool GetClientExecutableName(const DWORD aClientTid, nsIFile** aOutClientExe);
|
||||||
#if defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#if defined(MOZ_TELEMETRY_REPORTING)
|
||||||
class AccumulateRunnable final : public Runnable
|
class AccumulateRunnable final : public Runnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -120,7 +120,7 @@ private:
|
||||||
void AppendVersionInfo(nsIFile* aClientExe, nsAString& aStrToAppend);
|
void AppendVersionInfo(nsIFile* aClientExe, nsAString& aStrToAppend);
|
||||||
void GatherTelemetry(nsIFile* aClientExe, AccumulateRunnable* aRunnable);
|
void GatherTelemetry(nsIFile* aClientExe, AccumulateRunnable* aRunnable);
|
||||||
void AccumulateTelemetry(const nsString& aValue);
|
void AccumulateTelemetry(const nsString& aValue);
|
||||||
#endif // defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return S_OK if we have a valid mRealRoot to invoke methods on
|
* @return S_OK if we have a valid mRealRoot to invoke methods on
|
||||||
|
|
@ -152,9 +152,9 @@ private:
|
||||||
RootAccessibleWrap* mWeakRootAccWrap;
|
RootAccessibleWrap* mWeakRootAccWrap;
|
||||||
IAccessible* mWeakAccessible;
|
IAccessible* mWeakAccessible;
|
||||||
IDispatch* mWeakDispatch;
|
IDispatch* mWeakDispatch;
|
||||||
#if defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#if defined(MOZ_TELEMETRY_REPORTING)
|
||||||
nsCOMPtr<nsIThread> mTelemetryThread;
|
nsCOMPtr<nsIThread> mTelemetryThread;
|
||||||
#endif // defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,9 @@ add_task(async function navigate() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function crash() {
|
add_task(async function crash() {
|
||||||
if (!gMultiProcessBrowser || !("nsICrashReporter" in Ci))
|
if (!gMultiProcessBrowser || !AppConstants.MOZ_CRASHREPORTER) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let tab = BrowserTestUtils.addTab(gBrowser, DUMMY);
|
let tab = BrowserTestUtils.addTab(gBrowser, DUMMY);
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
|
|
|
||||||
|
|
@ -388,20 +388,20 @@ UserProperties.prototype = {
|
||||||
*
|
*
|
||||||
* @param {CSSStyleDeclaration} style
|
* @param {CSSStyleDeclaration} style
|
||||||
* The CSSStyleDeclaration against which the property is to be mapped.
|
* The CSSStyleDeclaration against which the property is to be mapped.
|
||||||
* @param {String} bame
|
* @param {String} name
|
||||||
* The name of the property to set.
|
* The name of the property to set.
|
||||||
* @param {String} userValue
|
* @param {String} userValue
|
||||||
* The value of the property to set.
|
* The value of the property to set.
|
||||||
*/
|
*/
|
||||||
setProperty: function (style, bame, userValue) {
|
setProperty: function (style, name, userValue) {
|
||||||
let key = this.getKey(style, bame);
|
let key = this.getKey(style, name);
|
||||||
let entry = this.map.get(key, null);
|
let entry = this.map.get(key, null);
|
||||||
|
|
||||||
if (entry) {
|
if (entry) {
|
||||||
entry[bame] = userValue;
|
entry[name] = userValue;
|
||||||
} else {
|
} else {
|
||||||
let props = {};
|
let props = {};
|
||||||
props[bame] = userValue;
|
props[name] = userValue;
|
||||||
this.map.set(key, props);
|
this.map.set(key, props);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@
|
||||||
const promise = require("promise");
|
const promise = require("promise");
|
||||||
const CssLogic = require("devtools/shared/inspector/css-logic");
|
const CssLogic = require("devtools/shared/inspector/css-logic");
|
||||||
const {ELEMENT_STYLE} = require("devtools/shared/specs/styles");
|
const {ELEMENT_STYLE} = require("devtools/shared/specs/styles");
|
||||||
const {TextProperty} =
|
const TextProperty = require("devtools/client/inspector/rules/models/text-property");
|
||||||
require("devtools/client/inspector/rules/models/text-property");
|
|
||||||
const {promiseWarn} = require("devtools/client/inspector/shared/utils");
|
const {promiseWarn} = require("devtools/client/inspector/shared/utils");
|
||||||
const {parseNamedDeclarations} = require("devtools/shared/css/parsing-utils");
|
const {parseNamedDeclarations} = require("devtools/shared/css/parsing-utils");
|
||||||
const Services = require("Services");
|
const Services = require("Services");
|
||||||
|
|
|
||||||
|
|
@ -212,4 +212,4 @@ TextProperty.prototype = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.TextProperty = TextProperty;
|
module.exports = TextProperty;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,12 @@
|
||||||
const {l10n} = require("devtools/shared/inspector/css-logic");
|
const {l10n} = require("devtools/shared/inspector/css-logic");
|
||||||
const {ELEMENT_STYLE} = require("devtools/shared/specs/styles");
|
const {ELEMENT_STYLE} = require("devtools/shared/specs/styles");
|
||||||
const Rule = require("devtools/client/inspector/rules/models/rule");
|
const Rule = require("devtools/client/inspector/rules/models/rule");
|
||||||
const {InplaceEditor, editableField, editableItem} =
|
const {
|
||||||
require("devtools/client/shared/inplace-editor");
|
InplaceEditor,
|
||||||
const {TextPropertyEditor} =
|
editableField,
|
||||||
|
editableItem
|
||||||
|
} = require("devtools/client/shared/inplace-editor");
|
||||||
|
const TextPropertyEditor =
|
||||||
require("devtools/client/inspector/rules/views/text-property-editor");
|
require("devtools/client/inspector/rules/views/text-property-editor");
|
||||||
const {
|
const {
|
||||||
createChild,
|
createChild,
|
||||||
|
|
|
||||||
|
|
@ -1040,4 +1040,4 @@ TextPropertyEditor.prototype = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.TextPropertyEditor = TextPropertyEditor;
|
module.exports = TextPropertyEditor;
|
||||||
|
|
|
||||||
|
|
@ -107,4 +107,4 @@ skip-if = !e10s # test is designed to work on e10s only
|
||||||
[test_webextension-addon-debugging-reload.html]
|
[test_webextension-addon-debugging-reload.html]
|
||||||
skip-if = !e10s # test is designed to work on e10s only
|
skip-if = !e10s # test is designed to work on e10s only
|
||||||
[test_websocket-server.html]
|
[test_websocket-server.html]
|
||||||
skip-if = false
|
skip-if = os == 'mac' # bug 1294873 intermittent leaks
|
||||||
|
|
|
||||||
|
|
@ -2424,12 +2424,10 @@ nsDocShell::GetUseRemoteTabs(bool* aUseRemoteTabs)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::SetRemoteTabs(bool aUseRemoteTabs)
|
nsDocShell::SetRemoteTabs(bool aUseRemoteTabs)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (aUseRemoteTabs) {
|
if (aUseRemoteTabs) {
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("DOMIPCEnabled"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("DOMIPCEnabled"),
|
||||||
NS_LITERAL_CSTRING("1"));
|
NS_LITERAL_CSTRING("1"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mUseRemoteTabs = aUseRemoteTabs;
|
mUseRemoteTabs = aUseRemoteTabs;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
|
|
@ -7929,7 +7929,7 @@ CheckCrossStyleBackendAdoption(nsIDocument* aOldDoc,
|
||||||
if (styleDataTypes.isEmpty()) {
|
if (styleDataTypes.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// We are adopting node with pre-existing style data across style
|
// We are adopting node with pre-existing style data across style
|
||||||
// backend. We want some more information to help diagnose when that
|
// backend. We want some more information to help diagnose when that
|
||||||
// can happen.
|
// can happen.
|
||||||
|
|
@ -7994,7 +7994,7 @@ CheckCrossStyleBackendAdoption(nsIDocument* aOldDoc,
|
||||||
}
|
}
|
||||||
note.Append('\n');
|
note.Append('\n');
|
||||||
CrashReporter::AppendAppNotesToCrashReport(note);
|
CrashReporter::AppendAppNotesToCrashReport(note);
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
MOZ_CRASH("Must not adopt a node with pre-existing style data "
|
MOZ_CRASH("Must not adopt a node with pre-existing style data "
|
||||||
"into a document with different style backend");
|
"into a document with different style backend");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@
|
||||||
#include "DomainPolicy.h"
|
#include "DomainPolicy.h"
|
||||||
#include "mozilla/dom/ipc/StructuredCloneData.h"
|
#include "mozilla/dom/ipc/StructuredCloneData.h"
|
||||||
#include "mozilla/dom/time/DateCacheCleaner.h"
|
#include "mozilla/dom/time/DateCacheCleaner.h"
|
||||||
|
#include "mozilla/ipc/CrashReporterClient.h"
|
||||||
#include "mozilla/net/NeckoMessageUtils.h"
|
#include "mozilla/net/NeckoMessageUtils.h"
|
||||||
#include "mozilla/widget/PuppetBidiKeyboard.h"
|
#include "mozilla/widget/PuppetBidiKeyboard.h"
|
||||||
#include "mozilla/RemoteSpellCheckEngineChild.h"
|
#include "mozilla/RemoteSpellCheckEngineChild.h"
|
||||||
|
|
@ -228,9 +229,6 @@
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#ifdef MOZ_WIDGET_GTK
|
||||||
#include "nsAppRunner.h"
|
#include "nsAppRunner.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "mozilla/ipc/CrashReporterClient.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_CODE_COVERAGE
|
#ifdef MOZ_CODE_COVERAGE
|
||||||
#include "mozilla/CodeCoverageHandler.h"
|
#include "mozilla/CodeCoverageHandler.h"
|
||||||
|
|
@ -649,9 +647,7 @@ ContentChild::Init(MessageLoop* aIOLoop,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::InitSingleton(this);
|
CrashReporterClient::InitSingleton(this);
|
||||||
#endif
|
|
||||||
|
|
||||||
mID = aChildID;
|
mID = aChildID;
|
||||||
mIsForBrowser = aIsForBrowser;
|
mIsForBrowser = aIsForBrowser;
|
||||||
|
|
@ -1701,7 +1697,6 @@ ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker)
|
||||||
sandboxEnabled = StartMacOSContentSandbox();
|
sandboxEnabled = StartMacOSContentSandbox();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("ContentSandboxEnabled"),
|
NS_LITERAL_CSTRING("ContentSandboxEnabled"),
|
||||||
sandboxEnabled? NS_LITERAL_CSTRING("1") : NS_LITERAL_CSTRING("0"));
|
sandboxEnabled? NS_LITERAL_CSTRING("1") : NS_LITERAL_CSTRING("0"));
|
||||||
|
|
@ -1714,7 +1709,6 @@ ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker)
|
||||||
#endif /* XP_LINUX && !OS_ANDROID */
|
#endif /* XP_LINUX && !OS_ANDROID */
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("RemoteType"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("RemoteType"),
|
||||||
NS_ConvertUTF16toUTF8(GetRemoteType()));
|
NS_ConvertUTF16toUTF8(GetRemoteType()));
|
||||||
#endif /* MOZ_CRASHREPORTER */
|
|
||||||
#endif /* MOZ_CONTENT_SANDBOX */
|
#endif /* MOZ_CONTENT_SANDBOX */
|
||||||
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
|
|
@ -2349,9 +2343,8 @@ ContentChild::ActorDestroy(ActorDestroyReason why)
|
||||||
}
|
}
|
||||||
mIsAlive = false;
|
mIsAlive = false;
|
||||||
|
|
||||||
# ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::DestroySingleton();
|
CrashReporterClient::DestroySingleton();
|
||||||
# endif
|
|
||||||
XRE_ShutdownChildProcess();
|
XRE_ShutdownChildProcess();
|
||||||
#endif // NS_FREE_PERMANENT_DATA
|
#endif // NS_FREE_PERMANENT_DATA
|
||||||
}
|
}
|
||||||
|
|
@ -2376,10 +2369,9 @@ ContentChild::ProcessingError(Result aCode, const char* aReason)
|
||||||
MOZ_CRASH("not reached");
|
MOZ_CRASH("not reached");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
nsDependentCString reason(aReason);
|
nsDependentCString reason(aReason);
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ipc_channel_error"), reason);
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ipc_channel_error"), reason);
|
||||||
#endif
|
|
||||||
MOZ_CRASH("Content child abort due to IPC error");
|
MOZ_CRASH("Content child abort due to IPC error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2960,10 +2952,9 @@ ContentChild::RecvShutdown()
|
||||||
// to wait for that event loop to finish. Otherwise we could prematurely
|
// to wait for that event loop to finish. Otherwise we could prematurely
|
||||||
// terminate an "unload" or "pagehide" event handler (which might be doing a
|
// terminate an "unload" or "pagehide" event handler (which might be doing a
|
||||||
// sync XHR, for example).
|
// sync XHR, for example).
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
||||||
NS_LITERAL_CSTRING("RecvShutdown"));
|
NS_LITERAL_CSTRING("RecvShutdown"));
|
||||||
#endif
|
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
RefPtr<nsThread> mainThread = nsThreadManager::get().GetCurrentThread();
|
RefPtr<nsThread> mainThread = nsThreadManager::get().GetCurrentThread();
|
||||||
// Note that we only have to check the recursion count for the current
|
// Note that we only have to check the recursion count for the current
|
||||||
|
|
@ -3019,18 +3010,13 @@ ContentChild::RecvShutdown()
|
||||||
// parent closes.
|
// parent closes.
|
||||||
StartForceKillTimer();
|
StartForceKillTimer();
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
||||||
NS_LITERAL_CSTRING("SendFinishShutdown (sending)"));
|
NS_LITERAL_CSTRING("SendFinishShutdown (sending)"));
|
||||||
bool sent = SendFinishShutdown();
|
bool sent = SendFinishShutdown();
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"),
|
||||||
sent ? NS_LITERAL_CSTRING("SendFinishShutdown (sent)")
|
sent ? NS_LITERAL_CSTRING("SendFinishShutdown (sent)")
|
||||||
: NS_LITERAL_CSTRING("SendFinishShutdown (failed)"));
|
: NS_LITERAL_CSTRING("SendFinishShutdown (failed)"));
|
||||||
#else
|
|
||||||
// Ignore errors here. If this fails, the parent will kill us after a
|
|
||||||
// timeout.
|
|
||||||
Unused << SendFinishShutdown();
|
|
||||||
#endif
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
#include "mozilla/hal_sandbox/PHalParent.h"
|
#include "mozilla/hal_sandbox/PHalParent.h"
|
||||||
#include "mozilla/ipc/BackgroundChild.h"
|
#include "mozilla/ipc/BackgroundChild.h"
|
||||||
#include "mozilla/ipc/BackgroundParent.h"
|
#include "mozilla/ipc/BackgroundParent.h"
|
||||||
|
#include "mozilla/ipc/CrashReporterHost.h"
|
||||||
#include "mozilla/ipc/FileDescriptorUtils.h"
|
#include "mozilla/ipc/FileDescriptorUtils.h"
|
||||||
#include "mozilla/ipc/PChildToParentStreamParent.h"
|
#include "mozilla/ipc/PChildToParentStreamParent.h"
|
||||||
#include "mozilla/ipc/TestShellParent.h"
|
#include "mozilla/ipc/TestShellParent.h"
|
||||||
|
|
@ -150,6 +151,7 @@
|
||||||
#include "nsIDOMChromeWindow.h"
|
#include "nsIDOMChromeWindow.h"
|
||||||
#include "nsIWindowWatcher.h"
|
#include "nsIWindowWatcher.h"
|
||||||
#include "nsPIWindowWatcher.h"
|
#include "nsPIWindowWatcher.h"
|
||||||
|
#include "nsThread.h"
|
||||||
#include "nsWindowWatcher.h"
|
#include "nsWindowWatcher.h"
|
||||||
#include "nsIXULRuntime.h"
|
#include "nsIXULRuntime.h"
|
||||||
#include "mozilla/dom/nsMixedContentBlocker.h"
|
#include "mozilla/dom/nsMixedContentBlocker.h"
|
||||||
|
|
@ -248,11 +250,6 @@
|
||||||
#include "mozilla/widget/AudioSession.h"
|
#include "mozilla/widget/AudioSession.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsThread.h"
|
|
||||||
#include "mozilla/ipc/CrashReporterHost.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
#include "nsAccessibilityService.h"
|
#include "nsAccessibilityService.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -273,9 +270,7 @@ static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);
|
||||||
|
|
||||||
using base::KillProcess;
|
using base::KillProcess;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
using namespace CrashReporter;
|
using namespace CrashReporter;
|
||||||
#endif
|
|
||||||
using namespace mozilla::dom::power;
|
using namespace mozilla::dom::power;
|
||||||
using namespace mozilla::media;
|
using namespace mozilla::media;
|
||||||
using namespace mozilla::embedding;
|
using namespace mozilla::embedding;
|
||||||
|
|
@ -1730,7 +1725,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
|
||||||
|
|
||||||
props->SetPropertyAsBool(NS_LITERAL_STRING("abnormal"), true);
|
props->SetPropertyAsBool(NS_LITERAL_STRING("abnormal"), true);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// There's a window in which child processes can crash
|
// There's a window in which child processes can crash
|
||||||
// after IPC is established, but before a crash reporter
|
// after IPC is established, but before a crash reporter
|
||||||
// is created.
|
// is created.
|
||||||
|
|
@ -1747,7 +1741,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
|
||||||
}
|
}
|
||||||
props->SetPropertyAsAString(NS_LITERAL_STRING("dumpID"), dumpID);
|
props->SetPropertyAsAString(NS_LITERAL_STRING("dumpID"), dumpID);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
nsAutoString cpId;
|
nsAutoString cpId;
|
||||||
cpId.AppendInt(static_cast<uint64_t>(this->ChildID()));
|
cpId.AppendInt(static_cast<uint64_t>(this->ChildID()));
|
||||||
|
|
@ -3060,7 +3053,6 @@ ContentParent::KillHard(const char* aReason)
|
||||||
mCalledKillHard = true;
|
mCalledKillHard = true;
|
||||||
mForceKillTimer = nullptr;
|
mForceKillTimer = nullptr;
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
// We're about to kill the child process associated with this content.
|
// We're about to kill the child process associated with this content.
|
||||||
// Something has gone wrong to get us here, so we generate a minidump
|
// Something has gone wrong to get us here, so we generate a minidump
|
||||||
// of the parent and child for submission to the crash server.
|
// of the parent and child for submission to the crash server.
|
||||||
|
|
@ -3093,19 +3085,17 @@ ContentParent::KillHard(const char* aReason)
|
||||||
true);
|
true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
OnGenerateMinidumpComplete(false);
|
OnGenerateMinidumpComplete(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ContentParent::OnGenerateMinidumpComplete(bool aDumpResult)
|
ContentParent::OnGenerateMinidumpComplete(bool aDumpResult)
|
||||||
{
|
{
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
if (mCrashReporter && aDumpResult) {
|
if (mCrashReporter && aDumpResult) {
|
||||||
// CrashReporterHost::GenerateMinidumpAndPair() is successful.
|
// CrashReporterHost::GenerateMinidumpAndPair() is successful.
|
||||||
mCreatedPairedMinidumps = mCrashReporter->FinalizeCrashReport();
|
mCreatedPairedMinidumps = mCrashReporter->FinalizeCrashReport();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
Unused << aDumpResult; // Don't care about result if no minidump was requested.
|
Unused << aDumpResult; // Don't care about result if no minidump was requested.
|
||||||
|
|
||||||
|
|
@ -3146,12 +3136,11 @@ ContentParent::FriendlyName(nsAString& aName, bool aAnonymize)
|
||||||
mozilla::ipc::IPCResult
|
mozilla::ipc::IPCResult
|
||||||
ContentParent::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
ContentParent::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
mCrashReporter = MakeUnique<CrashReporterHost>(
|
mCrashReporter = MakeUnique<CrashReporterHost>(
|
||||||
GeckoProcessType_Content,
|
GeckoProcessType_Content,
|
||||||
aShmem,
|
aShmem,
|
||||||
aThreadId);
|
aThreadId);
|
||||||
#endif
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4947,9 +4936,7 @@ ContentParent::RecvNotifyLowMemory()
|
||||||
|
|
||||||
Telemetry::ScalarAdd(Telemetry::ScalarID::DOM_CONTENTPROCESS_TROUBLED_DUE_TO_MEMORY, 1);
|
Telemetry::ScalarAdd(Telemetry::ScalarID::DOM_CONTENTPROCESS_TROUBLED_DUE_TO_MEMORY, 1);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsThread::SaveMemoryReportNearOOM(nsThread::ShouldSaveMemoryReport::kForceReport);
|
nsThread::SaveMemoryReportNearOOM(nsThread::ShouldSaveMemoryReport::kForceReport);
|
||||||
#endif
|
|
||||||
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1283,9 +1283,8 @@ private:
|
||||||
nsTHashtable<nsCStringHashKey> mActivePermissionKeys;
|
nsTHashtable<nsCStringHashKey> mActivePermissionKeys;
|
||||||
|
|
||||||
nsTArray<nsCString> mBlobURLs;
|
nsTArray<nsCString> mBlobURLs;
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
UniquePtr<mozilla::ipc::CrashReporterHost> mCrashReporter;
|
UniquePtr<mozilla::ipc::CrashReporterHost> mCrashReporter;
|
||||||
#endif
|
|
||||||
|
|
||||||
static uint64_t sNextTabParentId;
|
static uint64_t sNextTabParentId;
|
||||||
static nsDataHashtable<nsUint64HashKey, TabParent*> sNextTabParents;
|
static nsDataHashtable<nsUint64HashKey, TabParent*> sNextTabParents;
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,12 @@
|
||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
#include "mozilla/WeakPtr.h"
|
#include "mozilla/WeakPtr.h"
|
||||||
|
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIFrameLoader.h"
|
#include "nsIFrameLoader.h"
|
||||||
#include "nsIHangReport.h"
|
#include "nsIHangReport.h"
|
||||||
#include "nsITabParent.h"
|
#include "nsITabParent.h"
|
||||||
#include "nsPluginHost.h"
|
#include "nsPluginHost.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "base/task.h"
|
#include "base/task.h"
|
||||||
#include "base/thread.h"
|
#include "base/thread.h"
|
||||||
|
|
@ -610,7 +608,6 @@ HangMonitorParent::HangMonitorParent(ProcessHangMonitor* aMonitor)
|
||||||
|
|
||||||
HangMonitorParent::~HangMonitorParent()
|
HangMonitorParent::~HangMonitorParent()
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
MutexAutoLock lock(mBrowserCrashDumpHashLock);
|
MutexAutoLock lock(mBrowserCrashDumpHashLock);
|
||||||
|
|
||||||
for (auto iter = mBrowserCrashDumpIds.Iter(); !iter.Done(); iter.Next()) {
|
for (auto iter = mBrowserCrashDumpIds.Iter(); !iter.Done(); iter.Next()) {
|
||||||
|
|
@ -619,7 +616,6 @@ HangMonitorParent::~HangMonitorParent()
|
||||||
CrashReporter::DeleteMinidumpFilesForID(crashId);
|
CrashReporter::DeleteMinidumpFilesForID(crashId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -772,7 +768,6 @@ bool
|
||||||
HangMonitorParent::TakeBrowserMinidump(const PluginHangData& aPhd,
|
HangMonitorParent::TakeBrowserMinidump(const PluginHangData& aPhd,
|
||||||
nsString& aCrashId)
|
nsString& aCrashId)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
MutexAutoLock lock(mBrowserCrashDumpHashLock);
|
MutexAutoLock lock(mBrowserCrashDumpHashLock);
|
||||||
if (!mBrowserCrashDumpIds.Get(aPhd.pluginId(), &aCrashId)) {
|
if (!mBrowserCrashDumpIds.Get(aPhd.pluginId(), &aCrashId)) {
|
||||||
nsCOMPtr<nsIFile> browserDump;
|
nsCOMPtr<nsIFile> browserDump;
|
||||||
|
|
@ -788,7 +783,6 @@ HangMonitorParent::TakeBrowserMinidump(const PluginHangData& aPhd,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -891,11 +885,10 @@ HangMonitorParent::CleanupPluginHang(uint32_t aPluginId, bool aRemoveFiles)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mBrowserCrashDumpIds.Remove(aPluginId);
|
mBrowserCrashDumpIds.Remove(aPluginId);
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (aRemoveFiles && !crashId.IsEmpty()) {
|
if (aRemoveFiles && !crashId.IsEmpty()) {
|
||||||
CrashReporter::DeleteMinidumpFilesForID(crashId);
|
CrashReporter::DeleteMinidumpFilesForID(crashId);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,7 @@
|
||||||
#include "nsEmbedCID.h"
|
#include "nsEmbedCID.h"
|
||||||
#include "nsGlobalWindow.h"
|
#include "nsGlobalWindow.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "nsFilePickerProxy.h"
|
#include "nsFilePickerProxy.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "nsGlobalWindow.h"
|
#include "nsGlobalWindow.h"
|
||||||
|
|
@ -1194,9 +1192,7 @@ TabChild::RecvLoadURL(const nsCString& aURI,
|
||||||
NS_WARNING("WebNavigation()->LoadURI failed. Eating exception, what else can I do?");
|
NS_WARNING("WebNavigation()->LoadURI failed. Eating exception, what else can I do?");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("URL"), aURI);
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("URL"), aURI);
|
||||||
#endif
|
|
||||||
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,11 @@
|
||||||
#define TABMESSAGE_UTILS_H
|
#define TABMESSAGE_UTILS_H
|
||||||
|
|
||||||
#include "ipc/IPCMessageUtils.h"
|
#include "ipc/IPCMessageUtils.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIDOMEvent.h"
|
#include "nsIDOMEvent.h"
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
struct RemoteDOMEvent
|
struct RemoteDOMEvent
|
||||||
|
|
@ -27,12 +24,7 @@ struct RemoteDOMEvent
|
||||||
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
|
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
|
||||||
mozilla::dom::RemoteDOMEvent* aResult);
|
mozilla::dom::RemoteDOMEvent* aResult);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
typedef CrashReporter::ThreadId NativeThreadId;
|
typedef CrashReporter::ThreadId NativeThreadId;
|
||||||
#else
|
|
||||||
// unused in this case
|
|
||||||
typedef int32_t NativeThreadId;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
||||||
|
|
@ -246,9 +246,7 @@ GMPChild::Init(const nsAString& aPluginPath,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::InitSingleton(this);
|
CrashReporterClient::InitSingleton(this);
|
||||||
#endif
|
|
||||||
|
|
||||||
mPluginPath = aPluginPath;
|
mPluginPath = aPluginPath;
|
||||||
|
|
||||||
|
|
@ -617,9 +615,8 @@ GMPChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
ProcessChild::QuickExit();
|
ProcessChild::QuickExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::DestroySingleton();
|
CrashReporterClient::DestroySingleton();
|
||||||
#endif
|
|
||||||
XRE_ShutdownChildProcess();
|
XRE_ShutdownChildProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,13 @@
|
||||||
#include "mozilla/Logging.h"
|
#include "mozilla/Logging.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsIRunnable.h"
|
#include "nsIRunnable.h"
|
||||||
#include "nsIWritablePropertyBag2.h"
|
#include "nsIWritablePropertyBag2.h"
|
||||||
#include "mozIGeckoMediaPluginService.h"
|
#include "mozIGeckoMediaPluginService.h"
|
||||||
#include "mozilla/AbstractThread.h"
|
#include "mozilla/AbstractThread.h"
|
||||||
|
#include "mozilla/ipc/CrashReporterHost.h"
|
||||||
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
||||||
#include "mozilla/SSE.h"
|
#include "mozilla/SSE.h"
|
||||||
#include "mozilla/SyncRunnable.h"
|
#include "mozilla/SyncRunnable.h"
|
||||||
|
|
@ -28,12 +30,8 @@
|
||||||
|
|
||||||
using mozilla::ipc::GeckoChildProcessHost;
|
using mozilla::ipc::GeckoChildProcessHost;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsPrintfCString.h"
|
|
||||||
#include "mozilla/ipc/CrashReporterHost.h"
|
|
||||||
using CrashReporter::AnnotationTable;
|
using CrashReporter::AnnotationTable;
|
||||||
using CrashReporter::GetIDFromMinidump;
|
using CrashReporter::GetIDFromMinidump;
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
|
|
@ -452,7 +450,6 @@ GMPParent::EnsureProcessLoaded()
|
||||||
return NS_SUCCEEDED(rv);
|
return NS_SUCCEEDED(rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void
|
void
|
||||||
GMPParent::WriteExtraDataForMinidump()
|
GMPParent::WriteExtraDataForMinidump()
|
||||||
{
|
{
|
||||||
|
|
@ -497,12 +494,12 @@ GMPNotifyObservers(const uint32_t aPluginID, const nsACString& aPluginName, cons
|
||||||
service->RunPluginCrashCallbacks(aPluginID, aPluginName);
|
service->RunPluginCrashCallbacks(aPluginID, aPluginName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
void
|
void
|
||||||
GMPParent::ActorDestroy(ActorDestroyReason aWhy)
|
GMPParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
{
|
{
|
||||||
LOGD("%s: (%d)", __FUNCTION__, (int)aWhy);
|
LOGD("%s: (%d)", __FUNCTION__, (int)aWhy);
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (AbnormalShutdown == aWhy) {
|
if (AbnormalShutdown == aWhy) {
|
||||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||||
NS_LITERAL_CSTRING("gmplugin"), 1);
|
NS_LITERAL_CSTRING("gmplugin"), 1);
|
||||||
|
|
@ -519,7 +516,7 @@ GMPParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
&GMPNotifyObservers, mPluginId, mDisplayName, dumpID);
|
&GMPNotifyObservers, mPluginId, mDisplayName, dumpID);
|
||||||
mMainThread->Dispatch(r.forget());
|
mMainThread->Dispatch(r.forget());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// warn us off trying to close again
|
// warn us off trying to close again
|
||||||
mState = GMPStateClosing;
|
mState = GMPStateClosing;
|
||||||
mAbnormalShutdownInProgress = true;
|
mAbnormalShutdownInProgress = true;
|
||||||
|
|
@ -540,12 +537,11 @@ GMPParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
mozilla::ipc::IPCResult
|
mozilla::ipc::IPCResult
|
||||||
GMPParent::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
GMPParent::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
|
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
|
||||||
GeckoProcessType_GMPlugin,
|
GeckoProcessType_GMPlugin,
|
||||||
aShmem,
|
aShmem,
|
||||||
aThreadId);
|
aThreadId);
|
||||||
#endif
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,10 +153,8 @@ private:
|
||||||
RefPtr<GenericPromise> ReadGMPInfoFile(nsIFile* aFile);
|
RefPtr<GenericPromise> ReadGMPInfoFile(nsIFile* aFile);
|
||||||
RefPtr<GenericPromise> ParseChromiumManifest(const nsAString& aJSON); // Main thread.
|
RefPtr<GenericPromise> ParseChromiumManifest(const nsAString& aJSON); // Main thread.
|
||||||
RefPtr<GenericPromise> ReadChromiumManifestFile(nsIFile* aFile); // GMP thread.
|
RefPtr<GenericPromise> ReadChromiumManifestFile(nsIFile* aFile); // GMP thread.
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void WriteExtraDataForMinidump();
|
void WriteExtraDataForMinidump();
|
||||||
bool GetCrashID(nsString& aResult);
|
bool GetCrashID(nsString& aResult);
|
||||||
#endif
|
|
||||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||||
|
|
||||||
mozilla::ipc::IPCResult RecvInitCrashReporter(Shmem&& shmem, const NativeThreadId& aThreadId) override;
|
mozilla::ipc::IPCResult RecvInitCrashReporter(Shmem&& shmem, const NativeThreadId& aThreadId) override;
|
||||||
|
|
@ -217,9 +215,7 @@ private:
|
||||||
// to terminate gracefully.
|
// to terminate gracefully.
|
||||||
bool mHoldingSelfRef;
|
bool mHoldingSelfRef;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
|
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
|
||||||
#endif
|
|
||||||
|
|
||||||
const RefPtr<AbstractThread> mMainThread;
|
const RefPtr<AbstractThread> mMainThread;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "prio.h"
|
#include "prio.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsNPAPIPlugin.h"
|
#include "nsNPAPIPlugin.h"
|
||||||
#include "nsNPAPIPluginStreamListener.h"
|
#include "nsNPAPIPluginStreamListener.h"
|
||||||
#include "nsNPAPIPluginInstance.h"
|
#include "nsNPAPIPluginInstance.h"
|
||||||
|
|
@ -103,10 +104,6 @@
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "npapi.h"
|
#include "npapi.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,7 @@
|
||||||
#include "mozilla/UniquePtr.h"
|
#include "mozilla/UniquePtr.h"
|
||||||
|
|
||||||
#include "nsCocoaFeatures.h"
|
#include "nsCocoaFeatures.h"
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -424,14 +422,13 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary)
|
||||||
NS_WARNING(msg.get());
|
NS_WARNING(msg.get());
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
// The block above assumes that "fbplugin" is the filename of the plugin
|
// The block above assumes that "fbplugin" is the filename of the plugin
|
||||||
// to be blocked, or that the filename starts with "fbplugin_". But we
|
// to be blocked, or that the filename starts with "fbplugin_". But we
|
||||||
// don't yet know for sure if this is always true. So for the time being
|
// don't yet know for sure if this is always true. So for the time being
|
||||||
// record extra information in our crash logs.
|
// record extra information in our crash logs.
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Bug_1086977"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Bug_1086977"),
|
||||||
fileName);
|
fileName);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's possible that our plugin has 2 entry points that'll give us mime type
|
// It's possible that our plugin has 2 entry points that'll give us mime type
|
||||||
|
|
@ -441,14 +438,14 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary)
|
||||||
|
|
||||||
// Sadly we have to load the library for this to work.
|
// Sadly we have to load the library for this to work.
|
||||||
rv = LoadPlugin(outLibrary);
|
rv = LoadPlugin(outLibrary);
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
if (nsCocoaFeatures::OnYosemiteOrLater()) {
|
if (nsCocoaFeatures::OnYosemiteOrLater()) {
|
||||||
// If we didn't crash in LoadPlugin(), change the previous annotation so we
|
// If we didn't crash in LoadPlugin(), change the previous annotation so we
|
||||||
// don't sow confusion.
|
// don't sow confusion.
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Bug_1086977"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Bug_1086977"),
|
||||||
NS_LITERAL_CSTRING("Didn't crash, please ignore"));
|
NS_LITERAL_CSTRING("Didn't crash, please ignore"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,9 @@
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
#include "mozilla/Logging.h"
|
#include "mozilla/Logging.h"
|
||||||
#include "nsHashKeys.h"
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
#include "nsHashKeys.h"
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
#include "PluginInterposeOSX.h"
|
#include "PluginInterposeOSX.h"
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
# include "nsX11ErrorHandler.h"
|
# include "nsX11ErrorHandler.h"
|
||||||
# include "mozilla/X11Util.h"
|
# include "mozilla/X11Util.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "mozilla/ipc/CrashReporterClient.h"
|
||||||
#include "mozilla/ipc/ProcessChild.h"
|
#include "mozilla/ipc/ProcessChild.h"
|
||||||
#include "mozilla/plugins/PluginInstanceChild.h"
|
#include "mozilla/plugins/PluginInstanceChild.h"
|
||||||
#include "mozilla/plugins/StreamNotifyChild.h"
|
#include "mozilla/plugins/StreamNotifyChild.h"
|
||||||
|
|
@ -48,10 +50,6 @@
|
||||||
#include "PluginUtilsOSX.h"
|
#include "PluginUtilsOSX.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "mozilla/ipc/CrashReporterClient.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_GECKO_PROFILER
|
#ifdef MOZ_GECKO_PROFILER
|
||||||
#include "ChildProfilerController.h"
|
#include "ChildProfilerController.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -750,10 +748,9 @@ PluginModuleChild::RecvInitPluginModuleChild(Endpoint<PPluginModuleChild>&& aEnd
|
||||||
mozilla::ipc::IPCResult
|
mozilla::ipc::IPCResult
|
||||||
PluginModuleChild::AnswerInitCrashReporter(Shmem&& aShmem, mozilla::dom::NativeThreadId* aOutId)
|
PluginModuleChild::AnswerInitCrashReporter(Shmem&& aShmem, mozilla::dom::NativeThreadId* aOutId)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::InitSingletonWithShmem(aShmem);
|
CrashReporterClient::InitSingletonWithShmem(aShmem);
|
||||||
*aOutId = CrashReporter::CurrentThreadId();
|
*aOutId = CrashReporter::CurrentThreadId();
|
||||||
#endif
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -792,9 +789,8 @@ PluginModuleChild::ActorDestroy(ActorDestroyReason why)
|
||||||
|
|
||||||
// doesn't matter why we're being destroyed; it's up to us to
|
// doesn't matter why we're being destroyed; it's up to us to
|
||||||
// initiate (clean) shutdown
|
// initiate (clean) shutdown
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::DestroySingleton();
|
CrashReporterClient::DestroySingleton();
|
||||||
#endif
|
|
||||||
XRE_ShutdownChildProcess();
|
XRE_ShutdownChildProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "mozilla/dom/ContentParent.h"
|
#include "mozilla/dom/ContentParent.h"
|
||||||
#include "mozilla/dom/ContentChild.h"
|
#include "mozilla/dom/ContentChild.h"
|
||||||
|
#include "mozilla/ipc/CrashReporterClient.h"
|
||||||
|
#include "mozilla/ipc/CrashReporterHost.h"
|
||||||
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
||||||
#include "mozilla/ipc/MessageChannel.h"
|
#include "mozilla/ipc/MessageChannel.h"
|
||||||
#include "mozilla/ipc/ProtocolUtils.h"
|
#include "mozilla/ipc/ProtocolUtils.h"
|
||||||
|
|
@ -65,12 +67,7 @@ using namespace mozilla;
|
||||||
using namespace mozilla::plugins;
|
using namespace mozilla::plugins;
|
||||||
using namespace mozilla::plugins::parent;
|
using namespace mozilla::plugins::parent;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "mozilla/ipc/CrashReporterClient.h"
|
|
||||||
#include "mozilla/ipc/CrashReporterHost.h"
|
|
||||||
|
|
||||||
using namespace CrashReporter;
|
using namespace CrashReporter;
|
||||||
#endif
|
|
||||||
|
|
||||||
static const char kContentTimeoutPref[] = "dom.ipc.plugins.contentTimeoutSecs";
|
static const char kContentTimeoutPref[] = "dom.ipc.plugins.contentTimeoutSecs";
|
||||||
static const char kChildTimeoutPref[] = "dom.ipc.plugins.timeoutSecs";
|
static const char kChildTimeoutPref[] = "dom.ipc.plugins.timeoutSecs";
|
||||||
|
|
@ -525,7 +522,6 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded)
|
||||||
|
|
||||||
RegisterSettingsCallbacks();
|
RegisterSettingsCallbacks();
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// If this fails, we're having IPC troubles, and we're doomed anyways.
|
// If this fails, we're having IPC troubles, and we're doomed anyways.
|
||||||
if (!InitCrashReporter()) {
|
if (!InitCrashReporter()) {
|
||||||
mShutdown = true;
|
mShutdown = true;
|
||||||
|
|
@ -533,7 +529,6 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded)
|
||||||
OnInitFailure();
|
OnInitFailure();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(XP_WIN) && defined(_X86_)
|
#if defined(XP_WIN) && defined(_X86_)
|
||||||
// Protected mode only applies to Windows and only to x86.
|
// Protected mode only applies to Windows and only to x86.
|
||||||
|
|
@ -552,7 +547,6 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded)
|
||||||
bool
|
bool
|
||||||
PluginModuleChromeParent::InitCrashReporter()
|
PluginModuleChromeParent::InitCrashReporter()
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
ipc::Shmem shmem;
|
ipc::Shmem shmem;
|
||||||
if (!ipc::CrashReporterClient::AllocShmem(this, &shmem)) {
|
if (!ipc::CrashReporterClient::AllocShmem(this, &shmem)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -570,7 +564,6 @@ PluginModuleChromeParent::InitCrashReporter()
|
||||||
shmem,
|
shmem,
|
||||||
threadId);
|
threadId);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -588,9 +581,7 @@ PluginModuleParent::PluginModuleParent(bool aIsChrome)
|
||||||
, mTaskFactory(this)
|
, mTaskFactory(this)
|
||||||
, mSandboxLevel(0)
|
, mSandboxLevel(0)
|
||||||
, mIsFlashPlugin(false)
|
, mIsFlashPlugin(false)
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
, mCrashReporterMutex("PluginModuleChromeParent::mCrashReporterMutex")
|
, mCrashReporterMutex("PluginModuleChromeParent::mCrashReporterMutex")
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -702,7 +693,6 @@ PluginModuleChromeParent::~PluginModuleChromeParent()
|
||||||
mozilla::HangMonitor::UnregisterAnnotator(*this);
|
mozilla::HangMonitor::UnregisterAnnotator(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void
|
void
|
||||||
PluginModuleChromeParent::WriteExtraDataForMinidump()
|
PluginModuleChromeParent::WriteExtraDataForMinidump()
|
||||||
{
|
{
|
||||||
|
|
@ -744,7 +734,6 @@ PluginModuleChromeParent::WriteExtraDataForMinidump()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginModuleParent::SetChildTimeout(const int32_t aChildTimeout)
|
PluginModuleParent::SetChildTimeout(const int32_t aChildTimeout)
|
||||||
|
|
@ -1000,7 +989,6 @@ PluginModuleChromeParent::AnnotateHang(mozilla::HangMonitor::HangAnnotations& aA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
static bool
|
static bool
|
||||||
CreatePluginMinidump(base::ProcessId processId, ThreadId childThread,
|
CreatePluginMinidump(base::ProcessId processId, ThreadId childThread,
|
||||||
nsIFile* parentMinidump, const nsACString& name)
|
nsIFile* parentMinidump, const nsACString& name)
|
||||||
|
|
@ -1012,7 +1000,6 @@ CreatePluginMinidump(base::ProcessId processId, ThreadId childThread,
|
||||||
}
|
}
|
||||||
return CreateAdditionalChildMinidump(handle, 0, parentMinidump, name);
|
return CreateAdditionalChildMinidump(handle, 0, parentMinidump, name);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PluginModuleChromeParent::ShouldContinueFromReplyTimeout()
|
PluginModuleChromeParent::ShouldContinueFromReplyTimeout()
|
||||||
|
|
@ -1067,7 +1054,6 @@ PluginModuleChromeParent::TakeFullMinidump(base::ProcessId aContentPid,
|
||||||
std::function<void(nsString)>&& aCallback,
|
std::function<void(nsString)>&& aCallback,
|
||||||
bool aAsync)
|
bool aAsync)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
mozilla::MutexAutoLock lock(mCrashReporterMutex);
|
mozilla::MutexAutoLock lock(mCrashReporterMutex);
|
||||||
|
|
||||||
if (!mCrashReporter || !mTakeFullMinidumpCallback.IsEmpty()) {
|
if (!mCrashReporter || !mTakeFullMinidumpCallback.IsEmpty()) {
|
||||||
|
|
@ -1111,12 +1097,8 @@ PluginModuleChromeParent::TakeFullMinidump(base::ProcessId aContentPid,
|
||||||
} else {
|
} else {
|
||||||
TakeBrowserAndPluginMinidumps(false, aContentPid, browserDumpId, aAsync);
|
TakeBrowserAndPluginMinidumps(false, aContentPid, browserDumpId, aAsync);
|
||||||
}
|
}
|
||||||
#else // MOZ_CRASHREPORTER
|
|
||||||
aCallback(NS_LITERAL_STRING(""));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void
|
void
|
||||||
PluginModuleChromeParent::RetainPluginRef()
|
PluginModuleChromeParent::RetainPluginRef()
|
||||||
{
|
{
|
||||||
|
|
@ -1235,8 +1217,6 @@ PluginModuleChromeParent::OnTakeFullMinidumpComplete(bool aReportsReady,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginModuleChromeParent::TerminateChildProcess(MessageLoop* aMsgLoop,
|
PluginModuleChromeParent::TerminateChildProcess(MessageLoop* aMsgLoop,
|
||||||
base::ProcessId aContentPid,
|
base::ProcessId aContentPid,
|
||||||
|
|
@ -1251,7 +1231,6 @@ PluginModuleChromeParent::TerminateChildProcess(MessageLoop* aMsgLoop,
|
||||||
}
|
}
|
||||||
mTerminateChildProcessCallback.Init(Move(aCallback), aAsync);
|
mTerminateChildProcessCallback.Init(Move(aCallback), aAsync);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Start by taking a full minidump if necessary, this is done early
|
// Start by taking a full minidump if necessary, this is done early
|
||||||
// because it also needs to lock the mCrashReporterMutex and Mutex doesn't
|
// because it also needs to lock the mCrashReporterMutex and Mutex doesn't
|
||||||
// support recursive locking.
|
// support recursive locking.
|
||||||
|
|
@ -1276,17 +1255,12 @@ PluginModuleChromeParent::TerminateChildProcess(MessageLoop* aMsgLoop,
|
||||||
} else {
|
} else {
|
||||||
TerminateChildProcessOnDumpComplete(aMsgLoop, aMonitorDescription);
|
TerminateChildProcessOnDumpComplete(aMsgLoop, aMonitorDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
TerminateChildProcessOnDumpComplete(aMsgLoop, aMonitorDescription);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginModuleChromeParent::TerminateChildProcessOnDumpComplete(MessageLoop* aMsgLoop,
|
PluginModuleChromeParent::TerminateChildProcessOnDumpComplete(MessageLoop* aMsgLoop,
|
||||||
const nsCString& aMonitorDescription)
|
const nsCString& aMonitorDescription)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
mCrashReporterMutex.AssertCurrentThreadOwns();
|
mCrashReporterMutex.AssertCurrentThreadOwns();
|
||||||
|
|
||||||
if (!mCrashReporter) {
|
if (!mCrashReporter) {
|
||||||
|
|
@ -1310,7 +1284,6 @@ PluginModuleChromeParent::TerminateChildProcessOnDumpComplete(MessageLoop* aMsgL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // XP_WIN
|
#endif // XP_WIN
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
|
|
||||||
mozilla::ipc::ScopedProcessHandle geckoChildProcess;
|
mozilla::ipc::ScopedProcessHandle geckoChildProcess;
|
||||||
bool childOpened = base::OpenProcessHandle(OtherPid(),
|
bool childOpened = base::OpenProcessHandle(OtherPid(),
|
||||||
|
|
@ -1341,7 +1314,7 @@ PluginModuleChromeParent::TerminateChildProcessOnDumpComplete(MessageLoop* aMsgL
|
||||||
if (!GetProcessCpuUsage(processHandles, mPluginCpuUsageOnHang)) {
|
if (!GetProcessCpuUsage(processHandles, mPluginCpuUsageOnHang)) {
|
||||||
mPluginCpuUsageOnHang.Clear();
|
mPluginCpuUsageOnHang.Clear();
|
||||||
}
|
}
|
||||||
#endif // MOZ_CRASHREPORTER
|
#endif
|
||||||
|
|
||||||
// this must run before the error notification from the channel,
|
// this must run before the error notification from the channel,
|
||||||
// or not at all
|
// or not at all
|
||||||
|
|
@ -1486,7 +1459,6 @@ PluginModuleChromeParent::OnHangUIContinue()
|
||||||
}
|
}
|
||||||
#endif // XP_WIN
|
#endif // XP_WIN
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
||||||
static void
|
static void
|
||||||
RemoveMinidump(nsIFile* minidump)
|
RemoveMinidump(nsIFile* minidump)
|
||||||
|
|
@ -1578,7 +1550,6 @@ PluginModuleChromeParent::ProcessFirstMinidump()
|
||||||
}
|
}
|
||||||
mCrashReporter->FinalizeCrashReport();
|
mCrashReporter->FinalizeCrashReport();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginModuleParent::ActorDestroy(ActorDestroyReason why)
|
PluginModuleParent::ActorDestroy(ActorDestroyReason why)
|
||||||
|
|
@ -1617,9 +1588,7 @@ void
|
||||||
PluginModuleChromeParent::ActorDestroy(ActorDestroyReason why)
|
PluginModuleChromeParent::ActorDestroy(ActorDestroyReason why)
|
||||||
{
|
{
|
||||||
if (why == AbnormalShutdown) {
|
if (why == AbnormalShutdown) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
ProcessFirstMinidump();
|
ProcessFirstMinidump();
|
||||||
#endif
|
|
||||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||||
NS_LITERAL_CSTRING("plugin"), 1);
|
NS_LITERAL_CSTRING("plugin"), 1);
|
||||||
}
|
}
|
||||||
|
|
@ -1656,11 +1625,11 @@ PluginModuleParent::NotifyPluginCrashed()
|
||||||
|
|
||||||
nsString dumpID;
|
nsString dumpID;
|
||||||
nsString browserDumpID;
|
nsString browserDumpID;
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (mCrashReporter && mCrashReporter->HasMinidump()) {
|
if (mCrashReporter && mCrashReporter->HasMinidump()) {
|
||||||
dumpID = mCrashReporter->MinidumpID();
|
dumpID = mCrashReporter->MinidumpID();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
mPlugin->PluginCrashed(dumpID, browserDumpID);
|
mPlugin->PluginCrashed(dumpID, browserDumpID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
#include "npapi.h"
|
#include "npapi.h"
|
||||||
#include "npfunctions.h"
|
#include "npfunctions.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsDataHashtable.h"
|
#include "nsDataHashtable.h"
|
||||||
#include "nsHashKeys.h"
|
#include "nsHashKeys.h"
|
||||||
#include "nsIObserver.h"
|
#include "nsIObserver.h"
|
||||||
|
|
@ -31,10 +32,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class nsPluginTag;
|
class nsPluginTag;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
@ -334,7 +331,6 @@ protected:
|
||||||
RefPtr<layers::TextureClientRecycleAllocator> mTextureAllocatorForDirectBitmap;
|
RefPtr<layers::TextureClientRecycleAllocator> mTextureAllocatorForDirectBitmap;
|
||||||
RefPtr<layers::TextureClientRecycleAllocator> mTextureAllocatorForDXGISurface;
|
RefPtr<layers::TextureClientRecycleAllocator> mTextureAllocatorForDXGISurface;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
/**
|
/**
|
||||||
* This mutex protects the crash reporter when the Plugin Hang UI event
|
* This mutex protects the crash reporter when the Plugin Hang UI event
|
||||||
* handler is executing off main thread. It is intended to protect both
|
* handler is executing off main thread. It is intended to protect both
|
||||||
|
|
@ -343,7 +339,6 @@ protected:
|
||||||
*/
|
*/
|
||||||
mozilla::Mutex mCrashReporterMutex;
|
mozilla::Mutex mCrashReporterMutex;
|
||||||
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
|
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PluginModuleContentParent : public PluginModuleParent
|
class PluginModuleContentParent : public PluginModuleParent
|
||||||
|
|
@ -458,7 +453,6 @@ class PluginModuleChromeParent
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// The following methods are callbacks invoked after calling
|
// The following methods are callbacks invoked after calling
|
||||||
// TakeFullMinidump(). The methods are invoked in the following order:
|
// TakeFullMinidump(). The methods are invoked in the following order:
|
||||||
void TakeBrowserAndPluginMinidumps(bool aReportsReady,
|
void TakeBrowserAndPluginMinidumps(bool aReportsReady,
|
||||||
|
|
@ -469,7 +463,7 @@ class PluginModuleChromeParent
|
||||||
base::ProcessId aContentPid,
|
base::ProcessId aContentPid,
|
||||||
const nsAString& aBrowserDumpId);
|
const nsAString& aBrowserDumpId);
|
||||||
|
|
||||||
#endif
|
|
||||||
// The following method is the callback invoked after calling
|
// The following method is the callback invoked after calling
|
||||||
// TerminateChidlProcess().
|
// TerminateChidlProcess().
|
||||||
void TerminateChildProcessOnDumpComplete(MessageLoop* aMsgLoop,
|
void TerminateChildProcessOnDumpComplete(MessageLoop* aMsgLoop,
|
||||||
|
|
@ -518,12 +512,10 @@ private:
|
||||||
|
|
||||||
virtual bool ShouldContinueFromReplyTimeout() override;
|
virtual bool ShouldContinueFromReplyTimeout() override;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void ProcessFirstMinidump();
|
void ProcessFirstMinidump();
|
||||||
void WriteExtraDataForMinidump();
|
void WriteExtraDataForMinidump();
|
||||||
void RetainPluginRef();
|
void RetainPluginRef();
|
||||||
void ReleasePluginRef();
|
void ReleasePluginRef();
|
||||||
#endif
|
|
||||||
|
|
||||||
PluginProcessParent* Process() const { return mSubprocess; }
|
PluginProcessParent* Process() const { return mSubprocess; }
|
||||||
base::ProcessHandle ChildProcessHandle() { return mSubprocess->GetChildProcessHandle(); }
|
base::ProcessHandle ChildProcessHandle() { return mSubprocess->GetChildProcessHandle(); }
|
||||||
|
|
@ -641,10 +633,9 @@ private:
|
||||||
mozilla::SandboxPermissions mSandboxPermissions;
|
mozilla::SandboxPermissions mSandboxPermissions;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsCOMPtr<nsIFile> mBrowserDumpFile;
|
nsCOMPtr<nsIFile> mBrowserDumpFile;
|
||||||
TakeFullMinidumpCallback mTakeFullMinidumpCallback;
|
TakeFullMinidumpCallback mTakeFullMinidumpCallback;
|
||||||
#endif
|
|
||||||
TerminateChildProcessCallback mTerminateChildProcessCallback;
|
TerminateChildProcessCallback mTerminateChildProcessCallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -669,6 +669,13 @@ RespondWithHandler::ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Telemetry::ScalarAdd(Telemetry::ScalarID::SW_SYNTHESIZED_RES_COUNT, 1);
|
||||||
|
|
||||||
|
if (mRequestMode == RequestMode::Same_origin &&
|
||||||
|
response->Type() == ResponseType::Cors) {
|
||||||
|
Telemetry::ScalarAdd(Telemetry::ScalarID::SW_CORS_RES_FOR_SO_REQ_COUNT, 1);
|
||||||
|
}
|
||||||
|
|
||||||
UniquePtr<RespondWithClosure> closure(new RespondWithClosure(mInterceptedChannel,
|
UniquePtr<RespondWithClosure> closure(new RespondWithClosure(mInterceptedChannel,
|
||||||
mRegistration,
|
mRegistration,
|
||||||
mRequestURL,
|
mRequestURL,
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,10 @@ GLContextEGLFactory::Create(EGLNativeWindowType aWindow,
|
||||||
|
|
||||||
gl->MakeCurrent();
|
gl->MakeCurrent();
|
||||||
gl->SetIsDoubleBuffered(doubleBuffered);
|
gl->SetIsDoubleBuffered(doubleBuffered);
|
||||||
|
if (aWebRender && sEGLLibrary.IsANGLE()) {
|
||||||
|
MOZ_ASSERT(doubleBuffered);
|
||||||
|
sEGLLibrary.fSwapInterval(EGL_DISPLAY(), 0);
|
||||||
|
}
|
||||||
return gl.forget();
|
return gl.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -413,6 +413,7 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
|
||||||
SYMBOL(QueryContext),
|
SYMBOL(QueryContext),
|
||||||
SYMBOL(BindTexImage),
|
SYMBOL(BindTexImage),
|
||||||
SYMBOL(ReleaseTexImage),
|
SYMBOL(ReleaseTexImage),
|
||||||
|
SYMBOL(SwapInterval),
|
||||||
SYMBOL(QuerySurface),
|
SYMBOL(QuerySurface),
|
||||||
END_OF_SYMBOLS
|
END_OF_SYMBOLS
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,9 @@ public:
|
||||||
EGLBoolean fReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) const
|
EGLBoolean fReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) const
|
||||||
WRAP( fReleaseTexImage(dpy, surface, buffer) )
|
WRAP( fReleaseTexImage(dpy, surface, buffer) )
|
||||||
|
|
||||||
|
EGLBoolean fSwapInterval(EGLDisplay dpy, EGLint interval) const
|
||||||
|
WRAP( fSwapInterval(dpy, interval) )
|
||||||
|
|
||||||
EGLImage fCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list) const
|
EGLImage fCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list) const
|
||||||
WRAP( fCreateImageKHR(dpy, ctx, target, buffer, attrib_list) )
|
WRAP( fCreateImageKHR(dpy, ctx, target, buffer, attrib_list) )
|
||||||
|
|
||||||
|
|
@ -433,6 +436,7 @@ private:
|
||||||
EGLint buffer);
|
EGLint buffer);
|
||||||
EGLBoolean (GLAPIENTRY * fReleaseTexImage)(EGLDisplay, EGLSurface surface,
|
EGLBoolean (GLAPIENTRY * fReleaseTexImage)(EGLDisplay, EGLSurface surface,
|
||||||
EGLint buffer);
|
EGLint buffer);
|
||||||
|
EGLBoolean (GLAPIENTRY * fSwapInterval)(EGLDisplay dpy, EGLint interval);
|
||||||
EGLImage (GLAPIENTRY * fCreateImageKHR)(EGLDisplay dpy, EGLContext ctx,
|
EGLImage (GLAPIENTRY * fCreateImageKHR)(EGLDisplay dpy, EGLContext ctx,
|
||||||
EGLenum target, EGLClientBuffer buffer,
|
EGLenum target, EGLClientBuffer buffer,
|
||||||
const EGLint* attrib_list);
|
const EGLint* attrib_list);
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,10 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "GfxTexturesReporter.h"
|
#include "GfxTexturesReporter.h"
|
||||||
#include "gfxPrefs.h"
|
#include "gfxPrefs.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::gl;
|
using namespace mozilla::gl;
|
||||||
|
|
||||||
|
|
@ -76,7 +73,5 @@ GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateTexturesSize(sAmount);
|
CrashReporter::AnnotateTexturesSize(sAmount);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,12 +144,11 @@ GPUChild::RecvGraphicsError(const nsCString& aError)
|
||||||
mozilla::ipc::IPCResult
|
mozilla::ipc::IPCResult
|
||||||
GPUChild::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
GPUChild::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
|
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
|
||||||
GeckoProcessType_GPU,
|
GeckoProcessType_GPU,
|
||||||
aShmem,
|
aShmem,
|
||||||
aThreadId);
|
aThreadId);
|
||||||
#endif
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -252,12 +251,10 @@ void
|
||||||
GPUChild::ActorDestroy(ActorDestroyReason aWhy)
|
GPUChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
{
|
{
|
||||||
if (aWhy == AbnormalShutdown) {
|
if (aWhy == AbnormalShutdown) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (mCrashReporter) {
|
if (mCrashReporter) {
|
||||||
mCrashReporter->GenerateCrashReport(OtherPid());
|
mCrashReporter->GenerateCrashReport(OtherPid());
|
||||||
mCrashReporter = nullptr;
|
mCrashReporter = nullptr;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||||
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU)), 1);
|
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU)), 1);
|
||||||
|
|
|
||||||
|
|
@ -100,10 +100,8 @@ GPUParent::Init(base::ProcessId aParentPid,
|
||||||
// versions.
|
// versions.
|
||||||
GetIPCChannel()->SendBuildID();
|
GetIPCChannel()->SendBuildID();
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Init crash reporter support.
|
// Init crash reporter support.
|
||||||
CrashReporterClient::InitSingleton(this);
|
CrashReporterClient::InitSingleton(this);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Ensure gfxPrefs are initialized.
|
// Ensure gfxPrefs are initialized.
|
||||||
gfxPrefs::GetSingleton();
|
gfxPrefs::GetSingleton();
|
||||||
|
|
@ -471,9 +469,7 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
gfxVars::Shutdown();
|
gfxVars::Shutdown();
|
||||||
gfxConfig::Shutdown();
|
gfxConfig::Shutdown();
|
||||||
gfxPrefs::DestroySingleton();
|
gfxPrefs::DestroySingleton();
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporterClient::DestroySingleton();
|
CrashReporterClient::DestroySingleton();
|
||||||
#endif
|
|
||||||
XRE_ShutdownChildProcess();
|
XRE_ShutdownChildProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,11 +39,8 @@
|
||||||
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
||||||
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
||||||
#include "MediaPrefs.h"
|
#include "MediaPrefs.h"
|
||||||
#include "nsPrintfCString.h"
|
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
#include "nsPrintfCString.h"
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
#if defined(MOZ_WIDGET_ANDROID)
|
||||||
#include "mozilla/widget/AndroidUiThread.h"
|
#include "mozilla/widget/AndroidUiThread.h"
|
||||||
|
|
@ -368,7 +365,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
|
||||||
mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild));
|
mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild));
|
||||||
mGPUChild->SendInitVsyncBridge(Move(vsyncParent));
|
mGPUChild->SendInitVsyncBridge(Move(vsyncParent));
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
||||||
NS_LITERAL_CSTRING("Running"));
|
NS_LITERAL_CSTRING("Running"));
|
||||||
|
|
@ -376,7 +372,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("GPUProcessLaunchCount"),
|
NS_LITERAL_CSTRING("GPUProcessLaunchCount"),
|
||||||
nsPrintfCString("%d", mNumProcessAttempts));
|
nsPrintfCString("%d", mNumProcessAttempts));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
@ -717,11 +712,9 @@ GPUProcessManager::DestroyProcess()
|
||||||
mVsyncBridge = nullptr;
|
mVsyncBridge = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
NS_LITERAL_CSTRING("GPUProcessStatus"),
|
||||||
NS_LITERAL_CSTRING("Destroyed"));
|
NS_LITERAL_CSTRING("Destroyed"));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CompositorSession>
|
already_AddRefed<CompositorSession>
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@
|
||||||
#include "gfxConfig.h"
|
#include "gfxConfig.h"
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsDirectoryServiceUtils.h"
|
#include "nsDirectoryServiceUtils.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
@ -167,11 +165,9 @@ DriverCrashGuard::~DriverCrashGuard()
|
||||||
dom::ContentChild::GetSingleton()->SendEndDriverCrashGuard(uint32_t(mType));
|
dom::ContentChild::GetSingleton()->SendEndDriverCrashGuard(uint32_t(mType));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Remove the crash report annotation.
|
// Remove the crash report annotation.
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
||||||
NS_LITERAL_CSTRING(""));
|
NS_LITERAL_CSTRING(""));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -210,7 +206,6 @@ DriverCrashGuard::ActivateGuard()
|
||||||
{
|
{
|
||||||
mGuardActivated = true;
|
mGuardActivated = true;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Anotate crash reports only if we're a real guard. Otherwise, we could
|
// Anotate crash reports only if we're a real guard. Otherwise, we could
|
||||||
// attribute a random parent process crash to a graphics problem in a child
|
// attribute a random parent process crash to a graphics problem in a child
|
||||||
// process.
|
// process.
|
||||||
|
|
@ -218,7 +213,6 @@ DriverCrashGuard::ActivateGuard()
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"),
|
||||||
NS_LITERAL_CSTRING("1"));
|
NS_LITERAL_CSTRING("1"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// If we're in the content process, the rest of the guarding is handled
|
// If we're in the content process, the rest of the guarding is handled
|
||||||
// in the parent.
|
// in the parent.
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,6 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "gfxCrashReporterUtils.h"
|
#include "gfxCrashReporterUtils.h"
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
#define MOZ_GFXFEATUREREPORTER 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_GFXFEATUREREPORTER
|
|
||||||
#include "gfxCrashReporterUtils.h"
|
|
||||||
#include <string.h> // for strcmp
|
#include <string.h> // for strcmp
|
||||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
||||||
#include "mozilla/Services.h" // for GetObserverService
|
#include "mozilla/Services.h" // for GetObserverService
|
||||||
|
|
@ -137,13 +130,3 @@ ScopedGfxFeatureReporter::AppNote(const nsACString& aMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace mozilla
|
} // end namespace mozilla
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
void ScopedGfxFeatureReporter::WriteAppNote(char) {}
|
|
||||||
void ScopedGfxFeatureReporter::AppNote(const nsACString&) {}
|
|
||||||
|
|
||||||
} // namespace mozilla
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ TEST(GfxPrefs, Set) {
|
||||||
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f);
|
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Randomly test the function we use in nsExceptionHandler.cpp here:
|
// Randomly test the function we use in nsExceptionHandler.cpp here:
|
||||||
extern bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength);
|
extern bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength);
|
||||||
TEST(GfxPrefs, StringUtility)
|
TEST(GfxPrefs, StringUtility)
|
||||||
|
|
@ -104,4 +103,3 @@ TEST(GfxPrefs, StringUtility)
|
||||||
// It won't fit into 32:
|
// It won't fit into 32:
|
||||||
ASSERT_FALSE(SimpleNoCLibDtoA(testVal[4], testBuffer, sizeof(testBuffer)/2));
|
ASSERT_FALSE(SimpleNoCLibDtoA(testVal[4], testBuffer, sizeof(testBuffer)/2));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -21,16 +21,13 @@
|
||||||
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
|
#include "mozilla/layers/DeviceAttachmentsD3D11.h"
|
||||||
#include "mozilla/layers/MLGDeviceD3D11.h"
|
#include "mozilla/layers/MLGDeviceD3D11.h"
|
||||||
#include "mozilla/layers/PaintThread.h"
|
#include "mozilla/layers/PaintThread.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIGfxInfo.h"
|
#include "nsIGfxInfo.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#include "nsPrintfCString.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
|
||||||
|
|
@ -772,12 +769,10 @@ DeviceManagerDx::MaybeResetAndReacquireDevices()
|
||||||
Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
|
Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsPrintfCString reasonString("%d", int(resetReason));
|
nsPrintfCString reasonString("%d", int(resetReason));
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("DeviceResetReason"),
|
NS_LITERAL_CSTRING("DeviceResetReason"),
|
||||||
reasonString);
|
reasonString);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool createCompositorDevice = !!mCompositorDevice;
|
bool createCompositorDevice = !!mCompositorDevice;
|
||||||
bool createContentDevice = !!mContentDevice;
|
bool createContentDevice = !!mContentDevice;
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@
|
||||||
#include "gfxGradientCache.h"
|
#include "gfxGradientCache.h"
|
||||||
#include "gfxUtils.h" // for NextPowerOfTwo
|
#include "gfxUtils.h" // for NextPowerOfTwo
|
||||||
|
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsUnicodeRange.h"
|
#include "nsUnicodeRange.h"
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
|
|
@ -77,9 +78,6 @@
|
||||||
#include "nsIScreenManager.h"
|
#include "nsIScreenManager.h"
|
||||||
#include "FrameMetrics.h"
|
#include "FrameMetrics.h"
|
||||||
#include "MainThreadUtils.h"
|
#include "MainThreadUtils.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
|
|
||||||
|
|
@ -298,12 +296,9 @@ void CrashStatsLogForwarder::UpdateCrashReport()
|
||||||
message << logAnnotation << Get<0>(it) << "]" << Get<1>(it) << " (t=" << Get<2>(it) << ") ";
|
message << logAnnotation << Get<0>(it) << "]" << Get<1>(it) << " (t=" << Get<2>(it) << ") ";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsCString reportString(message.str().c_str());
|
nsCString reportString(message.str().c_str());
|
||||||
nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString);
|
nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString);
|
||||||
#else
|
|
||||||
nsresult annotated = NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
#endif
|
|
||||||
if (annotated != NS_OK) {
|
if (annotated != NS_OK) {
|
||||||
printf("Crash Annotation %s: %s",
|
printf("Crash Annotation %s: %s",
|
||||||
mCrashCriticalKey.get(), message.str().c_str());
|
mCrashCriticalKey.get(), message.str().c_str());
|
||||||
|
|
|
||||||
|
|
@ -954,6 +954,13 @@ VectorImage::Draw(gfxContext* aContext,
|
||||||
SendOnUnlockedDraw(aFlags);
|
SendOnUnlockedDraw(aFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We should always bypass the cache when using DrawTargetRecording because
|
||||||
|
// we prefer the drawing commands in general to the rasterized surface. This
|
||||||
|
// allows blob images to avoid rasterized SVGs with WebRender.
|
||||||
|
if (aContext->GetDrawTarget()->GetBackendType() == BackendType::RECORDING) {
|
||||||
|
aFlags |= FLAG_BYPASS_SURFACE_CACHE;
|
||||||
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(!(aFlags & FLAG_FORCE_PRESERVEASPECTRATIO_NONE) ||
|
MOZ_ASSERT(!(aFlags & FLAG_FORCE_PRESERVEASPECTRATIO_NONE) ||
|
||||||
(aSVGContext && aSVGContext->GetViewportSize()),
|
(aSVGContext && aSVGContext->GetViewportSize()),
|
||||||
"Viewport size is required when using "
|
"Viewport size is required when using "
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#include "CrashReporterMetadataShmem.h"
|
#include "CrashReporterMetadataShmem.h"
|
||||||
#include "nsISupportsImpl.h"
|
#include "nsISupportsImpl.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
|
|
@ -65,4 +64,3 @@ CrashReporterClient::GetSingleton()
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
#include "mozilla/ipc/Shmem.h"
|
#include "mozilla/ipc/Shmem.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
|
|
@ -78,7 +77,6 @@ private:
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
#endif // MOZ_CRASHREPORTER
|
|
||||||
|
|
||||||
#endif // mozilla_ipc_CrashReporterClient_h
|
#endif // mozilla_ipc_CrashReporterClient_h
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,9 @@
|
||||||
#include "mozilla/Sprintf.h"
|
#include "mozilla/Sprintf.h"
|
||||||
#include "mozilla/SyncRunnable.h"
|
#include "mozilla/SyncRunnable.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIAsyncShutdown.h"
|
#include "nsIAsyncShutdown.h"
|
||||||
#include "nsICrashService.h"
|
#include "nsICrashService.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
@ -30,7 +28,6 @@ CrashReporterHost::CrashReporterHost(GeckoProcessType aProcessType,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
bool
|
bool
|
||||||
CrashReporterHost::GenerateCrashReport(base::ProcessId aPid)
|
CrashReporterHost::GenerateCrashReport(base::ProcessId aPid)
|
||||||
{
|
{
|
||||||
|
|
@ -288,7 +285,6 @@ CrashReporterHost::AddNote(const nsCString& aKey, const nsCString& aValue)
|
||||||
{
|
{
|
||||||
mExtraNotes.Put(aKey, aValue);
|
mExtraNotes.Put(aKey, aValue);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,7 @@
|
||||||
#include "mozilla/UniquePtr.h"
|
#include "mozilla/UniquePtr.h"
|
||||||
#include "mozilla/ipc/Shmem.h"
|
#include "mozilla/ipc/Shmem.h"
|
||||||
#include "base/process.h"
|
#include "base/process.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
@ -30,13 +28,8 @@ class GeckoChildProcessHost;
|
||||||
class CrashReporterHost
|
class CrashReporterHost
|
||||||
{
|
{
|
||||||
typedef mozilla::ipc::Shmem Shmem;
|
typedef mozilla::ipc::Shmem Shmem;
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
typedef CrashReporter::AnnotationTable AnnotationTable;
|
typedef CrashReporter::AnnotationTable AnnotationTable;
|
||||||
typedef CrashReporter::ThreadId ThreadId;
|
typedef CrashReporter::ThreadId ThreadId;
|
||||||
#else
|
|
||||||
// unused in this case
|
|
||||||
typedef int32_t ThreadId;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -99,7 +92,6 @@ public:
|
||||||
const Shmem& aShmem,
|
const Shmem& aShmem,
|
||||||
ThreadId aThreadId);
|
ThreadId aThreadId);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Helper function for generating a crash report for a process that probably
|
// Helper function for generating a crash report for a process that probably
|
||||||
// crashed (i.e., had an AbnormalShutdown in ActorDestroy). Returns true if
|
// crashed (i.e., had an AbnormalShutdown in ActorDestroy). Returns true if
|
||||||
// the process has a minidump attached and we were able to generate a report.
|
// the process has a minidump attached and we were able to generate a report.
|
||||||
|
|
@ -149,7 +141,6 @@ public:
|
||||||
MOZ_ASSERT(HasMinidump());
|
MOZ_ASSERT(HasMinidump());
|
||||||
return mDumpID;
|
return mDumpID;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void AsyncAddCrash(int32_t aProcessType, int32_t aCrashType,
|
static void AsyncAddCrash(int32_t aProcessType, int32_t aCrashType,
|
||||||
|
|
@ -161,9 +152,7 @@ private:
|
||||||
Shmem mShmem;
|
Shmem mShmem;
|
||||||
ThreadId mThreadId;
|
ThreadId mThreadId;
|
||||||
time_t mStartTime;
|
time_t mStartTime;
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
AnnotationTable mExtraNotes;
|
AnnotationTable mExtraNotes;
|
||||||
#endif
|
|
||||||
nsString mDumpID;
|
nsString mDumpID;
|
||||||
bool mFinalized;
|
bool mFinalized;
|
||||||
nsCOMPtr<nsIFile> mTargetDump;
|
nsCOMPtr<nsIFile> mTargetDump;
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,6 @@ private:
|
||||||
EntryType mEntryType;
|
EntryType mEntryType;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void
|
void
|
||||||
CrashReporterMetadataShmem::ReadAppNotes(const Shmem& aShmem, CrashReporter::AnnotationTable* aNotes)
|
CrashReporterMetadataShmem::ReadAppNotes(const Shmem& aShmem, CrashReporter::AnnotationTable* aNotes)
|
||||||
{
|
{
|
||||||
|
|
@ -229,7 +228,6 @@ CrashReporterMetadataShmem::ReadAppNotes(const Shmem& aShmem, CrashReporter::Ann
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,7 @@ public:
|
||||||
void AnnotateCrashReport(const nsCString& aKey, const nsCString& aData);
|
void AnnotateCrashReport(const nsCString& aKey, const nsCString& aData);
|
||||||
void AppendAppNotes(const nsCString& aData);
|
void AppendAppNotes(const nsCString& aData);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
static void ReadAppNotes(const Shmem& aShmem, CrashReporter::AnnotationTable* aNotes);
|
static void ReadAppNotes(const Shmem& aShmem, CrashReporter::AnnotationTable* aNotes);
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SyncNotesToShmem();
|
void SyncNotesToShmem();
|
||||||
|
|
|
||||||
|
|
@ -224,11 +224,9 @@ GeckoChildProcessHost::GetUniqueID()
|
||||||
void
|
void
|
||||||
GeckoChildProcessHost::PrepareLaunch()
|
GeckoChildProcessHost::PrepareLaunch()
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (CrashReporter::GetEnabled()) {
|
if (CrashReporter::GetEnabled()) {
|
||||||
CrashReporter::OOPInit();
|
CrashReporter::OOPInit();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
|
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
|
||||||
SandboxLaunchPrepare(mProcessType, mLaunchOptions.get());
|
SandboxLaunchPrepare(mProcessType, mLaunchOptions.get());
|
||||||
|
|
@ -755,9 +753,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
|
||||||
// always populated (but possibly with an empty value) for a GPU child process.
|
// always populated (but possibly with an empty value) for a GPU child process.
|
||||||
if (mProcessType == GeckoProcessType_GPU) {
|
if (mProcessType == GeckoProcessType_GPU) {
|
||||||
nsCOMPtr<nsIFile> file;
|
nsCOMPtr<nsIFile> file;
|
||||||
# ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::GetChildProcessTmpDir(getter_AddRefs(file));
|
CrashReporter::GetChildProcessTmpDir(getter_AddRefs(file));
|
||||||
# endif // MOZ_CRASHREPORTER
|
|
||||||
nsAutoCString path;
|
nsAutoCString path;
|
||||||
if (file) {
|
if (file) {
|
||||||
file->GetNativePath(path);
|
file->GetNativePath(path);
|
||||||
|
|
@ -767,26 +763,27 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
|
||||||
|
|
||||||
childArgv.push_back(pidstring);
|
childArgv.push_back(pidstring);
|
||||||
|
|
||||||
# if defined(MOZ_CRASHREPORTER)
|
if (!CrashReporter::IsDummy()) {
|
||||||
#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||||
int childCrashFd, childCrashRemapFd;
|
int childCrashFd, childCrashRemapFd;
|
||||||
if (!CrashReporter::CreateNotificationPipeForChild(
|
if (!CrashReporter::CreateNotificationPipeForChild(&childCrashFd,
|
||||||
&childCrashFd, &childCrashRemapFd))
|
&childCrashRemapFd)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (0 <= childCrashFd) {
|
if (0 <= childCrashFd) {
|
||||||
mLaunchOptions->fds_to_remap
|
mLaunchOptions->fds_to_remap
|
||||||
.push_back(std::pair<int,int>(childCrashFd, childCrashRemapFd));
|
.push_back(std::pair<int,int>(childCrashFd, childCrashRemapFd));
|
||||||
// "true" == crash reporting enabled
|
// "true" == crash reporting enabled
|
||||||
childArgv.push_back("true");
|
childArgv.push_back("true");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// "false" == crash reporting disabled
|
// "false" == crash reporting disabled
|
||||||
childArgv.push_back("false");
|
childArgv.push_back("false");
|
||||||
}
|
}
|
||||||
#elif defined(MOZ_WIDGET_COCOA) // defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
#elif defined(MOZ_WIDGET_COCOA) // defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||||
childArgv.push_back(CrashReporter::GetChildNotificationPipe());
|
childArgv.push_back(CrashReporter::GetChildNotificationPipe());
|
||||||
#endif // defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
#endif // defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||||
# endif // defined(MOZ_CRASHREPORTER)
|
}
|
||||||
|
|
||||||
# ifdef MOZ_WIDGET_COCOA
|
# ifdef MOZ_WIDGET_COCOA
|
||||||
// Add a mach port to the command line so the child can communicate its
|
// Add a mach port to the command line so the child can communicate its
|
||||||
|
|
@ -1000,9 +997,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
|
||||||
// always populated (but possibly with an empty value) for a GPU child process.
|
// always populated (but possibly with an empty value) for a GPU child process.
|
||||||
if (mProcessType == GeckoProcessType_GPU) {
|
if (mProcessType == GeckoProcessType_GPU) {
|
||||||
nsCOMPtr<nsIFile> file;
|
nsCOMPtr<nsIFile> file;
|
||||||
# ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::GetChildProcessTmpDir(getter_AddRefs(file));
|
CrashReporter::GetChildProcessTmpDir(getter_AddRefs(file));
|
||||||
# endif // MOZ_CRASHREPORTER
|
|
||||||
nsString path;
|
nsString path;
|
||||||
if (file) {
|
if (file) {
|
||||||
MOZ_ALWAYS_SUCCEEDS(file->GetPath(path));
|
MOZ_ALWAYS_SUCCEEDS(file->GetPath(path));
|
||||||
|
|
@ -1014,10 +1009,8 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
|
||||||
// Process id
|
// Process id
|
||||||
cmdLine.AppendLooseValue(UTF8ToWide(pidstring));
|
cmdLine.AppendLooseValue(UTF8ToWide(pidstring));
|
||||||
|
|
||||||
# if defined(MOZ_CRASHREPORTER)
|
|
||||||
cmdLine.AppendLooseValue(
|
cmdLine.AppendLooseValue(
|
||||||
UTF8ToWide(CrashReporter::GetChildNotificationPipe()));
|
UTF8ToWide(CrashReporter::GetChildNotificationPipe()));
|
||||||
# endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
|
|
||||||
// Process type
|
// Process type
|
||||||
cmdLine.AppendLooseValue(UTF8ToWide(childProcessType));
|
cmdLine.AppendLooseValue(UTF8ToWide(childProcessType));
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "nsID.h"
|
#include "nsID.h"
|
||||||
#include "nsIWidget.h"
|
#include "nsIWidget.h"
|
||||||
#include "nsMemory.h"
|
#include "nsMemory.h"
|
||||||
|
|
@ -127,16 +125,12 @@ struct EnumSerializer {
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
|
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
|
||||||
uintParamType value;
|
uintParamType value;
|
||||||
if (!ReadParam(aMsg, aIter, &value)) {
|
if (!ReadParam(aMsg, aIter, &value)) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCReadErrorReason"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCReadErrorReason"),
|
||||||
NS_LITERAL_CSTRING("Bad iter"));
|
NS_LITERAL_CSTRING("Bad iter"));
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
} else if (!EnumValidator::IsLegalValue(paramType(value))) {
|
} else if (!EnumValidator::IsLegalValue(paramType(value))) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCReadErrorReason"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCReadErrorReason"),
|
||||||
NS_LITERAL_CSTRING("Illegal value"));
|
NS_LITERAL_CSTRING("Illegal value"));
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*aResult = paramType(value);
|
*aResult = paramType(value);
|
||||||
|
|
|
||||||
|
|
@ -674,10 +674,8 @@ void
|
||||||
MessageChannel::WillDestroyCurrentMessageLoop()
|
MessageChannel::WillDestroyCurrentMessageLoop()
|
||||||
{
|
{
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProtocolName"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProtocolName"),
|
||||||
nsDependentCString(mName));
|
nsDependentCString(mName));
|
||||||
#endif
|
|
||||||
MOZ_CRASH("MessageLoop destroyed before MessageChannel that's bound to it");
|
MOZ_CRASH("MessageLoop destroyed before MessageChannel that's bound to it");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -701,10 +699,8 @@ MessageChannel::Clear()
|
||||||
|
|
||||||
#if !defined(ANDROID)
|
#if !defined(ANDROID)
|
||||||
if (!Unsound_IsClosed()) {
|
if (!Unsound_IsClosed()) {
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProtocolName"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProtocolName"),
|
||||||
nsDependentCString(mName));
|
nsDependentCString(mName));
|
||||||
#endif
|
|
||||||
MOZ_CRASH("MessageChannel destroyed without being closed");
|
MOZ_CRASH("MessageChannel destroyed without being closed");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@
|
||||||
#include "mozilla/Assertions.h"
|
#include "mozilla/Assertions.h"
|
||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "nsISupportsImpl.h"
|
#include "nsISupportsImpl.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
@ -161,10 +159,8 @@ void
|
||||||
ProcessLink::SendMessage(Message *msg)
|
ProcessLink::SendMessage(Message *msg)
|
||||||
{
|
{
|
||||||
if (msg->size() > IPC::Channel::kMaximumMessageSize) {
|
if (msg->size() > IPC::Channel::kMaximumMessageSize) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCMessageName"), nsDependentCString(msg->name()));
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCMessageName"), nsDependentCString(msg->name()));
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCMessageSize"), nsPrintfCString("%d", msg->size()));
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCMessageSize"), nsPrintfCString("%d", msg->size()));
|
||||||
#endif
|
|
||||||
MOZ_CRASH("IPC message size is too large");
|
MOZ_CRASH("IPC message size is too large");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#include "mozilla/sandboxTarget.h"
|
#include "mozilla/sandboxTarget.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER) && defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
#include "aclapi.h"
|
#include "aclapi.h"
|
||||||
#include "sddl.h"
|
#include "sddl.h"
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ using base::ProcessId;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER) && defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
// Generate RAII classes for LPTSTR and PSECURITY_DESCRIPTOR.
|
// Generate RAII classes for LPTSTR and PSECURITY_DESCRIPTOR.
|
||||||
MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedLPTStr, \
|
MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedLPTStr, \
|
||||||
RemovePointer<LPTSTR>::Type, \
|
RemovePointer<LPTSTR>::Type, \
|
||||||
|
|
@ -209,11 +209,9 @@ bool DuplicateHandle(HANDLE aSourceHandle,
|
||||||
FALSE,
|
FALSE,
|
||||||
aTargetProcessId));
|
aTargetProcessId));
|
||||||
if (!targetProcess) {
|
if (!targetProcess) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("IPCTransportFailureReason"),
|
NS_LITERAL_CSTRING("IPCTransportFailureReason"),
|
||||||
NS_LITERAL_CSTRING("Failed to open target process."));
|
NS_LITERAL_CSTRING("Failed to open target process."));
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,7 +221,6 @@ bool DuplicateHandle(HANDLE aSourceHandle,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void
|
void
|
||||||
AnnotateSystemError()
|
AnnotateSystemError()
|
||||||
{
|
{
|
||||||
|
|
@ -239,9 +236,8 @@ AnnotateSystemError()
|
||||||
nsPrintfCString("%" PRId64, error));
|
nsPrintfCString("%" PRId64, error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER) && defined(XP_MACOSX)
|
#if defined(XP_MACOSX)
|
||||||
void
|
void
|
||||||
AnnotateCrashReportWithErrno(const char* tag, int error)
|
AnnotateCrashReportWithErrno(const char* tag, int error)
|
||||||
{
|
{
|
||||||
|
|
@ -288,7 +284,6 @@ FatalError(const char* aProtocolName, const char* aMsg, bool aIsParent)
|
||||||
formattedMessage.AppendLiteral("]: \"");
|
formattedMessage.AppendLiteral("]: \"");
|
||||||
formattedMessage.AppendASCII(aMsg);
|
formattedMessage.AppendASCII(aMsg);
|
||||||
if (aIsParent) {
|
if (aIsParent) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// We're going to crash the parent process because at this time
|
// We're going to crash the parent process because at this time
|
||||||
// there's no other really nice way of getting a minidump out of
|
// there's no other really nice way of getting a minidump out of
|
||||||
// this process if we're off the main thread.
|
// this process if we're off the main thread.
|
||||||
|
|
@ -299,7 +294,6 @@ FatalError(const char* aProtocolName, const char* aMsg, bool aIsParent)
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCFatalErrorMsg"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCFatalErrorMsg"),
|
||||||
nsDependentCString(aMsg));
|
nsDependentCString(aMsg));
|
||||||
AnnotateSystemError();
|
AnnotateSystemError();
|
||||||
#endif
|
|
||||||
MOZ_CRASH("IPC FatalError in the parent process!");
|
MOZ_CRASH("IPC FatalError in the parent process!");
|
||||||
} else {
|
} else {
|
||||||
formattedMessage.AppendLiteral("\". abort()ing as a result.");
|
formattedMessage.AppendLiteral("\". abort()ing as a result.");
|
||||||
|
|
@ -617,11 +611,7 @@ bool
|
||||||
IToplevelProtocol::TakeMinidump(nsIFile** aDump, uint32_t* aSequence)
|
IToplevelProtocol::TakeMinidump(nsIFile** aDump, uint32_t* aSequence)
|
||||||
{
|
{
|
||||||
MOZ_RELEASE_ASSERT(GetSide() == ParentSide);
|
MOZ_RELEASE_ASSERT(GetSide() == ParentSide);
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
return XRE_TakeMinidumpForChild(OtherPid(), aDump, aSequence);
|
return XRE_TakeMinidumpForChild(OtherPid(), aDump, aSequence);
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -573,11 +573,7 @@ DuplicateHandle(HANDLE aSourceHandle,
|
||||||
* Annotate the crash reporter with the error code from the most recent system
|
* Annotate the crash reporter with the error code from the most recent system
|
||||||
* call. Returns the system error.
|
* call. Returns the system error.
|
||||||
*/
|
*/
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
void AnnotateSystemError();
|
void AnnotateSystemError();
|
||||||
#else
|
|
||||||
#define AnnotateSystemError() do { } while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An endpoint represents one end of a partially initialized IPDL channel. To
|
* An endpoint represents one end of a partially initialized IPDL channel. To
|
||||||
|
|
@ -696,7 +692,7 @@ private:
|
||||||
ProcessId mMyPid, mOtherPid;
|
ProcessId mMyPid, mOtherPid;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER) && defined(XP_MACOSX)
|
#if defined(XP_MACOSX)
|
||||||
void AnnotateCrashReportWithErrno(const char* tag, int error);
|
void AnnotateCrashReportWithErrno(const char* tag, int error);
|
||||||
#else
|
#else
|
||||||
static inline void AnnotateCrashReportWithErrno(const char* tag, int error)
|
static inline void AnnotateCrashReportWithErrno(const char* tag, int error)
|
||||||
|
|
|
||||||
|
|
@ -2566,13 +2566,6 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||||
'"'+ _protocolHeaderName(self.protocol, self.side) +'.h"') ]
|
'"'+ _protocolHeaderName(self.protocol, self.side) +'.h"') ]
|
||||||
+ setToIncludes(self.externalIncludes))
|
+ setToIncludes(self.externalIncludes))
|
||||||
|
|
||||||
if self.protocol.decl.type.isToplevel():
|
|
||||||
cf.addthings([
|
|
||||||
CppDirective('ifdef', 'MOZ_CRASHREPORTER'),
|
|
||||||
CppDirective(' include', '"nsXULAppAPI.h"'),
|
|
||||||
CppDirective('endif')
|
|
||||||
])
|
|
||||||
|
|
||||||
cppheaders = [CppDirective('include', '"%s"' % filename)
|
cppheaders = [CppDirective('include', '"%s"' % filename)
|
||||||
for filename in ipdl.builtin.CppIncludes]
|
for filename in ipdl.builtin.CppIncludes]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,7 @@
|
||||||
#if defined(MOZ_CONTENT_SANDBOX)
|
#if defined(MOZ_CONTENT_SANDBOX)
|
||||||
#include "mozilla/SandboxSettings.h"
|
#include "mozilla/SandboxSettings.h"
|
||||||
#endif // defined(MOZ_CONTENT_SANDBOX)
|
#endif // defined(MOZ_CONTENT_SANDBOX)
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace mscom {
|
namespace mscom {
|
||||||
|
|
@ -212,10 +210,8 @@ struct ParamTraits<mozilla::mscom::COMPtrHolder<Interface, _IID>>
|
||||||
|
|
||||||
mozilla::mscom::ProxyStream proxyStream(_IID, buf.get(), length, &env);
|
mozilla::mscom::ProxyStream proxyStream(_IID, buf.get(), length, &env);
|
||||||
if (!proxyStream.IsValid()) {
|
if (!proxyStream.IsValid()) {
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamValid"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamValid"),
|
||||||
NS_LITERAL_CSTRING("false"));
|
NS_LITERAL_CSTRING("false"));
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,15 +22,12 @@
|
||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
#include "nsDirectoryServiceUtils.h"
|
#include "nsDirectoryServiceUtils.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
#include "nsRefPtrHashtable.h"
|
#include "nsRefPtrHashtable.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#include "nsPrintfCString.h"
|
|
||||||
|
|
||||||
#define ENSURE_HR_SUCCEEDED(hr) \
|
#define ENSURE_HR_SUCCEEDED(hr) \
|
||||||
if (FAILED((HRESULT)hr)) { \
|
if (FAILED((HRESULT)hr)) { \
|
||||||
nsPrintfCString location("ENSURE_HR_SUCCEEDED \"%s\": %u", __FILE__, __LINE__); \
|
nsPrintfCString location("ENSURE_HR_SUCCEEDED \"%s\": %u", __FILE__, __LINE__); \
|
||||||
|
|
@ -40,15 +37,6 @@
|
||||||
return hr; \
|
return hr; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define ENSURE_HR_SUCCEEDED(hr) \
|
|
||||||
if (FAILED((HRESULT)hr)) { \
|
|
||||||
return hr; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace mscom {
|
namespace mscom {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@
|
||||||
#include "mozilla/Assertions.h"
|
#include "mozilla/Assertions.h"
|
||||||
#include "mozilla/RefPtr.h"
|
#include "mozilla/RefPtr.h"
|
||||||
#include "mozilla/UniquePtr.h"
|
#include "mozilla/UniquePtr.h"
|
||||||
#if defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#if defined(ACCESSIBILITY)
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif // defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#endif // defined(ACCESSIBILITY)
|
||||||
#include "nsWindowsHelpers.h"
|
#include "nsWindowsHelpers.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ MainThreadRuntime::MainThreadRuntime()
|
||||||
, mActCtxRgn(a11y::Compatibility::GetActCtxResourceId())
|
, mActCtxRgn(a11y::Compatibility::GetActCtxResourceId())
|
||||||
#endif // defined(ACCESSIBILITY)
|
#endif // defined(ACCESSIBILITY)
|
||||||
{
|
{
|
||||||
#if defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#if defined(ACCESSIBILITY)
|
||||||
GeckoProcessType procType = XRE_GetProcessType();
|
GeckoProcessType procType = XRE_GetProcessType();
|
||||||
if (procType == GeckoProcessType_Default ||
|
if (procType == GeckoProcessType_Default ||
|
||||||
procType == GeckoProcessType_Content) {
|
procType == GeckoProcessType_Content) {
|
||||||
|
|
@ -65,7 +65,7 @@ MainThreadRuntime::MainThreadRuntime()
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AssemblyManifestCtx"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AssemblyManifestCtx"),
|
||||||
strActCtx);
|
strActCtx);
|
||||||
}
|
}
|
||||||
#endif // defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#endif // defined(ACCESSIBILITY)
|
||||||
|
|
||||||
// We must be the outermost COM initialization on this thread. The COM runtime
|
// We must be the outermost COM initialization on this thread. The COM runtime
|
||||||
// cannot be configured once we start manipulating objects
|
// cannot be configured once we start manipulating objects
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,20 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/Move.h"
|
#include "mozilla/Move.h"
|
||||||
#if defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#if defined(ACCESSIBILITY)
|
||||||
#include "HandlerData.h"
|
#include "HandlerData.h"
|
||||||
#include "mozilla/a11y/Platform.h"
|
#include "mozilla/a11y/Platform.h"
|
||||||
#include "mozilla/mscom/ActivationContext.h"
|
#include "mozilla/mscom/ActivationContext.h"
|
||||||
#endif // defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#endif // defined(ACCESSIBILITY)
|
||||||
#include "mozilla/mscom/EnsureMTA.h"
|
#include "mozilla/mscom/EnsureMTA.h"
|
||||||
#include "mozilla/mscom/ProxyStream.h"
|
#include "mozilla/mscom/ProxyStream.h"
|
||||||
#include "mozilla/mscom/Utils.h"
|
#include "mozilla/mscom/Utils.h"
|
||||||
#include "mozilla/ScopeExit.h"
|
#include "mozilla/ScopeExit.h"
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
#include "mozilla/mscom/Objref.h"
|
#include "mozilla/mscom/Objref.h"
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "RegistrationAnnotator.h"
|
#include "RegistrationAnnotator.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <objbase.h>
|
#include <objbase.h>
|
||||||
|
|
@ -46,15 +44,11 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
, mBufSize(aInitBufSize)
|
, mBufSize(aInitBufSize)
|
||||||
, mPreserveStream(false)
|
, mPreserveStream(false)
|
||||||
{
|
{
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
NS_NAMED_LITERAL_CSTRING(kCrashReportKey, "ProxyStreamUnmarshalStatus");
|
NS_NAMED_LITERAL_CSTRING(kCrashReportKey, "ProxyStreamUnmarshalStatus");
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!aInitBufSize) {
|
if (!aInitBufSize) {
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(kCrashReportKey,
|
CrashReporter::AnnotateCrashReport(kCrashReportKey,
|
||||||
NS_LITERAL_CSTRING("!aInitBufSize"));
|
NS_LITERAL_CSTRING("!aInitBufSize"));
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
// We marshaled a nullptr. Nothing else to do here.
|
// We marshaled a nullptr. Nothing else to do here.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -62,10 +56,8 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
HRESULT createStreamResult = CreateStream(aInitBuf, aInitBufSize,
|
HRESULT createStreamResult = CreateStream(aInitBuf, aInitBufSize,
|
||||||
getter_AddRefs(mStream));
|
getter_AddRefs(mStream));
|
||||||
if (FAILED(createStreamResult)) {
|
if (FAILED(createStreamResult)) {
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
nsPrintfCString hrAsStr("0x%08X", createStreamResult);
|
nsPrintfCString hrAsStr("0x%08X", createStreamResult);
|
||||||
CrashReporter::AnnotateCrashReport(kCrashReportKey, hrAsStr);
|
CrashReporter::AnnotateCrashReport(kCrashReportKey, hrAsStr);
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,18 +66,16 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
// in that case, even though marshaling a nullptr is allowable.
|
// in that case, even though marshaling a nullptr is allowable.
|
||||||
MOZ_ASSERT(mStream);
|
MOZ_ASSERT(mStream);
|
||||||
if (!mStream) {
|
if (!mStream) {
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(kCrashReportKey,
|
CrashReporter::AnnotateCrashReport(kCrashReportKey,
|
||||||
NS_LITERAL_CSTRING("!mStream"));
|
NS_LITERAL_CSTRING("!mStream"));
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#if defined(ACCESSIBILITY)
|
||||||
const uint32_t expectedStreamLen = GetOBJREFSize(WrapNotNull(mStream));
|
const uint32_t expectedStreamLen = GetOBJREFSize(WrapNotNull(mStream));
|
||||||
nsAutoCString strActCtx;
|
nsAutoCString strActCtx;
|
||||||
nsAutoString manifestPath;
|
nsAutoString manifestPath;
|
||||||
#endif // defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#endif // defined(ACCESSIBILITY)
|
||||||
|
|
||||||
HRESULT unmarshalResult = S_OK;
|
HRESULT unmarshalResult = S_OK;
|
||||||
|
|
||||||
|
|
@ -93,11 +83,11 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
// correctness with IPDL. We'll request an IUnknown and then QI the
|
// correctness with IPDL. We'll request an IUnknown and then QI the
|
||||||
// actual interface later.
|
// actual interface later.
|
||||||
|
|
||||||
#if defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#if defined(ACCESSIBILITY)
|
||||||
auto marshalFn = [this, &strActCtx, &manifestPath, &unmarshalResult, &aIID, aEnv]() -> void
|
auto marshalFn = [this, &strActCtx, &manifestPath, &unmarshalResult, &aIID, aEnv]() -> void
|
||||||
#else
|
#else
|
||||||
auto marshalFn = [this, &unmarshalResult, &aIID, aEnv]() -> void
|
auto marshalFn = [this, &unmarshalResult, &aIID, aEnv]() -> void
|
||||||
#endif // defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#endif // defined(ACCESSIBILITY)
|
||||||
{
|
{
|
||||||
if (aEnv) {
|
if (aEnv) {
|
||||||
bool pushOk = aEnv->Push();
|
bool pushOk = aEnv->Push();
|
||||||
|
|
@ -116,7 +106,7 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
MOZ_DIAGNOSTIC_ASSERT(popOk);
|
MOZ_DIAGNOSTIC_ASSERT(popOk);
|
||||||
});
|
});
|
||||||
|
|
||||||
#if defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#if defined(ACCESSIBILITY)
|
||||||
auto curActCtx = ActivationContext::GetCurrent();
|
auto curActCtx = ActivationContext::GetCurrent();
|
||||||
if (curActCtx.isOk()) {
|
if (curActCtx.isOk()) {
|
||||||
strActCtx.AppendPrintf("0x%p", curActCtx.unwrap());
|
strActCtx.AppendPrintf("0x%p", curActCtx.unwrap());
|
||||||
|
|
@ -125,7 +115,7 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
ActivationContext::GetCurrentManifestPath(manifestPath);
|
ActivationContext::GetCurrentManifestPath(manifestPath);
|
||||||
#endif // defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#endif // defined(ACCESSIBILITY)
|
||||||
|
|
||||||
unmarshalResult =
|
unmarshalResult =
|
||||||
::CoUnmarshalInterface(mStream, aIID, getter_AddRefs(mUnmarshaledProxy));
|
::CoUnmarshalInterface(mStream, aIID, getter_AddRefs(mUnmarshaledProxy));
|
||||||
|
|
@ -143,7 +133,6 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
|
|
||||||
mStream = nullptr;
|
mStream = nullptr;
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
if (FAILED(unmarshalResult) || !mUnmarshaledProxy) {
|
if (FAILED(unmarshalResult) || !mUnmarshaledProxy) {
|
||||||
nsPrintfCString hrAsStr("0x%08X", unmarshalResult);
|
nsPrintfCString hrAsStr("0x%08X", unmarshalResult);
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
|
|
@ -176,7 +165,6 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
|
||||||
actualStreamLen);
|
actualStreamLen);
|
||||||
#endif // defined(ACCESSIBILITY)
|
#endif // defined(ACCESSIBILITY)
|
||||||
}
|
}
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyStream::ProxyStream(ProxyStream&& aOther)
|
ProxyStream::ProxyStream(ProxyStream&& aOther)
|
||||||
|
|
@ -308,17 +296,11 @@ ProxyStream::ProxyStream(REFIID aIID, IUnknown* aObject, Environment* aEnv,
|
||||||
HRESULT statResult = S_OK;
|
HRESULT statResult = S_OK;
|
||||||
HRESULT getHGlobalResult = S_OK;
|
HRESULT getHGlobalResult = S_OK;
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
nsAutoString manifestPath;
|
nsAutoString manifestPath;
|
||||||
|
|
||||||
auto marshalFn = [this, &aIID, aObject, mshlFlags, &stream, &streamSize,
|
auto marshalFn = [this, &aIID, aObject, mshlFlags, &stream, &streamSize,
|
||||||
&hglobal, &createStreamResult, &marshalResult, &statResult,
|
&hglobal, &createStreamResult, &marshalResult, &statResult,
|
||||||
&getHGlobalResult, aEnv, &manifestPath]() -> void
|
&getHGlobalResult, aEnv, &manifestPath]() -> void
|
||||||
#else
|
|
||||||
auto marshalFn = [this, &aIID, aObject, mshlFlags, &stream, &streamSize,
|
|
||||||
&hglobal, &createStreamResult, &marshalResult, &statResult,
|
|
||||||
&getHGlobalResult, aEnv]() -> void
|
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
{
|
{
|
||||||
if (aEnv) {
|
if (aEnv) {
|
||||||
bool pushOk = aEnv->Push();
|
bool pushOk = aEnv->Push();
|
||||||
|
|
@ -343,9 +325,9 @@ ProxyStream::ProxyStream(REFIID aIID, IUnknown* aObject, Environment* aEnv,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ACCESSIBILITY) && defined(MOZ_CRASHREPORTER)
|
#if defined(ACCESSIBILITY)
|
||||||
ActivationContext::GetCurrentManifestPath(manifestPath);
|
ActivationContext::GetCurrentManifestPath(manifestPath);
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
#endif // defined(ACCESSIBILITY)
|
||||||
|
|
||||||
marshalResult = ::CoMarshalInterface(stream, aIID, aObject, MSHCTX_LOCAL,
|
marshalResult = ::CoMarshalInterface(stream, aIID, aObject, MSHCTX_LOCAL,
|
||||||
nullptr, mshlFlags);
|
nullptr, mshlFlags);
|
||||||
|
|
@ -375,7 +357,6 @@ ProxyStream::ProxyStream(REFIID aIID, IUnknown* aObject, Environment* aEnv,
|
||||||
EnsureMTA mta(marshalFn);
|
EnsureMTA mta(marshalFn);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
if (FAILED(createStreamResult)) {
|
if (FAILED(createStreamResult)) {
|
||||||
nsPrintfCString hrAsStr("0x%08X", createStreamResult);
|
nsPrintfCString hrAsStr("0x%08X", createStreamResult);
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
|
|
@ -405,15 +386,12 @@ ProxyStream::ProxyStream(REFIID aIID, IUnknown* aObject, Environment* aEnv,
|
||||||
NS_LITERAL_CSTRING("GetHGlobalFromStreamFailure"),
|
NS_LITERAL_CSTRING("GetHGlobalFromStreamFailure"),
|
||||||
hrAsStr);
|
hrAsStr);
|
||||||
}
|
}
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
|
|
||||||
mStream = mozilla::Move(stream);
|
mStream = mozilla::Move(stream);
|
||||||
|
|
||||||
if (streamSize) {
|
if (streamSize) {
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamSizeFrom"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamSizeFrom"),
|
||||||
NS_LITERAL_CSTRING("IStream::Stat"));
|
NS_LITERAL_CSTRING("IStream::Stat"));
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
mBufSize = streamSize;
|
mBufSize = streamSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -428,20 +406,16 @@ ProxyStream::ProxyStream(REFIID aIID, IUnknown* aObject, Environment* aEnv,
|
||||||
// the size of the memory block allocated by the HGLOBAL, though it might
|
// the size of the memory block allocated by the HGLOBAL, though it might
|
||||||
// be larger than the actual stream size.
|
// be larger than the actual stream size.
|
||||||
if (!streamSize) {
|
if (!streamSize) {
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamSizeFrom"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamSizeFrom"),
|
||||||
NS_LITERAL_CSTRING("GlobalSize"));
|
NS_LITERAL_CSTRING("GlobalSize"));
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
mBufSize = static_cast<int>(::GlobalSize(hglobal));
|
mBufSize = static_cast<int>(::GlobalSize(hglobal));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
nsAutoCString strBufSize;
|
nsAutoCString strBufSize;
|
||||||
strBufSize.AppendInt(mBufSize);
|
strBufSize.AppendInt(mBufSize);
|
||||||
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamSize"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProxyStreamSize"),
|
||||||
strBufSize);
|
strBufSize);
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mscom
|
} // namespace mscom
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,6 @@
|
||||||
#ifndef mozilla_mscom_RegistrationAnnotator_h
|
#ifndef mozilla_mscom_RegistrationAnnotator_h
|
||||||
#define mozilla_mscom_RegistrationAnnotator_h
|
#define mozilla_mscom_RegistrationAnnotator_h
|
||||||
|
|
||||||
#if !defined(MOZ_CRASHREPORTER)
|
|
||||||
#error "This header requires crash reporting to be enabled"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace mscom {
|
namespace mscom {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,8 @@ UNIFIED_SOURCES += [
|
||||||
'Objref.cpp',
|
'Objref.cpp',
|
||||||
'PassthruProxy.cpp',
|
'PassthruProxy.cpp',
|
||||||
'ProxyStream.cpp',
|
'ProxyStream.cpp',
|
||||||
'Utils.cpp',
|
|
||||||
]
|
|
||||||
|
|
||||||
if CONFIG['MOZ_CRASHREPORTER']:
|
|
||||||
UNIFIED_SOURCES += [
|
|
||||||
'RegistrationAnnotator.cpp',
|
'RegistrationAnnotator.cpp',
|
||||||
|
'Utils.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONFIG['ACCESSIBILITY']:
|
if CONFIG['ACCESSIBILITY']:
|
||||||
|
|
|
||||||
|
|
@ -634,6 +634,12 @@ class FullParseHandler
|
||||||
return new_<CodeNode>(PNK_FUNCTION, JSOP_LAMBDA_ARROW, pos);
|
return new_<CodeNode>(PNK_FUNCTION, JSOP_LAMBDA_ARROW, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isExpressionClosure(ParseNode* node) const {
|
||||||
|
return node->isKind(PNK_FUNCTION) &&
|
||||||
|
node->pn_funbox->isExprBody() &&
|
||||||
|
!node->pn_funbox->isArrow();
|
||||||
|
}
|
||||||
|
|
||||||
void setFunctionFormalParametersAndBody(ParseNode* pn, ParseNode* kid) {
|
void setFunctionFormalParametersAndBody(ParseNode* pn, ParseNode* kid) {
|
||||||
MOZ_ASSERT_IF(kid, kid->isKind(PNK_PARAMSBODY));
|
MOZ_ASSERT_IF(kid, kid->isKind(PNK_PARAMSBODY));
|
||||||
pn->pn_body = kid;
|
pn->pn_body = kid;
|
||||||
|
|
|
||||||
|
|
@ -1415,8 +1415,25 @@ AccessorTypeToJSOp(AccessorType atype)
|
||||||
|
|
||||||
enum FunctionSyntaxKind
|
enum FunctionSyntaxKind
|
||||||
{
|
{
|
||||||
Expression,
|
// A non-arrow function expression that is a PrimaryExpression and *also* a
|
||||||
|
// complete AssignmentExpression. For example, in
|
||||||
|
//
|
||||||
|
// var x = (function y() {});
|
||||||
|
//
|
||||||
|
// |y| is such a function expression.
|
||||||
|
AssignmentExpression,
|
||||||
|
|
||||||
|
// A non-arrow function expression that is a PrimaryExpression but *not* a
|
||||||
|
// complete AssignmentExpression. For example, in
|
||||||
|
//
|
||||||
|
// var x = (1 + function y() {});
|
||||||
|
//
|
||||||
|
// |y| is such a function expression.
|
||||||
|
PrimaryExpression,
|
||||||
|
|
||||||
|
// A named function appearing as a Statement.
|
||||||
Statement,
|
Statement,
|
||||||
|
|
||||||
Arrow,
|
Arrow,
|
||||||
Method,
|
Method,
|
||||||
ClassConstructor,
|
ClassConstructor,
|
||||||
|
|
@ -1427,6 +1444,12 @@ enum FunctionSyntaxKind
|
||||||
SetterNoExpressionClosure
|
SetterNoExpressionClosure
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
IsFunctionExpression(FunctionSyntaxKind kind)
|
||||||
|
{
|
||||||
|
return kind == AssignmentExpression || kind == PrimaryExpression;
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
IsConstructorKind(FunctionSyntaxKind kind)
|
IsConstructorKind(FunctionSyntaxKind kind)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2788,7 +2788,8 @@ ParserBase::newFunction(HandleAtom atom, FunctionSyntaxKind kind,
|
||||||
bool isGlobalSelfHostedBuiltin = false;
|
bool isGlobalSelfHostedBuiltin = false;
|
||||||
#endif
|
#endif
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case Expression:
|
case AssignmentExpression:
|
||||||
|
case PrimaryExpression:
|
||||||
flags = (generatorKind == GeneratorKind::NotGenerator &&
|
flags = (generatorKind == GeneratorKind::NotGenerator &&
|
||||||
asyncKind == FunctionAsyncKind::SyncFunction
|
asyncKind == FunctionAsyncKind::SyncFunction
|
||||||
? JSFunction::INTERPRETED_LAMBDA
|
? JSFunction::INTERPRETED_LAMBDA
|
||||||
|
|
@ -3347,9 +3348,8 @@ Parser<ParseHandler, CharT>::templateLiteral(YieldHandling yieldHandling)
|
||||||
template <class ParseHandler, typename CharT>
|
template <class ParseHandler, typename CharT>
|
||||||
typename ParseHandler::Node
|
typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::functionDefinition(Node pn, uint32_t toStringStart,
|
Parser<ParseHandler, CharT>::functionDefinition(Node pn, uint32_t toStringStart,
|
||||||
InHandling inHandling,
|
InHandling inHandling, YieldHandling yieldHandling,
|
||||||
YieldHandling yieldHandling, HandleAtom funName,
|
HandleAtom funName, FunctionSyntaxKind kind,
|
||||||
FunctionSyntaxKind kind,
|
|
||||||
GeneratorKind generatorKind,
|
GeneratorKind generatorKind,
|
||||||
FunctionAsyncKind asyncKind,
|
FunctionAsyncKind asyncKind,
|
||||||
bool tryAnnexB /* = false */)
|
bool tryAnnexB /* = false */)
|
||||||
|
|
@ -3526,9 +3526,9 @@ Parser<SyntaxParseHandler, char16_t>::trySyntaxParseInnerFunction(Node pn, Handl
|
||||||
template <class ParseHandler, typename CharT>
|
template <class ParseHandler, typename CharT>
|
||||||
bool
|
bool
|
||||||
Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox,
|
Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox,
|
||||||
uint32_t toStringStart,
|
uint32_t toStringStart, InHandling inHandling,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
||||||
FunctionSyntaxKind kind, Directives inheritedDirectives,
|
Directives inheritedDirectives,
|
||||||
Directives* newDirectives)
|
Directives* newDirectives)
|
||||||
{
|
{
|
||||||
// Note that it is possible for outerpc != this->pc, as we may be
|
// Note that it is possible for outerpc != this->pc, as we may be
|
||||||
|
|
@ -3550,12 +3550,10 @@ Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, Funct
|
||||||
template <class ParseHandler, typename CharT>
|
template <class ParseHandler, typename CharT>
|
||||||
bool
|
bool
|
||||||
Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, HandleFunction fun,
|
Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, HandleFunction fun,
|
||||||
uint32_t toStringStart,
|
uint32_t toStringStart, InHandling inHandling,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
||||||
FunctionSyntaxKind kind,
|
|
||||||
GeneratorKind generatorKind,
|
GeneratorKind generatorKind,
|
||||||
FunctionAsyncKind asyncKind,
|
FunctionAsyncKind asyncKind, bool tryAnnexB,
|
||||||
bool tryAnnexB,
|
|
||||||
Directives inheritedDirectives,
|
Directives inheritedDirectives,
|
||||||
Directives* newDirectives)
|
Directives* newDirectives)
|
||||||
{
|
{
|
||||||
|
|
@ -3725,7 +3723,7 @@ Parser<ParseHandler, CharT>::functionFormalParametersAndBody(InHandling inHandli
|
||||||
if (kind != Arrow) {
|
if (kind != Arrow) {
|
||||||
if (funbox->isGenerator() || funbox->isAsync() || kind == Method ||
|
if (funbox->isGenerator() || funbox->isAsync() || kind == Method ||
|
||||||
kind == GetterNoExpressionClosure || kind == SetterNoExpressionClosure ||
|
kind == GetterNoExpressionClosure || kind == SetterNoExpressionClosure ||
|
||||||
IsConstructorKind(kind))
|
IsConstructorKind(kind) || kind == PrimaryExpression)
|
||||||
{
|
{
|
||||||
error(JSMSG_CURLY_BEFORE_BODY);
|
error(JSMSG_CURLY_BEFORE_BODY);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -3766,15 +3764,17 @@ Parser<ParseHandler, CharT>::functionFormalParametersAndBody(InHandling inHandli
|
||||||
}
|
}
|
||||||
|
|
||||||
// Revalidate the function name when we transitioned to strict mode.
|
// Revalidate the function name when we transitioned to strict mode.
|
||||||
if ((kind == Statement || kind == Expression) && fun->explicitName()
|
if ((kind == Statement || IsFunctionExpression(kind)) &&
|
||||||
&& !inheritedStrict && pc->sc()->strict())
|
fun->explicitName() &&
|
||||||
|
!inheritedStrict &&
|
||||||
|
pc->sc()->strict())
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pc->sc()->hasExplicitUseStrict(),
|
MOZ_ASSERT(pc->sc()->hasExplicitUseStrict(),
|
||||||
"strict mode should only change when a 'use strict' directive is present");
|
"strict mode should only change when a 'use strict' directive is present");
|
||||||
|
|
||||||
PropertyName* propertyName = fun->explicitName()->asPropertyName();
|
PropertyName* propertyName = fun->explicitName()->asPropertyName();
|
||||||
YieldHandling nameYieldHandling;
|
YieldHandling nameYieldHandling;
|
||||||
if (kind == Expression) {
|
if (IsFunctionExpression(kind)) {
|
||||||
// Named lambda has binding inside it.
|
// Named lambda has binding inside it.
|
||||||
nameYieldHandling = bodyYieldHandling;
|
nameYieldHandling = bodyYieldHandling;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -3913,7 +3913,9 @@ Parser<ParseHandler, CharT>::functionStmt(uint32_t toStringStart, YieldHandling
|
||||||
|
|
||||||
template <class ParseHandler, typename CharT>
|
template <class ParseHandler, typename CharT>
|
||||||
typename ParseHandler::Node
|
typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::functionExpr(uint32_t toStringStart, InvokedPrediction invoked,
|
Parser<ParseHandler, CharT>::functionExpr(uint32_t toStringStart,
|
||||||
|
ExpressionClosure expressionClosureHandling,
|
||||||
|
InvokedPrediction invoked,
|
||||||
FunctionAsyncKind asyncKind)
|
FunctionAsyncKind asyncKind)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_FUNCTION));
|
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_FUNCTION));
|
||||||
|
|
@ -3948,7 +3950,11 @@ Parser<ParseHandler, CharT>::functionExpr(uint32_t toStringStart, InvokedPredict
|
||||||
if (invoked)
|
if (invoked)
|
||||||
pn = handler.setLikelyIIFE(pn);
|
pn = handler.setLikelyIIFE(pn);
|
||||||
|
|
||||||
return functionDefinition(pn, toStringStart, InAllowed, yieldHandling, name, Expression,
|
FunctionSyntaxKind kind = expressionClosureHandling == ExpressionClosure::Allowed
|
||||||
|
? AssignmentExpression
|
||||||
|
: PrimaryExpression;
|
||||||
|
|
||||||
|
return functionDefinition(pn, toStringStart, InAllowed, yieldHandling, name, kind,
|
||||||
generatorKind, asyncKind);
|
generatorKind, asyncKind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7093,7 +7099,8 @@ Parser<ParseHandler, CharT>::classDefinition(YieldHandling yieldHandling,
|
||||||
if (hasHeritage) {
|
if (hasHeritage) {
|
||||||
if (!tokenStream.getToken(&tt))
|
if (!tokenStream.getToken(&tt))
|
||||||
return null();
|
return null();
|
||||||
classHeritage = memberExpr(yieldHandling, TripledotProhibited, tt);
|
classHeritage = memberExpr(yieldHandling, TripledotProhibited,
|
||||||
|
ExpressionClosure::Forbidden, tt);
|
||||||
if (!classHeritage)
|
if (!classHeritage)
|
||||||
return null();
|
return null();
|
||||||
}
|
}
|
||||||
|
|
@ -7840,6 +7847,7 @@ template <class ParseHandler, typename CharT>
|
||||||
MOZ_ALWAYS_INLINE typename ParseHandler::Node
|
MOZ_ALWAYS_INLINE typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::orExpr(InHandling inHandling, YieldHandling yieldHandling,
|
Parser<ParseHandler, CharT>::orExpr(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling,
|
TripledotHandling tripledotHandling,
|
||||||
|
ExpressionClosure expressionClosureHandling,
|
||||||
PossibleError* possibleError,
|
PossibleError* possibleError,
|
||||||
InvokedPrediction invoked /* = PredictUninvoked */)
|
InvokedPrediction invoked /* = PredictUninvoked */)
|
||||||
{
|
{
|
||||||
|
|
@ -7853,10 +7861,16 @@ Parser<ParseHandler, CharT>::orExpr(InHandling inHandling, YieldHandling yieldHa
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
Node pn;
|
Node pn;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
pn = unaryExpr(yieldHandling, tripledotHandling, possibleError, invoked);
|
pn = unaryExpr(yieldHandling, tripledotHandling, expressionClosureHandling, possibleError,
|
||||||
|
invoked);
|
||||||
if (!pn)
|
if (!pn)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
if (handler.isExpressionClosure(pn))
|
||||||
|
return pn;
|
||||||
|
|
||||||
|
expressionClosureHandling = ExpressionClosure::Forbidden;
|
||||||
|
|
||||||
// If a binary operator follows, consume it and compute the
|
// If a binary operator follows, consume it and compute the
|
||||||
// corresponding operator.
|
// corresponding operator.
|
||||||
TokenKind tok;
|
TokenKind tok;
|
||||||
|
|
@ -7921,13 +7935,18 @@ template <class ParseHandler, typename CharT>
|
||||||
MOZ_ALWAYS_INLINE typename ParseHandler::Node
|
MOZ_ALWAYS_INLINE typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::condExpr(InHandling inHandling, YieldHandling yieldHandling,
|
Parser<ParseHandler, CharT>::condExpr(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling,
|
TripledotHandling tripledotHandling,
|
||||||
|
ExpressionClosure expressionClosureHandling,
|
||||||
PossibleError* possibleError,
|
PossibleError* possibleError,
|
||||||
InvokedPrediction invoked /* = PredictUninvoked */)
|
InvokedPrediction invoked /* = PredictUninvoked */)
|
||||||
{
|
{
|
||||||
Node condition = orExpr(inHandling, yieldHandling, tripledotHandling, possibleError, invoked);
|
Node condition = orExpr(inHandling, yieldHandling, tripledotHandling,
|
||||||
|
expressionClosureHandling, possibleError, invoked);
|
||||||
if (!condition)
|
if (!condition)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
if (handler.isExpressionClosure(condition))
|
||||||
|
return condition;
|
||||||
|
|
||||||
bool matched;
|
bool matched;
|
||||||
if (!tokenStream.matchToken(&matched, TOK_HOOK))
|
if (!tokenStream.matchToken(&matched, TOK_HOOK))
|
||||||
return null();
|
return null();
|
||||||
|
|
@ -8052,7 +8071,8 @@ Parser<ParseHandler, CharT>::assignExpr(InHandling inHandling, YieldHandling yie
|
||||||
|
|
||||||
isArrow = true;
|
isArrow = true;
|
||||||
} else {
|
} else {
|
||||||
lhs = condExpr(inHandling, yieldHandling, tripledotHandling, &possibleErrorInner, invoked);
|
lhs = condExpr(inHandling, yieldHandling, tripledotHandling, ExpressionClosure::Allowed,
|
||||||
|
&possibleErrorInner, invoked);
|
||||||
if (!lhs)
|
if (!lhs)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
|
@ -8096,8 +8116,8 @@ Parser<ParseHandler, CharT>::assignExpr(InHandling inHandling, YieldHandling yie
|
||||||
if (!pn)
|
if (!pn)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
return functionDefinition(pn, toStringStart, inHandling, yieldHandling, nullptr,
|
return functionDefinition(pn, toStringStart, inHandling, yieldHandling, nullptr, Arrow,
|
||||||
Arrow, GeneratorKind::NotGenerator, asyncKind);
|
GeneratorKind::NotGenerator, asyncKind);
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ALWAYS_TRUE(tokenStream.getToken(&tokenAfterLHS, TokenStream::Operand));
|
MOZ_ALWAYS_TRUE(tokenStream.getToken(&tokenAfterLHS, TokenStream::Operand));
|
||||||
|
|
@ -8247,7 +8267,7 @@ typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::unaryOpExpr(YieldHandling yieldHandling, ParseNodeKind kind,
|
Parser<ParseHandler, CharT>::unaryOpExpr(YieldHandling yieldHandling, ParseNodeKind kind,
|
||||||
uint32_t begin)
|
uint32_t begin)
|
||||||
{
|
{
|
||||||
Node kid = unaryExpr(yieldHandling, TripledotProhibited);
|
Node kid = unaryExpr(yieldHandling, TripledotProhibited, ExpressionClosure::Forbidden);
|
||||||
if (!kid)
|
if (!kid)
|
||||||
return null();
|
return null();
|
||||||
return handler.newUnary(kind, begin, kid);
|
return handler.newUnary(kind, begin, kid);
|
||||||
|
|
@ -8257,6 +8277,7 @@ template <class ParseHandler, typename CharT>
|
||||||
typename ParseHandler::Node
|
typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
|
Parser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling,
|
TripledotHandling tripledotHandling,
|
||||||
|
ExpressionClosure expressionClosureHandling,
|
||||||
PossibleError* possibleError /* = nullptr */,
|
PossibleError* possibleError /* = nullptr */,
|
||||||
InvokedPrediction invoked /* = PredictUninvoked */)
|
InvokedPrediction invoked /* = PredictUninvoked */)
|
||||||
{
|
{
|
||||||
|
|
@ -8291,7 +8312,7 @@ Parser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
|
||||||
// // Evaluates expression, triggering a runtime ReferenceError for
|
// // Evaluates expression, triggering a runtime ReferenceError for
|
||||||
// // the undefined name.
|
// // the undefined name.
|
||||||
// typeof (1, nonExistentName);
|
// typeof (1, nonExistentName);
|
||||||
Node kid = unaryExpr(yieldHandling, TripledotProhibited);
|
Node kid = unaryExpr(yieldHandling, TripledotProhibited, ExpressionClosure::Forbidden);
|
||||||
if (!kid)
|
if (!kid)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
|
@ -8306,7 +8327,8 @@ Parser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
uint32_t operandOffset = pos().begin;
|
uint32_t operandOffset = pos().begin;
|
||||||
Node operand = memberExpr(yieldHandling, TripledotProhibited, tt2);
|
Node operand =
|
||||||
|
memberExpr(yieldHandling, TripledotProhibited, ExpressionClosure::Forbidden, tt2);
|
||||||
if (!operand || !checkIncDecOperand(operand, operandOffset))
|
if (!operand || !checkIncDecOperand(operand, operandOffset))
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
|
@ -8319,7 +8341,7 @@ Parser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
|
||||||
if (!tokenStream.peekOffset(&exprOffset, TokenStream::Operand))
|
if (!tokenStream.peekOffset(&exprOffset, TokenStream::Operand))
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
Node expr = unaryExpr(yieldHandling, TripledotProhibited);
|
Node expr = unaryExpr(yieldHandling, TripledotProhibited, ExpressionClosure::Forbidden);
|
||||||
if (!expr)
|
if (!expr)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
|
@ -8337,7 +8359,8 @@ Parser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
|
||||||
|
|
||||||
case TOK_AWAIT: {
|
case TOK_AWAIT: {
|
||||||
if (pc->isAsync()) {
|
if (pc->isAsync()) {
|
||||||
Node kid = unaryExpr(yieldHandling, tripledotHandling, possibleError, invoked);
|
Node kid = unaryExpr(yieldHandling, tripledotHandling, ExpressionClosure::Forbidden,
|
||||||
|
possibleError, invoked);
|
||||||
if (!kid)
|
if (!kid)
|
||||||
return null();
|
return null();
|
||||||
pc->lastAwaitOffset = begin;
|
pc->lastAwaitOffset = begin;
|
||||||
|
|
@ -8348,11 +8371,14 @@ Parser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
|
||||||
MOZ_FALLTHROUGH;
|
MOZ_FALLTHROUGH;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
Node expr = memberExpr(yieldHandling, tripledotHandling, tt, /* allowCallSyntax = */ true,
|
Node expr = memberExpr(yieldHandling, tripledotHandling, expressionClosureHandling, tt,
|
||||||
possibleError, invoked);
|
/* allowCallSyntax = */ true, possibleError, invoked);
|
||||||
if (!expr)
|
if (!expr)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
if (handler.isExpressionClosure(expr))
|
||||||
|
return expr;
|
||||||
|
|
||||||
/* Don't look across a newline boundary for a postfix incop. */
|
/* Don't look across a newline boundary for a postfix incop. */
|
||||||
if (!tokenStream.peekTokenSameLine(&tt))
|
if (!tokenStream.peekTokenSameLine(&tt))
|
||||||
return null();
|
return null();
|
||||||
|
|
@ -8459,6 +8485,7 @@ template <class ParseHandler, typename CharT>
|
||||||
typename ParseHandler::Node
|
typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::memberExpr(YieldHandling yieldHandling,
|
Parser<ParseHandler, CharT>::memberExpr(YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling,
|
TripledotHandling tripledotHandling,
|
||||||
|
ExpressionClosure expressionClosureHandling,
|
||||||
TokenKind tt, bool allowCallSyntax /* = true */,
|
TokenKind tt, bool allowCallSyntax /* = true */,
|
||||||
PossibleError* possibleError /* = nullptr */,
|
PossibleError* possibleError /* = nullptr */,
|
||||||
InvokedPrediction invoked /* = PredictUninvoked */)
|
InvokedPrediction invoked /* = PredictUninvoked */)
|
||||||
|
|
@ -8482,7 +8509,8 @@ Parser<ParseHandler, CharT>::memberExpr(YieldHandling yieldHandling,
|
||||||
} else {
|
} else {
|
||||||
// Gotten by tryNewTarget
|
// Gotten by tryNewTarget
|
||||||
tt = tokenStream.currentToken().type;
|
tt = tokenStream.currentToken().type;
|
||||||
Node ctorExpr = memberExpr(yieldHandling, TripledotProhibited, tt,
|
Node ctorExpr = memberExpr(yieldHandling, TripledotProhibited,
|
||||||
|
ExpressionClosure::Forbidden, tt,
|
||||||
/* allowCallSyntax = */ false,
|
/* allowCallSyntax = */ false,
|
||||||
/* possibleError = */ nullptr, PredictInvoked);
|
/* possibleError = */ nullptr, PredictInvoked);
|
||||||
if (!ctorExpr)
|
if (!ctorExpr)
|
||||||
|
|
@ -8511,9 +8539,13 @@ Parser<ParseHandler, CharT>::memberExpr(YieldHandling yieldHandling,
|
||||||
if (!lhs)
|
if (!lhs)
|
||||||
return null();
|
return null();
|
||||||
} else {
|
} else {
|
||||||
lhs = primaryExpr(yieldHandling, tripledotHandling, tt, possibleError, invoked);
|
lhs = primaryExpr(yieldHandling, tripledotHandling, expressionClosureHandling, tt,
|
||||||
|
possibleError, invoked);
|
||||||
if (!lhs)
|
if (!lhs)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
if (handler.isExpressionClosure(lhs))
|
||||||
|
return lhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT_IF(handler.isSuperBase(lhs), tokenStream.isCurrentTokenType(TOK_SUPER));
|
MOZ_ASSERT_IF(handler.isSuperBase(lhs), tokenStream.isCurrentTokenType(TOK_SUPER));
|
||||||
|
|
@ -9690,7 +9722,8 @@ Parser<ParseHandler, CharT>::tryNewTarget(Node &newTarget)
|
||||||
template <class ParseHandler, typename CharT>
|
template <class ParseHandler, typename CharT>
|
||||||
typename ParseHandler::Node
|
typename ParseHandler::Node
|
||||||
Parser<ParseHandler, CharT>::primaryExpr(YieldHandling yieldHandling,
|
Parser<ParseHandler, CharT>::primaryExpr(YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling, TokenKind tt,
|
TripledotHandling tripledotHandling,
|
||||||
|
ExpressionClosure expressionClosureHandling, TokenKind tt,
|
||||||
PossibleError* possibleError,
|
PossibleError* possibleError,
|
||||||
InvokedPrediction invoked /* = PredictUninvoked */)
|
InvokedPrediction invoked /* = PredictUninvoked */)
|
||||||
{
|
{
|
||||||
|
|
@ -9700,7 +9733,8 @@ Parser<ParseHandler, CharT>::primaryExpr(YieldHandling yieldHandling,
|
||||||
|
|
||||||
switch (tt) {
|
switch (tt) {
|
||||||
case TOK_FUNCTION:
|
case TOK_FUNCTION:
|
||||||
return functionExpr(pos().begin, invoked);
|
return functionExpr(pos().begin, expressionClosureHandling, invoked,
|
||||||
|
FunctionAsyncKind::SyncFunction);
|
||||||
|
|
||||||
case TOK_CLASS:
|
case TOK_CLASS:
|
||||||
return classDefinition(yieldHandling, ClassExpression, NameRequired);
|
return classDefinition(yieldHandling, ClassExpression, NameRequired);
|
||||||
|
|
@ -9765,7 +9799,7 @@ Parser<ParseHandler, CharT>::primaryExpr(YieldHandling yieldHandling,
|
||||||
if (nextSameLine == TOK_FUNCTION) {
|
if (nextSameLine == TOK_FUNCTION) {
|
||||||
uint32_t toStringStart = pos().begin;
|
uint32_t toStringStart = pos().begin;
|
||||||
tokenStream.consumeKnownToken(TOK_FUNCTION);
|
tokenStream.consumeKnownToken(TOK_FUNCTION);
|
||||||
return functionExpr(toStringStart, PredictUninvoked,
|
return functionExpr(toStringStart, expressionClosureHandling, PredictUninvoked,
|
||||||
FunctionAsyncKind::AsyncFunction);
|
FunctionAsyncKind::AsyncFunction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,8 @@ ParseContext::VarScope::VarScope(ParserBase* parser)
|
||||||
useAsVarScope(parser->pc);
|
useAsVarScope(parser->pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class ExpressionClosure { Allowed, Forbidden };
|
||||||
|
|
||||||
template <class ParseHandler, typename CharT>
|
template <class ParseHandler, typename CharT>
|
||||||
class Parser final : public ParserBase, private JS::AutoGCRooter
|
class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
{
|
{
|
||||||
|
|
@ -557,8 +559,7 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
// Parse an inner function given an enclosing ParseContext and a
|
// Parse an inner function given an enclosing ParseContext and a
|
||||||
// FunctionBox for the inner function.
|
// FunctionBox for the inner function.
|
||||||
bool innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox, uint32_t toStringStart,
|
bool innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox, uint32_t toStringStart,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
InHandling inHandling, YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
||||||
FunctionSyntaxKind kind,
|
|
||||||
Directives inheritedDirectives, Directives* newDirectives);
|
Directives inheritedDirectives, Directives* newDirectives);
|
||||||
|
|
||||||
// Parse a function's formal parameters and its body assuming its function
|
// Parse a function's formal parameters and its body assuming its function
|
||||||
|
|
@ -593,8 +594,8 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
Node functionStmt(uint32_t toStringStart,
|
Node functionStmt(uint32_t toStringStart,
|
||||||
YieldHandling yieldHandling, DefaultHandling defaultHandling,
|
YieldHandling yieldHandling, DefaultHandling defaultHandling,
|
||||||
FunctionAsyncKind asyncKind = FunctionAsyncKind::SyncFunction);
|
FunctionAsyncKind asyncKind = FunctionAsyncKind::SyncFunction);
|
||||||
Node functionExpr(uint32_t toStringStart, InvokedPrediction invoked = PredictUninvoked,
|
Node functionExpr(uint32_t toStringStart, ExpressionClosure expressionClosureHandling,
|
||||||
FunctionAsyncKind asyncKind = FunctionAsyncKind::SyncFunction);
|
InvokedPrediction invoked, FunctionAsyncKind asyncKind);
|
||||||
|
|
||||||
Node statementList(YieldHandling yieldHandling);
|
Node statementList(YieldHandling yieldHandling);
|
||||||
Node statement(YieldHandling yieldHandling);
|
Node statement(YieldHandling yieldHandling);
|
||||||
|
|
@ -723,23 +724,24 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
Node assignExprWithoutYieldOrAwait(YieldHandling yieldHandling);
|
Node assignExprWithoutYieldOrAwait(YieldHandling yieldHandling);
|
||||||
Node yieldExpression(InHandling inHandling);
|
Node yieldExpression(InHandling inHandling);
|
||||||
Node condExpr(InHandling inHandling, YieldHandling yieldHandling,
|
Node condExpr(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling,
|
TripledotHandling tripledotHandling, ExpressionClosure expressionClosureHandling,
|
||||||
PossibleError* possibleError,
|
PossibleError* possibleError,
|
||||||
InvokedPrediction invoked = PredictUninvoked);
|
InvokedPrediction invoked = PredictUninvoked);
|
||||||
Node orExpr(InHandling inHandling, YieldHandling yieldHandling,
|
Node orExpr(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling,
|
TripledotHandling tripledotHandling, ExpressionClosure expressionClosureHandling,
|
||||||
PossibleError* possibleError,
|
PossibleError* possibleError,
|
||||||
InvokedPrediction invoked = PredictUninvoked);
|
InvokedPrediction invoked = PredictUninvoked);
|
||||||
Node unaryExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
|
Node unaryExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
|
||||||
|
ExpressionClosure expressionClosureHandling,
|
||||||
PossibleError* possibleError = nullptr,
|
PossibleError* possibleError = nullptr,
|
||||||
InvokedPrediction invoked = PredictUninvoked);
|
InvokedPrediction invoked = PredictUninvoked);
|
||||||
Node memberExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
|
Node memberExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
|
||||||
TokenKind tt, bool allowCallSyntax = true,
|
ExpressionClosure expressionClosureHandling, TokenKind tt,
|
||||||
PossibleError* possibleError = nullptr,
|
bool allowCallSyntax = true, PossibleError* possibleError = nullptr,
|
||||||
InvokedPrediction invoked = PredictUninvoked);
|
InvokedPrediction invoked = PredictUninvoked);
|
||||||
Node primaryExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
|
Node primaryExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
|
||||||
TokenKind tt, PossibleError* possibleError,
|
ExpressionClosure expressionClosureHandling, TokenKind tt,
|
||||||
InvokedPrediction invoked = PredictUninvoked);
|
PossibleError* possibleError, InvokedPrediction invoked = PredictUninvoked);
|
||||||
Node exprInParens(InHandling inHandling, YieldHandling yieldHandling,
|
Node exprInParens(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr);
|
TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr);
|
||||||
|
|
||||||
|
|
@ -754,9 +756,8 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
bool functionArguments(YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
bool functionArguments(YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
||||||
Node funcpn);
|
Node funcpn);
|
||||||
|
|
||||||
Node functionDefinition(Node func, uint32_t toStringStart,
|
Node functionDefinition(Node func, uint32_t toStringStart, InHandling inHandling,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
YieldHandling yieldHandling, HandleAtom name, FunctionSyntaxKind kind,
|
||||||
HandleAtom name, FunctionSyntaxKind kind,
|
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
||||||
bool tryAnnexB = false);
|
bool tryAnnexB = false);
|
||||||
|
|
||||||
|
|
@ -835,15 +836,13 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
bool skipLazyInnerFunction(Node pn, uint32_t toStringStart, FunctionSyntaxKind kind,
|
bool skipLazyInnerFunction(Node pn, uint32_t toStringStart, FunctionSyntaxKind kind,
|
||||||
bool tryAnnexB);
|
bool tryAnnexB);
|
||||||
bool innerFunction(Node pn, ParseContext* outerpc, HandleFunction fun, uint32_t toStringStart,
|
bool innerFunction(Node pn, ParseContext* outerpc, HandleFunction fun, uint32_t toStringStart,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
InHandling inHandling, YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
||||||
FunctionSyntaxKind kind,
|
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind, bool tryAnnexB,
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind, bool tryAnnexB,
|
||||||
Directives inheritedDirectives, Directives* newDirectives);
|
Directives inheritedDirectives, Directives* newDirectives);
|
||||||
bool trySyntaxParseInnerFunction(Node pn, HandleFunction fun, uint32_t toStringStart,
|
bool trySyntaxParseInnerFunction(Node pn, HandleFunction fun, uint32_t toStringStart,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
InHandling inHandling, YieldHandling yieldHandling,
|
||||||
FunctionSyntaxKind kind,
|
FunctionSyntaxKind kind, GeneratorKind generatorKind,
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
FunctionAsyncKind asyncKind, bool tryAnnexB,
|
||||||
bool tryAnnexB,
|
|
||||||
Directives inheritedDirectives, Directives* newDirectives);
|
Directives inheritedDirectives, Directives* newDirectives);
|
||||||
bool finishFunctionScopes(bool isStandaloneFunction);
|
bool finishFunctionScopes(bool isStandaloneFunction);
|
||||||
bool finishFunction(bool isStandaloneFunction = false);
|
bool finishFunction(bool isStandaloneFunction = false);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,16 @@ class SyntaxParseHandler
|
||||||
NodeVarDeclaration,
|
NodeVarDeclaration,
|
||||||
NodeLexicalDeclaration,
|
NodeLexicalDeclaration,
|
||||||
|
|
||||||
NodeFunctionDefinition,
|
// A non-arrow function expression with block body, from bog-standard
|
||||||
|
// ECMAScript.
|
||||||
|
NodeFunctionExpressionBlockBody,
|
||||||
|
|
||||||
|
// A non-arrow function expression with AssignmentExpression body -- a
|
||||||
|
// proprietary SpiderMonkey extension.
|
||||||
|
NodeFunctionExpressionClosure,
|
||||||
|
|
||||||
|
NodeFunctionArrow,
|
||||||
|
NodeFunctionStatement,
|
||||||
|
|
||||||
// This is needed for proper assignment-target handling. ES6 formally
|
// This is needed for proper assignment-target handling. ES6 formally
|
||||||
// requires function calls *not* pass IsValidSimpleAssignmentTarget,
|
// requires function calls *not* pass IsValidSimpleAssignmentTarget,
|
||||||
|
|
@ -119,6 +128,10 @@ class SyntaxParseHandler
|
||||||
NodeSuperBase
|
NodeSuperBase
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool isNonArrowFunctionExpression(Node node) const {
|
||||||
|
return node == NodeFunctionExpressionBlockBody || node == NodeFunctionExpressionClosure;
|
||||||
|
}
|
||||||
|
|
||||||
bool isPropertyAccess(Node node) {
|
bool isPropertyAccess(Node node) {
|
||||||
return node == NodeDottedProperty || node == NodeElement;
|
return node == NodeDottedProperty || node == NodeElement;
|
||||||
}
|
}
|
||||||
|
|
@ -319,9 +332,20 @@ class SyntaxParseHandler
|
||||||
|
|
||||||
void checkAndSetIsDirectRHSAnonFunction(Node pn) {}
|
void checkAndSetIsDirectRHSAnonFunction(Node pn) {}
|
||||||
|
|
||||||
Node newFunctionStatement(const TokenPos& pos) { return NodeFunctionDefinition; }
|
Node newFunctionStatement(const TokenPos& pos) { return NodeFunctionStatement; }
|
||||||
Node newFunctionExpression(const TokenPos& pos) { return NodeFunctionDefinition; }
|
|
||||||
Node newArrowFunction(const TokenPos& pos) { return NodeFunctionDefinition; }
|
Node newFunctionExpression(const TokenPos& pos) {
|
||||||
|
// All non-arrow function expressions are initially presumed to have
|
||||||
|
// block body. This will be overridden later *if* the function
|
||||||
|
// expression permissibly has an AssignmentExpression body.
|
||||||
|
return NodeFunctionExpressionBlockBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
Node newArrowFunction(const TokenPos& pos) { return NodeFunctionArrow; }
|
||||||
|
|
||||||
|
bool isExpressionClosure(Node node) const {
|
||||||
|
return node == NodeFunctionExpressionClosure;
|
||||||
|
}
|
||||||
|
|
||||||
void setFunctionFormalParametersAndBody(Node pn, Node kid) {}
|
void setFunctionFormalParametersAndBody(Node pn, Node kid) {}
|
||||||
void setFunctionBody(Node pn, Node kid) {}
|
void setFunctionBody(Node pn, Node kid) {}
|
||||||
|
|
@ -420,7 +444,8 @@ class SyntaxParseHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isStatementPermittedAfterReturnStatement(Node pn) {
|
bool isStatementPermittedAfterReturnStatement(Node pn) {
|
||||||
return pn == NodeFunctionDefinition || pn == NodeVarDeclaration ||
|
return pn == NodeFunctionStatement || isNonArrowFunctionExpression(pn) ||
|
||||||
|
pn == NodeVarDeclaration ||
|
||||||
pn == NodeBreak ||
|
pn == NodeBreak ||
|
||||||
pn == NodeThrow ||
|
pn == NodeThrow ||
|
||||||
pn == NodeEmptyStatement;
|
pn == NodeEmptyStatement;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
if (getBuildConfiguration().release_or_beta) {
|
if (getBuildConfiguration().release_or_beta) {
|
||||||
eval(`
|
eval(`
|
||||||
function f() {
|
function f() {
|
||||||
|
// The expression closure is deliberate here, testing the semicolon after
|
||||||
|
// one when it appears as a FunctionDeclaration from B.3.4
|
||||||
|
// FunctionDeclarations in IfStatement Statement Clauses.
|
||||||
if (0)
|
if (0)
|
||||||
function g() { x };
|
function g() x;
|
||||||
else;
|
else;
|
||||||
}
|
}
|
||||||
f();`)
|
f();`)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
// |reftest| skip-if(!xulRuntime.shell) -- needs getBuildConfiguration
|
||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
// ArrowFunctions with block bodies appearing at the end of the
|
||||||
|
// AssignmentExpression returned by SpiderMonkey-specific function expression
|
||||||
|
// closures, where subsequent token-examination must use the Operand modifier
|
||||||
|
// to avoid an assertion.
|
||||||
|
|
||||||
|
if (getBuildConfiguration().release_or_beta)
|
||||||
|
{
|
||||||
|
eval(`
|
||||||
|
var ec1 = function() 0 ? 1 : a => {};
|
||||||
|
assertEq(typeof ec1, "function");
|
||||||
|
assertEq(typeof ec1(), "function");
|
||||||
|
assertEq(ec1()(), undefined);
|
||||||
|
|
||||||
|
var ec2 = function() 0 ? 1 : a => {} // deliberately exercise ASI here
|
||||||
|
assertEq(typeof ec2, "function");
|
||||||
|
assertEq(typeof ec2(), "function");
|
||||||
|
assertEq(ec2()(), undefined);
|
||||||
|
|
||||||
|
function ec3() 0 ? 1 : a => {} // exercise ASI here
|
||||||
|
assertEq(typeof ec3(), "function");
|
||||||
|
|
||||||
|
function ec4() 0 ? 1 : a => {};
|
||||||
|
assertEq(typeof ec4(), "function");
|
||||||
|
|
||||||
|
var needle = "@";
|
||||||
|
var x = 42;
|
||||||
|
var g = { test() { assertEq(true, false, "shouldn't be called"); } };
|
||||||
|
|
||||||
|
function ec5() 0 ? 1 : a => {} // ASI
|
||||||
|
/x/g.test((needle = "x"));
|
||||||
|
assertEq(needle, "x");
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof reportCompare === "function")
|
||||||
|
reportCompare(true, true);
|
||||||
64
js/src/tests/js1_8_5/extensions/expression-closure-syntax.js
Normal file
64
js/src/tests/js1_8_5/extensions/expression-closure-syntax.js
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
// |reftest| skip-if(!xulRuntime.shell) -- needs getBuildConfiguration
|
||||||
|
// Any copyright is dedicated to the Public Domain.
|
||||||
|
// http://creativecommons.org/licenses/publicdomain/
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
var BUGNUMBER = 1416337;
|
||||||
|
var summary =
|
||||||
|
"Expression closure syntax is only permitted for functions that constitute " +
|
||||||
|
"entire AssignmentExpressions, not PrimaryExpressions that are themselves " +
|
||||||
|
"components of larger binary expressions";
|
||||||
|
|
||||||
|
print(BUGNUMBER + ": " + summary);
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* BEGIN TEST *
|
||||||
|
**************/
|
||||||
|
|
||||||
|
if (getBuildConfiguration().release_or_beta)
|
||||||
|
{
|
||||||
|
function assertThrowsSyntaxError(code)
|
||||||
|
{
|
||||||
|
function testOne(replacement)
|
||||||
|
{
|
||||||
|
var x, rv;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
rv = eval(code.replace("@@@", replacement));
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
assertEq(e instanceof SyntaxError, true,
|
||||||
|
"should have thrown a SyntaxError, instead got: " + e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
assertEq(true, false, "should have thrown, instead returned " + rv);
|
||||||
|
}
|
||||||
|
|
||||||
|
testOne("function");
|
||||||
|
testOne("async function");
|
||||||
|
}
|
||||||
|
|
||||||
|
assertThrowsSyntaxError("x = ++@@@() 1");
|
||||||
|
assertThrowsSyntaxError("x = delete @@@() 1");
|
||||||
|
assertThrowsSyntaxError("x = new @@@() 1");
|
||||||
|
assertThrowsSyntaxError("x = void @@@() 1");
|
||||||
|
assertThrowsSyntaxError("x = +@@@() 1");
|
||||||
|
assertThrowsSyntaxError("x = 1 + @@@() 1");
|
||||||
|
assertThrowsSyntaxError("x = null != @@@() 1");
|
||||||
|
assertThrowsSyntaxError("x = null != @@@() 0 ? 1 : a => {}");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {} !== null");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {}.toString");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {}['toString']");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {}``");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {}()");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {}++");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {} || 0");
|
||||||
|
assertThrowsSyntaxError("x = 0 || @@@() 0 ? 1 : a => {}");
|
||||||
|
assertThrowsSyntaxError("x = @@@() 0 ? 1 : a => {} && true");
|
||||||
|
assertThrowsSyntaxError("x = true && @@@() 0 ? 1 : a => {}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof reportCompare === "function")
|
||||||
|
reportCompare(true, true);
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
|
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIMemoryInfoDumper.h"
|
#include "nsIMemoryInfoDumper.h"
|
||||||
#include "nsIMemoryReporter.h"
|
#include "nsIMemoryReporter.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
|
|
@ -60,10 +61,6 @@
|
||||||
#include "nsIXULRuntime.h"
|
#include "nsIXULRuntime.h"
|
||||||
#include "nsJSPrincipals.h"
|
#include "nsJSPrincipals.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -752,9 +749,7 @@ XPCJSRuntime::GCSliceCallback(JSContext* cx,
|
||||||
if (!self)
|
if (!self)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
CrashReporter::SetGarbageCollecting(progress == JS::GC_CYCLE_BEGIN);
|
CrashReporter::SetGarbageCollecting(progress == JS::GC_CYCLE_BEGIN);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (self->mPrevGCSliceCallback)
|
if (self->mPrevGCSliceCallback)
|
||||||
(*self->mPrevGCSliceCallback)(cx, progress, desc);
|
(*self->mPrevGCSliceCallback)(cx, progress, desc);
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
|
@ -61,11 +62,6 @@
|
||||||
#include <unistd.h> /* for isatty() */
|
#include <unistd.h> /* for isatty() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#include "nsICrashReporter.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_TESTS
|
#ifdef ENABLE_TESTS
|
||||||
#include "xpctest_private.h"
|
#include "xpctest_private.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1193,9 +1189,8 @@ XRE_XPCShellMain(int argc, char** argv, char** envp,
|
||||||
argv += 2;
|
argv += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
const char* val = getenv("MOZ_CRASHREPORTER");
|
const char* val = getenv("MOZ_CRASHREPORTER");
|
||||||
if (val && *val) {
|
if (val && *val && !CrashReporter::IsDummy()) {
|
||||||
rv = CrashReporter::SetExceptionHandler(greDir, true);
|
rv = CrashReporter::SetExceptionHandler(greDir, true);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
printf("CrashReporter::SetExceptionHandler failed!\n");
|
printf("CrashReporter::SetExceptionHandler failed!\n");
|
||||||
|
|
@ -1203,7 +1198,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp,
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(CrashReporter::GetEnabled());
|
MOZ_ASSERT(CrashReporter::GetEnabled());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (argc > 1 && !strcmp(argv[1], "--greomni")) {
|
if (argc > 1 && !strcmp(argv[1], "--greomni")) {
|
||||||
nsCOMPtr<nsIFile> greOmni;
|
nsCOMPtr<nsIFile> greOmni;
|
||||||
|
|
@ -1395,11 +1389,10 @@ XRE_XPCShellMain(int argc, char** argv, char** envp,
|
||||||
rv = NS_ShutdownXPCOM( nullptr );
|
rv = NS_ShutdownXPCOM( nullptr );
|
||||||
MOZ_ASSERT(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
|
MOZ_ASSERT(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// Shut down the crashreporter service to prevent leaking some strings it holds.
|
// Shut down the crashreporter service to prevent leaking some strings it holds.
|
||||||
if (CrashReporter::GetEnabled())
|
if (CrashReporter::GetEnabled()) {
|
||||||
CrashReporter::UnsetExceptionHandler();
|
CrashReporter::UnsetExceptionHandler();
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#ifdef MOZ_GECKO_PROFILER
|
#ifdef MOZ_GECKO_PROFILER
|
||||||
// This must precede NS_LogTerm(), otherwise xpcshell return non-zero
|
// This must precede NS_LogTerm(), otherwise xpcshell return non-zero
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,6 @@ needs-focus == select-required-invalid.html select-required-ref.html
|
||||||
needs-focus == select-required-valid.html select-required-ref.html
|
needs-focus == select-required-valid.html select-required-ref.html
|
||||||
needs-focus == select-required-multiple-still-valid.html select-required-multiple-ref.html
|
needs-focus == select-required-multiple-still-valid.html select-required-multiple-ref.html
|
||||||
fuzzy-if(skiaContent,1,250) needs-focus == select-required-multiple-valid.html select-required-multiple-ref.html
|
fuzzy-if(skiaContent,1,250) needs-focus == select-required-multiple-valid.html select-required-multiple-ref.html
|
||||||
fuzzy-if(skiaContent&&!Android,1,3) skip-if(Android) needs-focus == select-disabled-fieldset-1.html select-fieldset-ref.html
|
fuzzy-if(skiaContent&&!Android,1,3) fuzzy-if(Android,8,1) needs-focus == select-disabled-fieldset-1.html select-fieldset-ref.html
|
||||||
fuzzy-if(skiaContent&&!Android,2,3) skip-if(Android) needs-focus == select-disabled-fieldset-2.html select-fieldset-ref.html
|
fuzzy-if(skiaContent&&!Android,2,3) fuzzy-if(Android,8,1) needs-focus == select-disabled-fieldset-2.html select-fieldset-ref.html
|
||||||
fuzzy-if(skiaContent,2,5) needs-focus == select-fieldset-legend.html select-fieldset-legend-ref.html
|
fuzzy-if(skiaContent,2,5) needs-focus == select-fieldset-legend.html select-fieldset-legend-ref.html
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "nsDOMTokenList.h"
|
#include "nsDOMTokenList.h"
|
||||||
#include "nsDeviceContext.h"
|
#include "nsDeviceContext.h"
|
||||||
#include "nsIContentInlines.h"
|
#include "nsIContentInlines.h"
|
||||||
|
#include "nsICrashReporter.h"
|
||||||
#include "nsIDOMNode.h"
|
#include "nsIDOMNode.h"
|
||||||
#include "nsIDocumentInlines.h"
|
#include "nsIDocumentInlines.h"
|
||||||
#include "nsILoadContext.h"
|
#include "nsILoadContext.h"
|
||||||
|
|
@ -75,10 +76,6 @@
|
||||||
# include "mozmemory.h"
|
# include "mozmemory.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsICrashReporter.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::css;
|
using namespace mozilla::css;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
|
|
@ -2822,11 +2819,9 @@ void
|
||||||
Gecko_AddBufferToCrashReport(const void* addr, size_t len)
|
Gecko_AddBufferToCrashReport(const void* addr, size_t len)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsCOMPtr<nsICrashReporter> cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
|
nsCOMPtr<nsICrashReporter> cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
|
||||||
NS_ENSURE_TRUE_VOID(cr);
|
NS_ENSURE_TRUE_VOID(cr);
|
||||||
cr->RegisterAppMemory((uint64_t) addr, len);
|
cr->RegisterAppMemory((uint64_t) addr, len);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2835,11 +2830,9 @@ Gecko_AnnotateCrashReport(const char* key_str, const char* value_str)
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
nsDependentCString key(key_str);
|
nsDependentCString key(key_str);
|
||||||
nsDependentCString value(value_str);
|
nsDependentCString value(value_str);
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsCOMPtr<nsICrashReporter> cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
|
nsCOMPtr<nsICrashReporter> cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
|
||||||
NS_ENSURE_TRUE_VOID(cr);
|
NS_ENSURE_TRUE_VOID(cr);
|
||||||
cr->AnnotateCrashReport(key, value);
|
cr->AnnotateCrashReport(key, value);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "mozilla/StyleSheetInlines.h"
|
#include "mozilla/StyleSheetInlines.h"
|
||||||
#include "mozilla/MemoryReporting.h"
|
#include "mozilla/MemoryReporting.h"
|
||||||
|
#include "mozilla/Omnijar.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/StyleSheet.h"
|
#include "mozilla/StyleSheet.h"
|
||||||
#include "mozilla/StyleSheetInlines.h"
|
#include "mozilla/StyleSheetInlines.h"
|
||||||
|
|
@ -16,28 +17,24 @@
|
||||||
#include "mozilla/dom/SRIMetadata.h"
|
#include "mozilla/dom/SRIMetadata.h"
|
||||||
#include "MainThreadUtils.h"
|
#include "MainThreadUtils.h"
|
||||||
#include "nsColor.h"
|
#include "nsColor.h"
|
||||||
#include "nsIConsoleService.h"
|
|
||||||
#include "nsIFile.h"
|
|
||||||
#include "nsNetUtil.h"
|
|
||||||
#include "nsIObserverService.h"
|
|
||||||
#include "nsServiceManagerUtils.h"
|
|
||||||
#include "nsIXULRuntime.h"
|
|
||||||
#include "nsPresContext.h"
|
|
||||||
#include "nsPrintfCString.h"
|
|
||||||
#include "nsXULAppAPI.h"
|
|
||||||
|
|
||||||
// Includes for the crash report annotation in ErrorLoadingSheet.
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "mozilla/Omnijar.h"
|
|
||||||
#include "nsDirectoryService.h"
|
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
|
#include "nsDirectoryService.h"
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsIChromeRegistry.h"
|
#include "nsIChromeRegistry.h"
|
||||||
|
#include "nsIConsoleService.h"
|
||||||
|
#include "nsIFile.h"
|
||||||
|
#include "nsIObserverService.h"
|
||||||
#include "nsISimpleEnumerator.h"
|
#include "nsISimpleEnumerator.h"
|
||||||
#include "nsISubstitutingProtocolHandler.h"
|
#include "nsISubstitutingProtocolHandler.h"
|
||||||
#include "zlib.h"
|
#include "nsIXULRuntime.h"
|
||||||
|
#include "nsNetUtil.h"
|
||||||
|
#include "nsPresContext.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
#include "nsXULAppAPI.h"
|
||||||
#include "nsZipArchive.h"
|
#include "nsZipArchive.h"
|
||||||
#endif
|
|
||||||
|
#include "zlib.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::css;
|
using namespace mozilla::css;
|
||||||
|
|
@ -477,7 +474,6 @@ nsLayoutStylesheetCache::LoadSheetFile(nsIFile* aFile,
|
||||||
LoadSheet(uri, aSheet, aParsingMode, aFailureAction);
|
LoadSheet(uri, aSheet, aParsingMode, aFailureAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
static inline nsresult
|
static inline nsresult
|
||||||
ComputeCRC32(nsIFile* aFile, uint32_t* aResult)
|
ComputeCRC32(nsIFile* aFile, uint32_t* aResult)
|
||||||
{
|
{
|
||||||
|
|
@ -754,7 +750,6 @@ AnnotateCrashReport(nsIURI* aURI)
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("SheetLoadFailure"),
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("SheetLoadFailure"),
|
||||||
NS_ConvertUTF16toUTF8(annotation));
|
NS_ConvertUTF16toUTF8(annotation));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ErrorLoadingSheet(nsIURI* aURI, const char* aMsg, FailureAction aFailureAction)
|
ErrorLoadingSheet(nsIURI* aURI, const char* aMsg, FailureAction aFailureAction)
|
||||||
|
|
@ -770,10 +765,7 @@ ErrorLoadingSheet(nsIURI* aURI, const char* aMsg, FailureAction aFailureAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
AnnotateCrashReport(aURI);
|
AnnotateCrashReport(aURI);
|
||||||
#endif
|
|
||||||
|
|
||||||
MOZ_CRASH_UNSAFE_OOL(errorMessage.get());
|
MOZ_CRASH_UNSAFE_OOL(errorMessage.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -800,9 +792,8 @@ nsLayoutStylesheetCache::LoadSheet(nsIURI* aURI,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsZipArchive::sFileCorruptedReason = nullptr;
|
nsZipArchive::sFileCorruptedReason = nullptr;
|
||||||
#endif
|
|
||||||
nsresult rv = loader->LoadSheetSync(aURI, aParsingMode, true, aSheet);
|
nsresult rv = loader->LoadSheetSync(aURI, aParsingMode, true, aSheet);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
ErrorLoadingSheet(aURI,
|
ErrorLoadingSheet(aURI,
|
||||||
|
|
|
||||||
|
|
@ -572,8 +572,12 @@ nsDisplayXULImage::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBui
|
||||||
mozilla::layers::WebRenderLayerManager* aManager,
|
mozilla::layers::WebRenderLayerManager* aManager,
|
||||||
nsDisplayListBuilder* aDisplayListBuilder)
|
nsDisplayListBuilder* aDisplayListBuilder)
|
||||||
{
|
{
|
||||||
ContainerLayerParameters parameter;
|
nsImageBoxFrame* imageFrame = static_cast<nsImageBoxFrame*>(mFrame);
|
||||||
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
|
if (!imageFrame->CanOptimizeToImageLayer()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!imageFrame->mImageRequest) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -585,7 +589,7 @@ nsDisplayXULImage::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBui
|
||||||
flags |= imgIContainer::FLAG_HIGH_QUALITY_SCALING;
|
flags |= imgIContainer::FLAG_HIGH_QUALITY_SCALING;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawResult result = static_cast<nsImageBoxFrame*>(mFrame)->
|
DrawResult result = imageFrame->
|
||||||
CreateWebRenderCommands(aBuilder, aResources, aSc, aManager, this, ToReferenceFrame(), flags);
|
CreateWebRenderCommands(aBuilder, aResources, aSc, aManager, this, ToReferenceFrame(), flags);
|
||||||
|
|
||||||
nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
|
nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
fails-if(Android) == textbox-multiline-noresize.xul textbox-multiline-ref.xul # reference is blank on Android (due to no native theme support?)
|
fails-if(Android) == textbox-multiline-noresize.xul textbox-multiline-ref.xul # reference is blank on Android (due to no native theme support?)
|
||||||
!= textbox-multiline-resize.xul textbox-multiline-ref.xul
|
!= textbox-multiline-resize.xul textbox-multiline-ref.xul
|
||||||
== popup-explicit-size.xul popup-explicit-size-ref.xul
|
== popup-explicit-size.xul popup-explicit-size-ref.xul
|
||||||
random-if(Android) fuzzy-if(webrender,128-128,324-540) == image-size.xul image-size-ref.xul
|
random-if(Android) fuzzy-if(webrender,128-128,168-168) == image-size.xul image-size-ref.xul
|
||||||
== image-scaling-min-height-1.xul image-scaling-min-height-1-ref.xul
|
== image-scaling-min-height-1.xul image-scaling-min-height-1-ref.xul
|
||||||
== textbox-text-transform.xul textbox-text-transform-ref.xul
|
== textbox-text-transform.xul textbox-text-transform-ref.xul
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,13 @@
|
||||||
#include "mozilla/UniquePtr.h"
|
#include "mozilla/UniquePtr.h"
|
||||||
#include "mozilla/Vector.h"
|
#include "mozilla/Vector.h"
|
||||||
#include "mozmemory.h"
|
#include "mozmemory.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
|
#include "nsICrashReporter.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsCOMPtr.h"
|
|
||||||
#include "nsICrashReporter.h"
|
|
||||||
#include "nsServiceManagerUtils.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NIGHTLY_BUILD
|
#ifdef NIGHTLY_BUILD
|
||||||
#if defined(DEBUG) && !defined(XP_WIN) && !defined(ANDROID)
|
#if defined(DEBUG) && !defined(XP_WIN) && !defined(ANDROID)
|
||||||
|
|
@ -28,13 +26,11 @@ extern unsigned int _gdb_sleep_duration;
|
||||||
#ifndef XP_DARWIN
|
#ifndef XP_DARWIN
|
||||||
static void DisableCrashReporter()
|
static void DisableCrashReporter()
|
||||||
{
|
{
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsCOMPtr<nsICrashReporter> crashreporter =
|
nsCOMPtr<nsICrashReporter> crashreporter =
|
||||||
do_GetService("@mozilla.org/toolkit/crash-reporter;1");
|
do_GetService("@mozilla.org/toolkit/crash-reporter;1");
|
||||||
if (crashreporter) {
|
if (crashreporter) {
|
||||||
crashreporter->SetEnabled(false);
|
crashreporter->SetEnabled(false);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrap ASSERT_DEATH_IF_SUPPORTED to disable the crash reporter
|
// Wrap ASSERT_DEATH_IF_SUPPORTED to disable the crash reporter
|
||||||
|
|
|
||||||
|
|
@ -1991,9 +1991,7 @@ var BrowserApp = {
|
||||||
// Crash reporter submit pref must be fetched from nsICrashReporter
|
// Crash reporter submit pref must be fetched from nsICrashReporter
|
||||||
// service.
|
// service.
|
||||||
case "datareporting.crashreporter.submitEnabled":
|
case "datareporting.crashreporter.submitEnabled":
|
||||||
let crashReporterBuilt = "nsICrashReporter" in Ci &&
|
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||||
Services.appinfo instanceof Ci.nsICrashReporter;
|
|
||||||
if (crashReporterBuilt) {
|
|
||||||
aSubject.setAsBool(Services.appinfo.submitReports);
|
aSubject.setAsBool(Services.appinfo.submitReports);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -2046,9 +2044,7 @@ var BrowserApp = {
|
||||||
|
|
||||||
// Crash reporter preference is in a service; set and return.
|
// Crash reporter preference is in a service; set and return.
|
||||||
case "datareporting.crashreporter.submitEnabled":
|
case "datareporting.crashreporter.submitEnabled":
|
||||||
let crashReporterBuilt = "nsICrashReporter" in Ci &&
|
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||||
Services.appinfo instanceof Ci.nsICrashReporter;
|
|
||||||
if (crashReporterBuilt) {
|
|
||||||
Services.appinfo.submitReports = value;
|
Services.appinfo.submitReports = value;
|
||||||
aSubject.setAsEmpty();
|
aSubject.setAsEmpty();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1239,8 +1239,7 @@ SessionStore.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateCrashReportURL: function ss_updateCrashReportURL(aWindow) {
|
_updateCrashReportURL: function ss_updateCrashReportURL(aWindow) {
|
||||||
let crashReporterBuilt = "nsICrashReporter" in Ci && Services.appinfo instanceof Ci.nsICrashReporter;
|
if (!AppConstants.MOZ_CRASHREPORTER) {
|
||||||
if (!crashReporterBuilt) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,6 @@
|
||||||
#include "plstr.h"
|
#include "plstr.h"
|
||||||
#include "prlink.h"
|
#include "prlink.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsICrashReporter.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -484,13 +480,18 @@ public:
|
||||||
mHasUserValue = false;
|
mHasUserValue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetValue(PrefType aType,
|
nsresult SetValue(PrefType aType,
|
||||||
PrefValue aValue,
|
PrefValue aValue,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags,
|
||||||
bool* aValueChanged,
|
bool* aValueChanged,
|
||||||
bool* aDirty)
|
bool* aDirty)
|
||||||
{
|
{
|
||||||
if (aFlags & kPrefSetDefault) {
|
if (aFlags & kPrefSetDefault) {
|
||||||
|
// Types must always match when setting the default value.
|
||||||
|
if (!IsType(aType)) {
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsLocked()) {
|
if (!IsLocked()) {
|
||||||
// ?? change of semantics?
|
// ?? change of semantics?
|
||||||
if (!mHasDefaultValue || !mDefaultValue.Equals(aType, aValue)) {
|
if (!mHasDefaultValue || !mDefaultValue.Equals(aType, aValue)) {
|
||||||
|
|
@ -506,6 +507,12 @@ public:
|
||||||
// Should we clear the user value?
|
// Should we clear the user value?
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// If we have a default value, types must match when setting the user
|
||||||
|
// value.
|
||||||
|
if (mHasDefaultValue && !IsType(aType)) {
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
// If new value is same as the default value and it's not a "sticky"
|
// If new value is same as the default value and it's not a "sticky"
|
||||||
// pref, then un-set the user value. Otherwise, set the user value only
|
// pref, then un-set the user value. Otherwise, set the user value only
|
||||||
// if it has changed.
|
// if it has changed.
|
||||||
|
|
@ -527,6 +534,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns false if this pref doesn't have a user value worth saving.
|
// Returns false if this pref doesn't have a user value worth saving.
|
||||||
|
|
@ -757,23 +765,24 @@ pref_SetPref(const char* aPrefName,
|
||||||
if (!pref->Name()) {
|
if (!pref->Name()) {
|
||||||
// New (zeroed) entry. Initialize it.
|
// New (zeroed) entry. Initialize it.
|
||||||
new (pref) PrefHashEntry(aPrefName, aType);
|
new (pref) PrefHashEntry(aPrefName, aType);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (pref->HasDefaultValue() && !pref->IsType(aType)) {
|
bool valueChanged = false, handleDirty = false;
|
||||||
|
nsresult rv =
|
||||||
|
pref->SetValue(aType, aValue, aFlags, &valueChanged, &handleDirty);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
NS_WARNING(
|
NS_WARNING(
|
||||||
nsPrintfCString(
|
nsPrintfCString(
|
||||||
"Ignoring attempt to overwrite value of default pref %s (type %s) with "
|
"Rejected attempt to change type of pref %s's %s value from %s to %s",
|
||||||
"the wrong type (%s)!",
|
|
||||||
aPrefName,
|
aPrefName,
|
||||||
|
(aFlags & kPrefSetDefault) ? "default" : "user",
|
||||||
PrefTypeToString(pref->Type()),
|
PrefTypeToString(pref->Type()),
|
||||||
PrefTypeToString(aType))
|
PrefTypeToString(aType))
|
||||||
.get());
|
.get());
|
||||||
|
|
||||||
return NS_ERROR_UNEXPECTED;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool valueChanged = false, handleDirty = false;
|
|
||||||
pref->SetValue(aType, aValue, aFlags, &valueChanged, &handleDirty);
|
|
||||||
|
|
||||||
if (handleDirty) {
|
if (handleDirty) {
|
||||||
Preferences::HandleDirty();
|
Preferences::HandleDirty();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,47 +17,125 @@ function run_test() {
|
||||||
let defaultBranch = ps.getDefaultBranch("");
|
let defaultBranch = ps.getDefaultBranch("");
|
||||||
let userBranch = ps.getBranch("");
|
let userBranch = ps.getBranch("");
|
||||||
|
|
||||||
//**************************************************************************//
|
// Prefs that only have a default value -- we can't change their type.
|
||||||
// Can't change the type of prefs that have default values
|
defaultBranch.setBoolPref("TypeTest.default.bool", true);
|
||||||
|
defaultBranch.setIntPref("TypeTest.default.int", 23);
|
||||||
|
defaultBranch.setCharPref("TypeTest.default.char", "hey");
|
||||||
|
|
||||||
defaultBranch.setBoolPref("TypeTest.existing.bool", true);
|
do_check_eq(userBranch.getBoolPref("TypeTest.default.bool"), true);
|
||||||
defaultBranch.setIntPref("TypeTest.existing.int", 23);
|
do_check_eq(userBranch.getIntPref("TypeTest.default.int"), 23);
|
||||||
defaultBranch.setCharPref("TypeTest.existing.char", "hey");
|
do_check_eq(userBranch.getCharPref("TypeTest.default.char"), "hey");
|
||||||
|
|
||||||
// The user branch reads back the expected default
|
// Prefs that only have a user value -- we can change their type, but only
|
||||||
do_check_eq(userBranch.getBoolPref("TypeTest.existing.bool"), true);
|
// when we set the user value.
|
||||||
do_check_eq(userBranch.getIntPref("TypeTest.existing.int"), 23);
|
userBranch.setBoolPref("TypeTest.user.bool", false);
|
||||||
do_check_eq(userBranch.getCharPref("TypeTest.existing.char"), "hey");
|
userBranch.setIntPref("TypeTest.user.int", 24);
|
||||||
|
userBranch.setCharPref("TypeTest.user.char", "hi");
|
||||||
|
|
||||||
// All the combinations of attempted type changes
|
do_check_eq(userBranch.getBoolPref("TypeTest.user.bool"), false);
|
||||||
do_check_throws(function() {
|
do_check_eq(userBranch.getIntPref("TypeTest.user.int"), 24);
|
||||||
userBranch.setCharPref("TypeTest.existing.bool", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
do_check_eq(userBranch.getCharPref("TypeTest.user.char"), "hi");
|
||||||
do_check_throws(function() {
|
|
||||||
userBranch.setIntPref("TypeTest.existing.bool", 5); }, Cr.NS_ERROR_UNEXPECTED);
|
|
||||||
do_check_throws(function() {
|
|
||||||
userBranch.setCharPref("TypeTest.existing.int", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
|
||||||
do_check_throws(function() {
|
|
||||||
userBranch.setBoolPref("TypeTest.existing.int", true); }, Cr.NS_ERROR_UNEXPECTED);
|
|
||||||
do_check_throws(function() {
|
|
||||||
userBranch.setBoolPref("TypeTest.existing.char", true); }, Cr.NS_ERROR_UNEXPECTED);
|
|
||||||
do_check_throws(function() {
|
|
||||||
userBranch.setIntPref("TypeTest.existing.char", 6); }, Cr.NS_ERROR_UNEXPECTED);
|
|
||||||
|
|
||||||
|
// Prefs that have both a default and a user value -- we can't change their
|
||||||
|
// type.
|
||||||
|
defaultBranch.setBoolPref("TypeTest.both.bool", true);
|
||||||
|
userBranch.setBoolPref("TypeTest.both.bool", false);
|
||||||
|
defaultBranch.setIntPref("TypeTest.both.int", 25);
|
||||||
|
userBranch.setIntPref("TypeTest.both.int", 26);
|
||||||
|
defaultBranch.setCharPref("TypeTest.both.char", "yo");
|
||||||
|
userBranch.setCharPref("TypeTest.both.char", "ya");
|
||||||
|
|
||||||
//**************************************************************************//
|
do_check_eq(userBranch.getBoolPref("TypeTest.both.bool"), false);
|
||||||
// Prefs that don't have default values can mutate
|
do_check_eq(userBranch.getIntPref("TypeTest.both.int"), 26);
|
||||||
let pref = "TypeTest.user";
|
do_check_eq(userBranch.getCharPref("TypeTest.both.char"), "ya");
|
||||||
userBranch.setBoolPref(pref, true);
|
|
||||||
userBranch.setCharPref(pref, "yay");
|
// We only have a default value, and we try to set a default value of a
|
||||||
do_check_eq(userBranch.getCharPref(pref), "yay");
|
// different type --> fails.
|
||||||
userBranch.setIntPref(pref, 7);
|
do_check_throws(function() {
|
||||||
do_check_eq(userBranch.getIntPref(pref), 7);
|
defaultBranch.setCharPref("TypeTest.default.bool", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
userBranch.setBoolPref(pref, false);
|
do_check_throws(function() {
|
||||||
do_check_eq(userBranch.getBoolPref(pref), false);
|
defaultBranch.setIntPref("TypeTest.default.bool", 5); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
userBranch.setIntPref(pref, 8);
|
do_check_throws(function() {
|
||||||
do_check_eq(userBranch.getIntPref(pref), 8);
|
defaultBranch.setCharPref("TypeTest.default.int", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
userBranch.setCharPref(pref, "whee");
|
do_check_throws(function() {
|
||||||
do_check_eq(userBranch.getCharPref(pref), "whee");
|
defaultBranch.setBoolPref("TypeTest.default.int", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
userBranch.setBoolPref(pref, true);
|
do_check_throws(function() {
|
||||||
do_check_eq(userBranch.getBoolPref(pref), true);
|
defaultBranch.setBoolPref("TypeTest.default.char", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setIntPref("TypeTest.default.char", 6); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
|
||||||
|
// We only have a default value, and we try to set a user value of a
|
||||||
|
// different type --> fails.
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setCharPref("TypeTest.default.bool", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setIntPref("TypeTest.default.bool", 5); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setCharPref("TypeTest.default.int", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setBoolPref("TypeTest.default.int", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setBoolPref("TypeTest.default.char", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setIntPref("TypeTest.default.char", 6); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
|
||||||
|
// We only have a user value, and we try to set a default value of a
|
||||||
|
// different type --> fails.
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setCharPref("TypeTest.user.bool", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setIntPref("TypeTest.user.bool", 5); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setCharPref("TypeTest.user.int", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setBoolPref("TypeTest.user.int", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setBoolPref("TypeTest.user.char", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setIntPref("TypeTest.user.char", 6); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
|
||||||
|
// We only have a user value, and we try to set a user value of a
|
||||||
|
// different type --> SUCCEEDS.
|
||||||
|
userBranch.setCharPref("TypeTest.user.bool", "boo");
|
||||||
|
do_check_eq(userBranch.getCharPref("TypeTest.user.bool"), "boo");
|
||||||
|
userBranch.setIntPref("TypeTest.user.bool", 5);
|
||||||
|
do_check_eq(userBranch.getIntPref("TypeTest.user.bool"), 5);
|
||||||
|
userBranch.setCharPref("TypeTest.user.int", "boo");
|
||||||
|
do_check_eq(userBranch.getCharPref("TypeTest.user.int"), "boo");
|
||||||
|
userBranch.setBoolPref("TypeTest.user.int", true);
|
||||||
|
do_check_eq(userBranch.getBoolPref("TypeTest.user.int"), true);
|
||||||
|
userBranch.setBoolPref("TypeTest.user.char", true);
|
||||||
|
do_check_eq(userBranch.getBoolPref("TypeTest.user.char"), true);
|
||||||
|
userBranch.setIntPref("TypeTest.user.char", 6);
|
||||||
|
do_check_eq(userBranch.getIntPref("TypeTest.user.char"), 6);
|
||||||
|
|
||||||
|
// We have both a default value and user value, and we try to set a default
|
||||||
|
// value of a different type --> fails.
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setCharPref("TypeTest.both.bool", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setIntPref("TypeTest.both.bool", 5); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setCharPref("TypeTest.both.int", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setBoolPref("TypeTest.both.int", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setBoolPref("TypeTest.both.char", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
defaultBranch.setIntPref("TypeTest.both.char", 6); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
|
||||||
|
// We have both a default value and user value, and we try to set a user
|
||||||
|
// value of a different type --> fails.
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setCharPref("TypeTest.both.bool", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setIntPref("TypeTest.both.bool", 5); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setCharPref("TypeTest.both.int", "boo"); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setBoolPref("TypeTest.both.int", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setBoolPref("TypeTest.both.char", true); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
|
do_check_throws(function() {
|
||||||
|
userBranch.setIntPref("TypeTest.both.char", 6); }, Cr.NS_ERROR_UNEXPECTED);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,13 @@
|
||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
|
|
||||||
#include "ipc/IPCMessageUtils.h"
|
#include "ipc/IPCMessageUtils.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
#include "nsStringGlue.h"
|
#include "nsStringGlue.h"
|
||||||
#include "prio.h"
|
#include "prio.h"
|
||||||
#include "mozilla/net/DNS.h"
|
#include "mozilla/net/DNS.h"
|
||||||
#include "TimingStruct.h"
|
#include "TimingStruct.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#include "nsPrintfCString.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace IPC {
|
namespace IPC {
|
||||||
|
|
||||||
|
|
@ -102,12 +100,11 @@ struct ParamTraits<mozilla::net::NetAddr>
|
||||||
aMsg->WriteBytes(aParam.local.path, sizeof(aParam.local.path));
|
aMsg->WriteBytes(aParam.local.path, sizeof(aParam.local.path));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
if (XRE_IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsPrintfCString msg("%d", aParam.raw.family);
|
nsPrintfCString msg("%d", aParam.raw.family);
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Unknown NetAddr socket family"), msg);
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Unknown NetAddr socket family"), msg);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
MOZ_CRASH("Unknown socket family");
|
MOZ_CRASH("Unknown socket family");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@
|
||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
#include "mozilla/dom/Exceptions.h"
|
#include "mozilla/dom/Exceptions.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "mozilla/StackWalk.h"
|
#include "mozilla/StackWalk.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
|
|
@ -106,11 +104,8 @@ static void
|
||||||
SandboxCrash(int nr, siginfo_t *info, void *void_context)
|
SandboxCrash(int nr, siginfo_t *info, void *void_context)
|
||||||
{
|
{
|
||||||
pid_t pid = getpid(), tid = syscall(__NR_gettid);
|
pid_t pid = getpid(), tid = syscall(__NR_gettid);
|
||||||
bool dumped = false;
|
bool dumped = CrashReporter::WriteMinidumpForSigInfo(nr, info, void_context);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
dumped = CrashReporter::WriteMinidumpForSigInfo(nr, info, void_context);
|
|
||||||
#endif
|
|
||||||
if (!dumped) {
|
if (!dumped) {
|
||||||
SANDBOX_LOG_ERROR("crash reporter is disabled (or failed);"
|
SANDBOX_LOG_ERROR("crash reporter is disabled (or failed);"
|
||||||
" trying stack trace:");
|
" trying stack trace:");
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
#include "nsCollationCID.h"
|
#include "nsCollationCID.h"
|
||||||
#include "nsEmbedCID.h"
|
#include "nsEmbedCID.h"
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "mozStoragePrivateHelpers.h"
|
#include "mozStoragePrivateHelpers.h"
|
||||||
#include "nsIXPConnect.h"
|
#include "nsIXPConnect.h"
|
||||||
|
|
@ -26,10 +27,6 @@
|
||||||
#include "sqlite3.h"
|
#include "sqlite3.h"
|
||||||
#include "mozilla/AutoSQLiteLifetime.h"
|
#include "mozilla/AutoSQLiteLifetime.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsExceptionHandler.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
// "windows.h" was included and it can #define lots of things we care about...
|
// "windows.h" was included and it can #define lots of things we care about...
|
||||||
#undef CompareString
|
#undef CompareString
|
||||||
|
|
@ -801,13 +798,11 @@ Service::Observe(nsISupports *, const char *aTopic, const char16_t *)
|
||||||
getConnections(connections);
|
getConnections(connections);
|
||||||
for (uint32_t i = 0, n = connections.Length(); i < n; i++) {
|
for (uint32_t i = 0, n = connections.Length(); i < n; i++) {
|
||||||
if (!connections[i]->isClosed()) {
|
if (!connections[i]->isClosed()) {
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
// getFilename is only the leaf name for the database file,
|
// getFilename is only the leaf name for the database file,
|
||||||
// so it shouldn't contain privacy-sensitive information.
|
// so it shouldn't contain privacy-sensitive information.
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
NS_LITERAL_CSTRING("StorageConnectionNotClosed"),
|
NS_LITERAL_CSTRING("StorageConnectionNotClosed"),
|
||||||
connections[i]->getFilename());
|
connections[i]->getFilename());
|
||||||
#endif
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf_stderr("Storage connection not closed: %s",
|
printf_stderr("Storage connection not closed: %s",
|
||||||
connections[i]->getFilename().get());
|
connections[i]->getFilename().get());
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@
|
||||||
#include "GTestRunner.h"
|
#include "GTestRunner.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsICrashReporter.h"
|
#include "nsICrashReporter.h"
|
||||||
#endif
|
|
||||||
#include "testing/TestHarness.h"
|
#include "testing/TestHarness.h"
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
|
|
@ -91,7 +89,6 @@ int RunGTestFunc(int* argc, char** argv)
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
mozilla::ipc::windows::InitUIThread();
|
mozilla::ipc::windows::InitUIThread();
|
||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
nsCOMPtr<nsICrashReporter> crashreporter;
|
nsCOMPtr<nsICrashReporter> crashreporter;
|
||||||
char *crashreporterStr = PR_GetEnv("MOZ_CRASHREPORTER");
|
char *crashreporterStr = PR_GetEnv("MOZ_CRASHREPORTER");
|
||||||
if (crashreporterStr && !strcmp(crashreporterStr, "1")) {
|
if (crashreporterStr && !strcmp(crashreporterStr, "1")) {
|
||||||
|
|
@ -112,7 +109,6 @@ int RunGTestFunc(int* argc, char** argv)
|
||||||
crashreporter->SetMinidumpPath(cwd);
|
crashreporter->SetMinidumpPath(cwd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1088,7 +1088,7 @@ this.BrowserTestUtils = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let dumpID;
|
let dumpID;
|
||||||
if ('nsICrashReporter' in Ci) {
|
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||||
dumpID = subject.getPropertyAsAString('dumpID');
|
dumpID = subject.getPropertyAsAString('dumpID');
|
||||||
if (!dumpID) {
|
if (!dumpID) {
|
||||||
return reject("dumpID was not present despite crash reporting " +
|
return reject("dumpID was not present despite crash reporting " +
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,13 @@
|
||||||
|
|
||||||
SPHINX_TREES['crash-manager'] = 'docs'
|
SPHINX_TREES['crash-manager'] = 'docs'
|
||||||
|
|
||||||
|
XPIDL_MODULE = 'toolkit_crashservice'
|
||||||
|
|
||||||
|
XPIDL_SOURCES += [
|
||||||
|
'nsICrashService.idl',
|
||||||
|
]
|
||||||
|
|
||||||
|
if CONFIG['MOZ_CRASHREPORTER']:
|
||||||
EXTRA_COMPONENTS += [
|
EXTRA_COMPONENTS += [
|
||||||
'CrashService.js',
|
'CrashService.js',
|
||||||
'CrashService.manifest',
|
'CrashService.manifest',
|
||||||
|
|
@ -21,11 +28,6 @@ TESTING_JS_MODULES += [
|
||||||
|
|
||||||
XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
|
XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
|
||||||
|
|
||||||
XPIDL_MODULE = 'toolkit_crashservice'
|
|
||||||
|
|
||||||
XPIDL_SOURCES += [
|
|
||||||
'nsICrashService.idl',
|
|
||||||
]
|
|
||||||
|
|
||||||
with Files('**'):
|
with Files('**'):
|
||||||
BUG_COMPONENT = ('Toolkit', 'Crash Reporting')
|
BUG_COMPONENT = ('Toolkit', 'Crash Reporting')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ DIRS += [
|
||||||
'commandlines',
|
'commandlines',
|
||||||
'contentprefs',
|
'contentprefs',
|
||||||
'contextualidentity',
|
'contextualidentity',
|
||||||
|
'crashes',
|
||||||
'crashmonitor',
|
'crashmonitor',
|
||||||
'diskspacewatcher',
|
'diskspacewatcher',
|
||||||
'downloads',
|
'downloads',
|
||||||
|
|
@ -80,9 +81,6 @@ if CONFIG['MOZ_BUILD_APP'] != 'mobile/android':
|
||||||
if CONFIG['NS_PRINTING']:
|
if CONFIG['NS_PRINTING']:
|
||||||
DIRS += ['printing']
|
DIRS += ['printing']
|
||||||
|
|
||||||
if CONFIG['MOZ_CRASHREPORTER']:
|
|
||||||
DIRS += ['crashes']
|
|
||||||
|
|
||||||
if CONFIG['BUILD_CTYPES']:
|
if CONFIG['BUILD_CTYPES']:
|
||||||
DIRS += ['ctypes']
|
DIRS += ['ctypes']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@
|
||||||
|
|
||||||
#include "nsWidgetsCID.h"
|
#include "nsWidgetsCID.h"
|
||||||
#include "nsIComponentRegistrar.h"
|
#include "nsIComponentRegistrar.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
|
||||||
#include "nsICrashReporter.h"
|
#include "nsICrashReporter.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef TEST_NAME
|
#ifndef TEST_NAME
|
||||||
#error "Must #define TEST_NAME before including places_test_harness_tail.h"
|
#error "Must #define TEST_NAME before including places_test_harness_tail.h"
|
||||||
|
|
|
||||||
|
|
@ -1358,6 +1358,39 @@ timestamps:
|
||||||
record_in_processes:
|
record_in_processes:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
# The following section contains the service worker scalars.
|
||||||
|
sw:
|
||||||
|
synthesized_res_count:
|
||||||
|
bug_numbers:
|
||||||
|
- 1416629
|
||||||
|
description: >
|
||||||
|
The count of number of synthesize response made by service workers.
|
||||||
|
expires: "61"
|
||||||
|
kind: uint
|
||||||
|
notification_emails:
|
||||||
|
- sw-telemetry@mozilla.com
|
||||||
|
- ttung@mozilla.com
|
||||||
|
release_channel_collection: opt-out
|
||||||
|
record_in_processes:
|
||||||
|
- 'main'
|
||||||
|
- 'content'
|
||||||
|
|
||||||
|
cors_res_for_so_req_count:
|
||||||
|
bug_numbers:
|
||||||
|
- 1416629
|
||||||
|
description: >
|
||||||
|
The count of number of synthesize response made by service workers and
|
||||||
|
it's a cors type resposne for a same-origin mode request.
|
||||||
|
expires: "61"
|
||||||
|
kind: uint
|
||||||
|
notification_emails:
|
||||||
|
- sw-telemetry@mozilla.com
|
||||||
|
- ttung@mozilla.com
|
||||||
|
release_channel_collection: opt-out
|
||||||
|
record_in_processes:
|
||||||
|
- 'main'
|
||||||
|
- 'content'
|
||||||
|
|
||||||
# The following section is for probes testing the Telemetry system. They will not be
|
# The following section is for probes testing the Telemetry system. They will not be
|
||||||
# submitted in pings and are only used for testing.
|
# submitted in pings and are only used for testing.
|
||||||
telemetry.test:
|
telemetry.test:
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,7 @@
|
||||||
|
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsIPrefService.h"
|
#include "nsIPrefService.h"
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
#endif
|
|
||||||
#include "GeckoProfiler.h"
|
#include "GeckoProfiler.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
|
|
||||||
|
|
@ -165,9 +163,8 @@ RunWatchdog(void* arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown is apparently dead. Crash the process.
|
// Shutdown is apparently dead. Crash the process.
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
CrashReporter::SetMinidumpAnalysisAllThreads();
|
CrashReporter::SetMinidumpAnalysisAllThreads();
|
||||||
#endif
|
|
||||||
MOZ_CRASH("Shutdown too long, probably frozen, causing a crash.");
|
MOZ_CRASH("Shutdown too long, probably frozen, causing a crash.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -555,13 +552,11 @@ nsTerminator::UpdateTelemetry()
|
||||||
void
|
void
|
||||||
nsTerminator::UpdateCrashReport(const char* aTopic)
|
nsTerminator::UpdateCrashReport(const char* aTopic)
|
||||||
{
|
{
|
||||||
#if defined(MOZ_CRASHREPORTER)
|
|
||||||
// In case of crash, we wish to know where in shutdown we are
|
// In case of crash, we wish to know where in shutdown we are
|
||||||
nsAutoCString report(aTopic);
|
nsAutoCString report(aTopic);
|
||||||
|
|
||||||
Unused << CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ShutdownProgress"),
|
Unused << CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ShutdownProgress"),
|
||||||
report);
|
report);
|
||||||
#endif // defined(MOZ_CRASHREPORTER)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,7 @@
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
toolkit.jar:
|
toolkit.jar:
|
||||||
|
#ifdef MOZ_CRASHREPORTER
|
||||||
content/global/crashes.xhtml (content/crashes.xhtml)
|
content/global/crashes.xhtml (content/crashes.xhtml)
|
||||||
content/global/crashes.js (content/crashes.js)
|
content/global/crashes.js (content/crashes.js)
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,19 @@
|
||||||
|
|
||||||
SPHINX_TREES['crashreporter'] = 'docs'
|
SPHINX_TREES['crashreporter'] = 'docs'
|
||||||
|
|
||||||
|
EXPORTS += [
|
||||||
|
'nsExceptionHandler.h',
|
||||||
|
]
|
||||||
|
|
||||||
|
JAR_MANIFESTS += ['jar.mn']
|
||||||
|
|
||||||
|
UNIFIED_SOURCES = [
|
||||||
|
'nsExceptionHandlerUtils.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
FINAL_LIBRARY = 'xul'
|
||||||
|
|
||||||
|
if CONFIG['MOZ_CRASHREPORTER']:
|
||||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||||
DIRS += [
|
DIRS += [
|
||||||
'google-breakpad/src/common',
|
'google-breakpad/src/common',
|
||||||
|
|
@ -58,10 +71,6 @@ if CONFIG['ENABLE_TESTS']:
|
||||||
|
|
||||||
TEST_DIRS += ['test']
|
TEST_DIRS += ['test']
|
||||||
|
|
||||||
EXPORTS += [
|
|
||||||
'nsExceptionHandler.h',
|
|
||||||
]
|
|
||||||
|
|
||||||
UNIFIED_SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
'nsExceptionHandler.cpp',
|
'nsExceptionHandler.cpp',
|
||||||
'ThreadAnnotation.cpp',
|
'ThreadAnnotation.cpp',
|
||||||
|
|
@ -80,8 +89,6 @@ EXTRA_JS_MODULES += [
|
||||||
|
|
||||||
include('/ipc/chromium/chromium-config.mozbuild')
|
include('/ipc/chromium/chromium-config.mozbuild')
|
||||||
|
|
||||||
FINAL_LIBRARY = 'xul'
|
|
||||||
|
|
||||||
if CONFIG['OS_TARGET'] == 'Android':
|
if CONFIG['OS_TARGET'] == 'Android':
|
||||||
DEFINES['ANDROID_NDK_MAJOR_VERSION'] = CONFIG['ANDROID_NDK_MAJOR_VERSION']
|
DEFINES['ANDROID_NDK_MAJOR_VERSION'] = CONFIG['ANDROID_NDK_MAJOR_VERSION']
|
||||||
DEFINES['ANDROID_NDK_MINOR_VERSION'] = CONFIG['ANDROID_NDK_MINOR_VERSION']
|
DEFINES['ANDROID_NDK_MINOR_VERSION'] = CONFIG['ANDROID_NDK_MINOR_VERSION']
|
||||||
|
|
@ -96,8 +103,6 @@ if CONFIG['OS_TARGET'] == 'Android':
|
||||||
DEFINES['UNICODE'] = True
|
DEFINES['UNICODE'] = True
|
||||||
DEFINES['_UNICODE'] = True
|
DEFINES['_UNICODE'] = True
|
||||||
|
|
||||||
JAR_MANIFESTS += ['jar.mn']
|
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
'google-breakpad/src',
|
'google-breakpad/src',
|
||||||
]
|
]
|
||||||
|
|
@ -108,8 +113,13 @@ PYTHON_UNITTEST_MANIFESTS += [
|
||||||
|
|
||||||
include('/toolkit/crashreporter/crashreporter.mozbuild')
|
include('/toolkit/crashreporter/crashreporter.mozbuild')
|
||||||
|
|
||||||
with Files('**'):
|
|
||||||
BUG_COMPONENT = ('Toolkit', 'Crash Reporting')
|
|
||||||
|
|
||||||
if CONFIG['GNU_CXX']:
|
if CONFIG['GNU_CXX']:
|
||||||
CXXFLAGS += ['-Wno-shadow']
|
CXXFLAGS += ['-Wno-shadow']
|
||||||
|
else:
|
||||||
|
UNIFIED_SOURCES += [
|
||||||
|
'nsDummyExceptionHandler.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
with Files('**'):
|
||||||
|
BUG_COMPONENT = ('Toolkit', 'Crash Reporting')
|
||||||
|
|
|
||||||
425
toolkit/crashreporter/nsDummyExceptionHandler.cpp
Normal file
425
toolkit/crashreporter/nsDummyExceptionHandler.cpp
Normal file
|
|
@ -0,0 +1,425 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
#include "nsExceptionHandler.h"
|
||||||
|
#include "nsExceptionHandlerUtils.h"
|
||||||
|
|
||||||
|
namespace CrashReporter {
|
||||||
|
|
||||||
|
void
|
||||||
|
AnnotateOOMAllocationSize(size_t size)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AnnotateTexturesSize(size_t size)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AnnotatePendingIPC(size_t aNumOfPendingIPC,
|
||||||
|
uint32_t aTopPendingIPCCount,
|
||||||
|
const char* aTopPendingIPCName,
|
||||||
|
uint32_t aTopPendingIPCType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
SetExceptionHandler(nsIFile* aXREDirectory,
|
||||||
|
bool force/*=false*/)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetEnabled()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetMinidumpPath(nsAString& aPath)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
SetMinidumpPath(const nsAString& aPath)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
SetupExtraData(nsIFile* aAppDataDirectory,
|
||||||
|
const nsACString& aBuildID)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
UnsetExceptionHandler()
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
AnnotateCrashReport(const nsACString& key,
|
||||||
|
const nsACString& data)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
RemoveCrashReportAnnotation(const nsACString& key)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
SetGarbageCollecting(bool collecting)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetEventloopNestingLevel(uint32_t level)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetMinidumpAnalysisAllThreads()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
AppendAppNotesToCrashReport(const nsACString& data)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetAnnotation(const nsACString& key, nsACString& data)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
RegisterAppMemory(void* ptr, size_t length)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
UnregisterAppMemory(void* ptr)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetIncludeContextHeap(bool aValue)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetServerURL(nsACString& aServerURL)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
SetServerURL(const nsACString& aServerURL)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
SetRestartArgs(int argc, char** argv)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef XP_WIN32
|
||||||
|
nsresult
|
||||||
|
WriteMinidumpForException(EXCEPTION_POINTERS* aExceptionInfo)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XP_LINUX
|
||||||
|
bool
|
||||||
|
WriteMinidumpForSigInfo(int signo,
|
||||||
|
siginfo_t* info,
|
||||||
|
void* uc)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XP_MACOSX
|
||||||
|
nsresult
|
||||||
|
AppendObjCExceptionInfoToAppNotes(void *inException)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
GetSubmitReports(bool* aSubmitReports)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
SetSubmitReports(bool aSubmitReports)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetProfileDirectory(nsIFile* aDir)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetUserAppDataDirectory(nsIFile* aDir)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UpdateCrashEventsDir()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetCrashEventsDir(nsAString& aPath)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetMemoryReportFile(nsIFile* aFile)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
GetDefaultMemoryReportFile(nsIFile** aFile)
|
||||||
|
{
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetTelemetrySessionId(const nsACString& id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DeleteMinidumpFilesForID(const nsAString& id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetMinidumpForID(const nsAString& id, nsIFile** minidump)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetIDFromMinidump(nsIFile* minidump, nsAString& id)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetExtraFileForID(const nsAString& id,
|
||||||
|
nsIFile** extraFile)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetExtraFileForMinidump(nsIFile* minidump,
|
||||||
|
nsIFile** extraFile)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
AppendExtraData(const nsAString& id,
|
||||||
|
const AnnotationTable& data)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
AppendExtraData(nsIFile* extraFile,
|
||||||
|
const AnnotationTable& data)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
OOPInit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GetChildProcessTmpDir(nsIFile** aOutTmpDir)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||||
|
const char*
|
||||||
|
GetChildNotificationPipe()
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
||||||
|
void
|
||||||
|
InjectCrashReporterIntoProcess(DWORD processID, InjectorCrashCallback* cb)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UnregisterInjectorCallback(DWORD processID)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // MOZ_CRASHREPORTER_INJECTOR
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetLastRunCrashID(nsAString& id)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||||
|
void
|
||||||
|
InitChildProcessTmpDir(nsIFile* aDirOverride)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif // defined(XP_WIN) || defined(XP_MACOSX)
|
||||||
|
|
||||||
|
#if defined(XP_WIN)
|
||||||
|
bool
|
||||||
|
SetRemoteExceptionHandler(const nsACString& crashPipe)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(XP_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||||
|
|
||||||
|
bool
|
||||||
|
CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
SetRemoteExceptionHandler()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(XP_MACOSX)
|
||||||
|
|
||||||
|
bool
|
||||||
|
SetRemoteExceptionHandler(const nsACString& crashPipe)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif // XP_WIN
|
||||||
|
|
||||||
|
bool
|
||||||
|
TakeMinidumpForChild(uint32_t childPid, nsIFile** dump, uint32_t* aSequence)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RenameAdditionalHangMinidump(nsIFile* minidump, nsIFile* childMinidump,
|
||||||
|
const nsACString& name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadId
|
||||||
|
CurrentThreadId()
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
TakeMinidump(nsIFile** aResult, bool aMoveToPending)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CreateMinidumpsAndPair(ProcessHandle aTargetPid,
|
||||||
|
ThreadId aTargetBlamedThread,
|
||||||
|
const nsACString& aIncomingPairName,
|
||||||
|
nsIFile* aIncomingDumpToPair,
|
||||||
|
nsIFile** aMainDumpOut,
|
||||||
|
std::function<void(bool)>&& aCallback,
|
||||||
|
bool aAsync)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CreateAdditionalChildMinidump(ProcessHandle childPid,
|
||||||
|
ThreadId childBlamedThread,
|
||||||
|
nsIFile* parentMinidump,
|
||||||
|
const nsACString& name)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
UnsetRemoteExceptionHandler()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(MOZ_WIDGET_ANDROID)
|
||||||
|
void
|
||||||
|
SetNotificationPipeForChild(int childCrashFd)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AddLibraryMapping(const char* library_name,
|
||||||
|
uintptr_t start_address,
|
||||||
|
size_t mapping_length,
|
||||||
|
size_t file_offset)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// From ThreadAnnotation.cpp
|
||||||
|
|
||||||
|
void
|
||||||
|
InitThreadAnnotation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetCurrentThreadName(const char* aName)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GetFlatThreadAnnotation(const std::function<void(const char*)>& aCallback)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ShutdownThreadAnnotation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace CrashReporter
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
|
#include "nsExceptionHandlerUtils.h"
|
||||||
|
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
|
|
@ -87,7 +88,6 @@ using mozilla::InjectCrashRunnable;
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "mozilla/double-conversion.h"
|
|
||||||
#include "mozilla/IOInterposer.h"
|
#include "mozilla/IOInterposer.h"
|
||||||
#include "mozilla/mozalloc_oom.h"
|
#include "mozilla/mozalloc_oom.h"
|
||||||
#include "mozilla/WindowsDllBlocklist.h"
|
#include "mozilla/WindowsDllBlocklist.h"
|
||||||
|
|
@ -413,54 +413,6 @@ typedef std::map<uint32_t,google_breakpad::MappingList> MappingMap;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format a non-negative double to a string, without using C-library functions,
|
|
||||||
// which need to be avoided (.e.g. bug 1240160, comment 10). Leave the utility
|
|
||||||
// non-file static so that we can gtest it. Return false if we failed to
|
|
||||||
// get the formatting done correctly.
|
|
||||||
bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength)
|
|
||||||
{
|
|
||||||
// aBufferLength is the size of the buffer. Be paranoid.
|
|
||||||
aBuffer[aBufferLength-1] = '\0';
|
|
||||||
|
|
||||||
if (aValue < 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
int length, point, i;
|
|
||||||
bool sign;
|
|
||||||
bool ok = true;
|
|
||||||
double_conversion::DoubleToStringConverter::DoubleToAscii(
|
|
||||||
aValue,
|
|
||||||
double_conversion::DoubleToStringConverter::SHORTEST,
|
|
||||||
8,
|
|
||||||
aBuffer,
|
|
||||||
aBufferLength,
|
|
||||||
&sign,
|
|
||||||
&length,
|
|
||||||
&point);
|
|
||||||
|
|
||||||
// length does not account for the 0 terminator.
|
|
||||||
if (length > point && (length+1) < (aBufferLength-1)) {
|
|
||||||
// We have to insert a decimal point. Not worried about adding a leading zero
|
|
||||||
// in the < 1 (point == 0) case.
|
|
||||||
aBuffer[length+1] = '\0';
|
|
||||||
for (i=length; i>point; i-=1) {
|
|
||||||
aBuffer[i] = aBuffer[i-1];
|
|
||||||
}
|
|
||||||
aBuffer[i] = '.'; // Not worried about locales
|
|
||||||
} else if (length < point) {
|
|
||||||
// Trailing zeros scenario
|
|
||||||
for (i=length; i<point; i+=1) {
|
|
||||||
if (i >= aBufferLength-2) {
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
aBuffer[i] = '0';
|
|
||||||
}
|
|
||||||
aBuffer[i] = '\0';
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace CrashReporter {
|
namespace CrashReporter {
|
||||||
|
|
||||||
#ifdef XP_LINUX
|
#ifdef XP_LINUX
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,12 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// This header has two implementations, the real one in nsExceptionHandler.cpp
|
||||||
|
// and a dummy in nsDummyExceptionHandler.cpp. The latter is used in builds
|
||||||
|
// configured with --disable-crashreporter. If you add or remove a function
|
||||||
|
// from this header you must update both implementations otherwise you'll break
|
||||||
|
// builds that disable the crash reporter.
|
||||||
|
|
||||||
#ifndef nsExceptionHandler_h__
|
#ifndef nsExceptionHandler_h__
|
||||||
#define nsExceptionHandler_h__
|
#define nsExceptionHandler_h__
|
||||||
|
|
||||||
|
|
@ -34,6 +40,19 @@ template<class KeyClass, class DataType> class nsDataHashtable;
|
||||||
class nsCStringHashKey;
|
class nsCStringHashKey;
|
||||||
|
|
||||||
namespace CrashReporter {
|
namespace CrashReporter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the crash reporter is using the dummy implementation.
|
||||||
|
*/
|
||||||
|
static inline bool
|
||||||
|
IsDummy() {
|
||||||
|
#ifdef MOZ_CRASHREPORTER
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
nsresult SetExceptionHandler(nsIFile* aXREDirectory, bool force=false);
|
nsresult SetExceptionHandler(nsIFile* aXREDirectory, bool force=false);
|
||||||
nsresult UnsetExceptionHandler();
|
nsresult UnsetExceptionHandler();
|
||||||
|
|
||||||
|
|
@ -248,7 +267,7 @@ void UnregisterInjectorCallback(DWORD processID);
|
||||||
bool SetRemoteExceptionHandler(const nsACString& crashPipe);
|
bool SetRemoteExceptionHandler(const nsACString& crashPipe);
|
||||||
void InitChildProcessTmpDir(nsIFile* aDirOverride = nullptr);
|
void InitChildProcessTmpDir(nsIFile* aDirOverride = nullptr);
|
||||||
|
|
||||||
# elif defined(XP_LINUX)
|
# elif defined(XP_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||||
// Parent-side API for children
|
// Parent-side API for children
|
||||||
|
|
||||||
// Set the outparams for crash reporter server's fd (|childCrashFd|)
|
// Set the outparams for crash reporter server's fd (|childCrashFd|)
|
||||||
|
|
|
||||||
56
toolkit/crashreporter/nsExceptionHandlerUtils.cpp
Normal file
56
toolkit/crashreporter/nsExceptionHandlerUtils.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
#include "nsExceptionHandlerUtils.h"
|
||||||
|
|
||||||
|
#include "mozilla/double-conversion.h"
|
||||||
|
|
||||||
|
// Format a non-negative double to a string, without using C-library functions,
|
||||||
|
// which need to be avoided (.e.g. bug 1240160, comment 10). Return false if
|
||||||
|
// we failed to get the formatting done correctly.
|
||||||
|
bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength)
|
||||||
|
{
|
||||||
|
// aBufferLength is the size of the buffer. Be paranoid.
|
||||||
|
aBuffer[aBufferLength-1] = '\0';
|
||||||
|
|
||||||
|
if (aValue < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int length, point, i;
|
||||||
|
bool sign;
|
||||||
|
bool ok = true;
|
||||||
|
double_conversion::DoubleToStringConverter::DoubleToAscii(
|
||||||
|
aValue,
|
||||||
|
double_conversion::DoubleToStringConverter::SHORTEST,
|
||||||
|
8,
|
||||||
|
aBuffer,
|
||||||
|
aBufferLength,
|
||||||
|
&sign,
|
||||||
|
&length,
|
||||||
|
&point);
|
||||||
|
|
||||||
|
// length does not account for the 0 terminator.
|
||||||
|
if (length > point && (length+1) < (aBufferLength-1)) {
|
||||||
|
// We have to insert a decimal point. Not worried about adding a leading zero
|
||||||
|
// in the < 1 (point == 0) case.
|
||||||
|
aBuffer[length+1] = '\0';
|
||||||
|
for (i=length; i>point; i-=1) {
|
||||||
|
aBuffer[i] = aBuffer[i-1];
|
||||||
|
}
|
||||||
|
aBuffer[i] = '.'; // Not worried about locales
|
||||||
|
} else if (length < point) {
|
||||||
|
// Trailing zeros scenario
|
||||||
|
for (i=length; i<point; i+=1) {
|
||||||
|
if (i >= aBufferLength-2) {
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
aBuffer[i] = '0';
|
||||||
|
}
|
||||||
|
aBuffer[i] = '\0';
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
12
toolkit/crashreporter/nsExceptionHandlerUtils.h
Normal file
12
toolkit/crashreporter/nsExceptionHandlerUtils.h
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
#ifndef nsExceptionHandlerUtils_h__
|
||||||
|
#define nsExceptionHandlerUtils_h__
|
||||||
|
|
||||||
|
bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength);
|
||||||
|
|
||||||
|
#endif // nsExceptionHandlerUtils_h__
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
DIRS += [
|
DIRS += [
|
||||||
'components',
|
'components',
|
||||||
'content',
|
'content',
|
||||||
|
'crashreporter',
|
||||||
'forgetaboutsite',
|
'forgetaboutsite',
|
||||||
'locales',
|
'locales',
|
||||||
'modules',
|
'modules',
|
||||||
|
|
@ -46,9 +47,6 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
||||||
DIRS += ['system/androidproxy']
|
DIRS += ['system/androidproxy']
|
||||||
|
|
||||||
if CONFIG['MOZ_CRASHREPORTER']:
|
|
||||||
DIRS += ['crashreporter']
|
|
||||||
|
|
||||||
TEST_HARNESS_FILES.testing.mochitest.browser.toolkit.crashreporter.test.browser += [
|
TEST_HARNESS_FILES.testing.mochitest.browser.toolkit.crashreporter.test.browser += [
|
||||||
'crashreporter/test/browser/crashreport.sjs',
|
'crashreporter/test/browser/crashreport.sjs',
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -2201,8 +2201,7 @@ this.XPIProvider = {
|
||||||
Services.obs.notifyObservers(null, "chrome-flush-caches");
|
Services.obs.notifyObservers(null, "chrome-flush-caches");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("nsICrashReporter" in Ci &&
|
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||||
Services.appinfo instanceof Ci.nsICrashReporter) {
|
|
||||||
// Annotate the crash report with relevant add-on information.
|
// Annotate the crash report with relevant add-on information.
|
||||||
try {
|
try {
|
||||||
Services.appinfo.annotateCrashReport("Theme", this.currentSkin);
|
Services.appinfo.annotateCrashReport("Theme", this.currentSkin);
|
||||||
|
|
@ -2763,14 +2762,16 @@ this.XPIProvider = {
|
||||||
* Adds a list of currently active add-ons to the next crash report.
|
* Adds a list of currently active add-ons to the next crash report.
|
||||||
*/
|
*/
|
||||||
addAddonsToCrashReporter() {
|
addAddonsToCrashReporter() {
|
||||||
if (!("nsICrashReporter" in Ci) ||
|
if (!(Services.appinfo instanceof Ci.nsICrashReporter) ||
|
||||||
!(Services.appinfo instanceof Ci.nsICrashReporter))
|
!AppConstants.MOZ_CRASHREPORTER) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// In safe mode no add-ons are loaded so we should not include them in the
|
// In safe mode no add-ons are loaded so we should not include them in the
|
||||||
// crash report
|
// crash report
|
||||||
if (Services.appinfo.inSafeMode)
|
if (Services.appinfo.inSafeMode) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let data = Array.from(XPIStates.enabledAddons(),
|
let data = Array.from(XPIStates.enabledAddons(),
|
||||||
a => encoded`${a.id}:${a.version}`).join(",");
|
a => encoded`${a.id}:${a.version}`).join(",");
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue