Backed out 2 changesets (bug 1270894) for build bustage

Backed out changeset 8c0d3d862f14 (bug 1270894)
Backed out changeset 1bb479eb334c (bug 1270894)
This commit is contained in:
Wes Kocher 2016-05-09 13:53:10 -07:00
Родитель 281dd2d1ee
Коммит 4cc953c236
11 изменённых файлов: 13 добавлений и 154 удалений

Просмотреть файл

@ -23,24 +23,11 @@ namespace mozilla {
namespace gfx {
static const size_t NUM_CRASH_GUARD_TYPES = size_t(CrashGuardType::NUM_TYPES);
static const char* sCrashGuardNames[] = {
static const char* sCrashGuardNames[NUM_CRASH_GUARD_TYPES] = {
"d3d11layers",
"d3d9video",
"glcontext",
"d3d11video",
};
static_assert(MOZ_ARRAY_LENGTH(sCrashGuardNames) == NUM_CRASH_GUARD_TYPES,
"CrashGuardType updated without a name string");
static inline void
BuildCrashGuardPrefName(CrashGuardType aType, nsCString& aOutPrefName)
{
MOZ_ASSERT(mType < CrashGuardType::NUM_TYPES);
MOZ_ASSERT(sCrashGuardNames[size_t(mType)]);
aOutPrefName.Assign("gfx.crash-guard.status.");
aOutPrefName.Append(sCrashGuardNames[size_t(aType)]);
}
DriverCrashGuard::DriverCrashGuard(CrashGuardType aType, dom::ContentParent* aContentParent)
: mType(aType)
@ -49,7 +36,10 @@ DriverCrashGuard::DriverCrashGuard(CrashGuardType aType, dom::ContentParent* aCo
, mGuardActivated(false)
, mCrashDetected(false)
{
BuildCrashGuardPrefName(aType, mStatusPref);
MOZ_ASSERT(mType < CrashGuardType::NUM_TYPES);
mStatusPref.Assign("gfx.crash-guard.status.");
mStatusPref.Append(sCrashGuardNames[size_t(mType)]);
}
void
@ -63,29 +53,15 @@ DriverCrashGuard::InitializeIfNeeded()
Initialize();
}
static inline bool
AreCrashGuardsEnabled()
void
DriverCrashGuard::Initialize()
{
#ifdef NIGHTLY_BUILD
// We only use the crash guard on non-nightly channels, since the nightly
// channel is for development and having graphics features perma-disabled
// is rather annoying.
return false;
#else
// Check to see if all guards have been disabled through the environment.
if (gfxEnv::DisableCrashGuard()) {
return false;
}
return true;
return;
#endif
}
void
DriverCrashGuard::Initialize()
{
if (!AreCrashGuardsEnabled()) {
return;
}
// Using DriverCrashGuard off the main thread currently does not work. Under
// e10s it could conceivably work by dispatching the IPC calls via the main
@ -95,6 +71,11 @@ DriverCrashGuard::Initialize()
return;
}
// Check to see if all guards have been disabled through the environment.
if (gfxEnv::DisableCrashGuard()) {
return;
}
mGfxInfo = services::GetGfxInfo();
if (XRE_IsContentProcess()) {
@ -385,31 +366,6 @@ DriverCrashGuard::FlushPreferences()
}
}
void
DriverCrashGuard::ForEachActiveCrashGuard(const CrashGuardCallback& aCallback)
{
if (!AreCrashGuardsEnabled()) {
// Even if guards look active (via prefs), they can be ignored if globally
// disabled.
return;
}
for (size_t i = 0; i < NUM_CRASH_GUARD_TYPES; i++) {
CrashGuardType type = static_cast<CrashGuardType>(i);
nsCString prefName;
BuildCrashGuardPrefName(type, prefName);
auto status =
static_cast<DriverInitStatus>(Preferences::GetInt(prefName.get(), 0));
if (status != DriverInitStatus::Crashed) {
continue;
}
aCallback(sCrashGuardNames[i], prefName.get());
}
}
D3D11LayersCrashGuard::D3D11LayersCrashGuard(dom::ContentParent* aContentParent)
: DriverCrashGuard(CrashGuardType::D3D11Layers, aContentParent)
{

Просмотреть файл

@ -9,7 +9,6 @@
#include "nsIGfxInfo.h"
#include "nsIFile.h"
#include "nsString.h"
#include "mozilla/Function.h"
#include <string>
namespace mozilla {
@ -41,10 +40,6 @@ enum class CrashGuardType : uint32_t
D3D9Video,
GLContext,
D3D11Video,
// Add new entries above this line, update the name array in
// DriverCrashGuard.cpp, and make sure to add an entry in
// ContentParent.cpp.
NUM_TYPES
};
@ -83,10 +78,6 @@ public:
Proxy
};
typedef mozilla::function<void(const char* aName, const char* aPrefName)>
CrashGuardCallback;
static void ForEachActiveCrashGuard(const CrashGuardCallback& aCallback);
protected:
virtual void Initialize();
virtual bool UpdateEnvironment() = 0;

Просмотреть файл

@ -479,30 +479,6 @@ var snapshotFormatters = {
$("graphics-workarounds-tbody").style.display = "none";
}
let crashGuards = data.crashGuards;
delete data.crashGuards;
if (crashGuards.length) {
for (let guard of crashGuards) {
let resetButton = $.new("button");
let onClickReset = (function (guard) {
// Note - need this wrapper until bug 449811 fixes |guard| scoping.
return function () {
Services.prefs.setIntPref(guard.prefName, 0);
resetButton.removeEventListener("click", onClickReset);
resetButton.disabled = true;
};
})(guard);
resetButton.textContent = strings.GetStringFromName("resetOnNextRestart");
resetButton.addEventListener("click", onClickReset);
addRow("crashguards", guard.type + "CrashGuard", [resetButton]);
}
} else {
$("graphics-crashguards-tbody").style.display = "none";
}
// Now that we're done, grab any remaining keys in data and drop them into
// the diagnostics section.
for (let key in data) {

Просмотреть файл

@ -342,14 +342,6 @@
</tr>
</tbody>
<tbody id="graphics-crashguards-tbody">
<tr>
<th colspan="2" class="title-column">
&aboutSupport.graphicsCrashGuardsTitle;
</th>
</tr>
</tbody>
<tbody id="graphics-workarounds-tbody">
<tr>
<th colspan="2" class="title-column">

Просмотреть файл

@ -119,5 +119,4 @@ variant of aboutSupport.showDir.label. -->
<!ENTITY aboutSupport.graphicsGPU1Title "GPU #1">
<!ENTITY aboutSupport.graphicsGPU2Title "GPU #2">
<!ENTITY aboutSupport.graphicsDecisionLogTitle "Decision Log">
<!ENTITY aboutSupport.graphicsCrashGuardsTitle "Crash Guard Disabled Features">
<!ENTITY aboutSupport.graphicsWorkaroundsTitle "Workarounds">

Просмотреть файл

@ -79,11 +79,6 @@ bugLink = bug %1$S
# LOCALIZATION NOTE %1$S will be replaced with an arbitrary identifier
# string that can be searched on DXR/MXR or grepped in the source tree.
unknownFailure = Blocklisted; failure code %1$S
d3d11layersCrashGuard = D3D11 Compositor
d3d11videoCrashGuard = D3D11 Video Decoder
d3d9videoCrashGuard = D3D9 Video Decoder
glcontextCrashGuard = OpenGL
resetOnNextRestart = Reset on Next Restart
minLibVersions = Expected minimum version
loadedLibVersions = Version in use

Просмотреть файл

@ -474,7 +474,6 @@ var dataProviders = {
}
data.featureLog = gfxInfo.getFeatureLog();
data.crashGuards = gfxInfo.getActiveCrashGuards();
completed();
},

Просмотреть файл

@ -309,9 +309,6 @@ const SNAPSHOT_SCHEMA = {
featureLog: {
type: "object",
},
crashGuards: {
type: "array",
},
direct2DEnabledMessage: {
type: "array",
},

Просмотреть файл

@ -34,7 +34,6 @@
#include "gfxPrefs.h"
#include "gfxPlatform.h"
#include "gfxConfig.h"
#include "DriverCrashGuard.h"
#if defined(MOZ_CRASHREPORTER)
#include "nsExceptionHandler.h"
@ -1338,35 +1337,6 @@ GfxInfoBase::InitFeatureObject(JSContext* aCx,
return true;
}
nsresult
GfxInfoBase::GetActiveCrashGuards(JSContext* aCx, JS::MutableHandle<JS::Value> aOut)
{
JS::Rooted<JSObject*> array(aCx, JS_NewArrayObject(aCx, 0));
if (!array) {
return NS_ERROR_OUT_OF_MEMORY;
}
aOut.setObject(*array);
DriverCrashGuard::ForEachActiveCrashGuard([&](const char* aName,
const char* aPrefName) -> void {
JS::Rooted<JSObject*> obj(aCx, JS_NewPlainObject(aCx));
if (!obj) {
return;
}
if (!SetJSPropertyString(aCx, obj, "type", aName)) {
return;
}
if (!SetJSPropertyString(aCx, obj, "prefName", aPrefName)) {
return;
}
if (!AppendJSElement(aCx, array, obj)) {
return;
}
});
return NS_OK;
}
GfxInfoCollectorBase::GfxInfoCollectorBase()
{
GfxInfoBase::AddCollector(this);

Просмотреть файл

@ -57,7 +57,6 @@ public:
NS_IMETHOD GetInfo(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetFeatures(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetFeatureLog(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetActiveCrashGuards(JSContext*, JS::MutableHandle<JS::Value>) override;
// Initialization function. If you override this, you must call this class's
// version of Init first.

Просмотреть файл

@ -224,20 +224,5 @@ interface nsIGfxInfo : nsISupports
// }
[implicit_jscontext]
jsval getFeatures();
// Returns an array listing any active crash guards.
//
// [
// {
// // Type is one of "d3d11layers", "d3d9video", "glcontext",
// // or "d3d11video".
// "type": "<identifier>",
//
// // Preference that must be deleted/reset to retrigger the guard.
// "prefName": "<preference>",
// }
// ]
[implicit_jscontext]
jsval getActiveCrashGuards();
};