Skip to content

Commit

Permalink
Bug 1654957 - Prelude: move GfxInfoFeatureStatus from dom to gfx. r=j…
Browse files Browse the repository at this point in the history
…gilbert

Differential Revision: https://phabricator.services.mozilla.com/D85488
  • Loading branch information
jld committed Jul 30, 2020
1 parent d291059 commit efbd9bf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
7 changes: 0 additions & 7 deletions dom/ipc/PContent.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,6 @@ struct GMPCapabilityData
GMPAPITags[] capabilities;
};

struct GfxInfoFeatureStatus
{
int32_t feature;
int32_t status;
nsCString failureId;
};

struct XPCOMInitData
{
bool isOffline;
Expand Down
7 changes: 7 additions & 0 deletions gfx/ipc/GraphicsMessages.ipdlh
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,12 @@ struct GfxVarUpdate
GfxVarValue value;
};

struct GfxInfoFeatureStatus
{
int32_t feature;
int32_t status;
nsCString failureId;
};

} // namespace gfx
} // namespace mozilla
12 changes: 6 additions & 6 deletions widget/GfxInfoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using namespace mozilla;
using mozilla::MutexAutoLock;

nsTArray<GfxDriverInfo>* GfxInfoBase::sDriverInfo;
nsTArray<dom::GfxInfoFeatureStatus>* GfxInfoBase::sFeatureStatus;
nsTArray<gfx::GfxInfoFeatureStatus>* GfxInfoBase::sFeatureStatus;
bool GfxInfoBase::sDriverInfoObserverInitialized;
bool GfxInfoBase::sShutdownOccurred;

Expand Down Expand Up @@ -711,20 +711,20 @@ GfxInfoBase::GetFeatureStatus(int32_t aFeature, nsACString& aFailureId,
void GfxInfoBase::GetAllFeatures(dom::XPCOMInitData& xpcomInit) {
MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
if (!sFeatureStatus) {
sFeatureStatus = new nsTArray<dom::GfxInfoFeatureStatus>();
sFeatureStatus = new nsTArray<gfx::GfxInfoFeatureStatus>();
for (int32_t i = 1; i <= nsIGfxInfo::FEATURE_MAX_VALUE; ++i) {
int32_t status = 0;
nsAutoCString failureId;
GetFeatureStatus(i, failureId, &status);
dom::GfxInfoFeatureStatus gfxFeatureStatus;
gfx::GfxInfoFeatureStatus gfxFeatureStatus;
gfxFeatureStatus.feature() = i;
gfxFeatureStatus.status() = status;
gfxFeatureStatus.failureId() = failureId;
sFeatureStatus->AppendElement(gfxFeatureStatus);
}
}
for (const auto& status : *sFeatureStatus) {
dom::GfxInfoFeatureStatus copy = status;
gfx::GfxInfoFeatureStatus copy = status;
xpcomInit.gfxFeatureStatus().AppendElement(copy);
}
}
Expand Down Expand Up @@ -1089,9 +1089,9 @@ int32_t GfxInfoBase::FindBlocklistedDeviceInList(
}

void GfxInfoBase::SetFeatureStatus(
const nsTArray<dom::GfxInfoFeatureStatus>& aFS) {
const nsTArray<gfx::GfxInfoFeatureStatus>& aFS) {
MOZ_ASSERT(!sFeatureStatus);
sFeatureStatus = new nsTArray<dom::GfxInfoFeatureStatus>(aFS.Clone());
sFeatureStatus = new nsTArray<gfx::GfxInfoFeatureStatus>(aFS.Clone());
}

bool GfxInfoBase::DoesDesktopEnvironmentMatch(
Expand Down
5 changes: 3 additions & 2 deletions widget/GfxInfoBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "mozilla/Maybe.h"
#include "mozilla/Mutex.h"
#include "mozilla/dom/PContentParent.h"
#include "mozilla/gfx/GraphicsMessages.h"
#include "nsCOMPtr.h"
#include "nsIGfxInfo.h"
#include "nsIGfxInfoDebug.h"
Expand Down Expand Up @@ -94,7 +95,7 @@ class GfxInfoBase : public nsIGfxInfo,
static void RemoveCollector(GfxInfoCollectorBase* collector);

static nsTArray<GfxDriverInfo>* sDriverInfo;
static nsTArray<mozilla::dom::GfxInfoFeatureStatus>* sFeatureStatus;
static nsTArray<mozilla::gfx::GfxInfoFeatureStatus>* sFeatureStatus;
static bool sDriverInfoObserverInitialized;
static bool sShutdownOccurred;

Expand All @@ -111,7 +112,7 @@ class GfxInfoBase : public nsIGfxInfo,
virtual nsresult FindMonitors(JSContext* cx, JS::HandleObject array);

static void SetFeatureStatus(
const nsTArray<mozilla::dom::GfxInfoFeatureStatus>& aFS);
const nsTArray<mozilla::gfx::GfxInfoFeatureStatus>& aFS);

protected:
virtual ~GfxInfoBase();
Expand Down

0 comments on commit efbd9bf

Please sign in to comment.