Skip to content

Commit

Permalink
Remove display profile in about:support
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedor committed Jan 7, 2024
1 parent 1683eb4 commit 7b56d34
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 39 deletions.
34 changes: 0 additions & 34 deletions gfx/thebes/gfxPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "mozilla/TimeStamp.h"
#include "mozilla/Unused.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/Base64.h"

#include "mozilla/Logging.h"
#include "mozilla/Services.h"
Expand Down Expand Up @@ -468,7 +467,6 @@ gfxPlatform::gfxPlatform()
mApzSupportCollector(this, &gfxPlatform::GetApzSupportInfo),
mTilesInfoCollector(this, &gfxPlatform::GetTilesSupportInfo),
mFrameStatsCollector(this, &gfxPlatform::GetFrameStats),
mCMSInfoCollector(this, &gfxPlatform::GetCMSSupportInfo),
mCompositorBackend(layers::LayersBackend::LAYERS_NONE),
mScreenDepth(0),
mScreenPixels(0) {
Expand Down Expand Up @@ -3339,38 +3337,6 @@ void gfxPlatform::GetFrameStats(mozilla::widget::InfoObject& aObj) {
}
}

void gfxPlatform::GetCMSSupportInfo(mozilla::widget::InfoObject& aObj) {
void* profile = nullptr;
size_t size = 0;

GetCMSOutputProfileData(profile, size);
if (!profile) {
return;
}

// Some profiles can be quite large. We don't want to include giant profiles
// by default in about:support. For now, we only accept less than 8kiB.
const size_t kMaxProfileSize = 8192;
if (size < kMaxProfileSize) {
char* encodedProfile = nullptr;
nsresult rv =
Base64Encode(reinterpret_cast<char*>(profile), size, &encodedProfile);
if (NS_SUCCEEDED(rv)) {
aObj.DefineProperty("CMSOutputProfile", encodedProfile);
free(encodedProfile);
} else {
nsPrintfCString msg("base64 encode failed 0x%08x",
static_cast<uint32_t>(rv));
aObj.DefineProperty("CMSOutputProfile", msg.get());
}
} else {
nsPrintfCString msg("%zu bytes, too large", size);
aObj.DefineProperty("CMSOutputProfile", msg.get());
}

free(profile);
}

class FrameStatsComparator {
public:
bool Equals(const FrameStats& aA, const FrameStats& aB) const {
Expand Down
2 changes: 0 additions & 2 deletions gfx/thebes/gfxPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
void GetApzSupportInfo(mozilla::widget::InfoObject& aObj);
void GetTilesSupportInfo(mozilla::widget::InfoObject& aObj);
void GetFrameStats(mozilla::widget::InfoObject& aObj);
void GetCMSSupportInfo(mozilla::widget::InfoObject& aObj);

// Get the default content backend that will be used with the default
// compositor. If the compositor is known when calling this function,
Expand Down Expand Up @@ -905,7 +904,6 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
mozilla::widget::GfxInfoCollector<gfxPlatform> mApzSupportCollector;
mozilla::widget::GfxInfoCollector<gfxPlatform> mTilesInfoCollector;
mozilla::widget::GfxInfoCollector<gfxPlatform> mFrameStatsCollector;
mozilla::widget::GfxInfoCollector<gfxPlatform> mCMSInfoCollector;

nsTArray<mozilla::layers::FrameStats> mFrameStats;

Expand Down
4 changes: 1 addition & 3 deletions toolkit/content/aboutSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,9 @@ var snapshotFormatters = {
apzInfo = formatApzInfo(data.info);

let trs = sortedArrayFromObject(data.info).map(function([prop, val]) {
let td = $.new("td", String(val));
td.style["word-break"] = "break-all";
return $.new("tr", [
$.new("th", prop, "column"),
td,
$.new("td", String(val)),
]);
});
addRows("diagnostics", trs);
Expand Down

0 comments on commit 7b56d34

Please sign in to comment.