tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 77075ac3b00b39a33da68c8cdd06b4e77f5abb9a
parent 96eccf5af235e2f592e45fda4e79e6194448fc74
Author: serge-sans-paille <sguelton@mozilla.com>
Date:   Fri, 12 Dec 2025 14:51:01 +0000

Bug 2005456 - Move the dependency on MOZ_SOURCE_STAMP from WebRenderAPI.cpp to XREAppData.cpp r=glandium

XREAppData.cpp is already depending on changeset information, so it
avoids a cache miss from sccache to move the dependency there.

Differential Revision: https://phabricator.services.mozilla.com/D275947

Diffstat:
Mbuild/appini_header.py | 6+++++-
Mbuild/variables.py | 3---
Mgfx/webrender_bindings/WebRenderAPI.cpp | 15++++++---------
Mxpcom/build/XREAppData.h | 6++++++
Mxpcom/glue/XREAppData.cpp | 1+
5 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/build/appini_header.py b/build/appini_header.py @@ -57,6 +57,9 @@ def main(output, file): else: appdata["App:sourceurl"] = "NULL" + if "App:sourcestamp" not in appdata: + appdata["App:sourcestamp"] = "NULL" + if "AppUpdate:url" not in appdata: appdata["AppUpdate:url"] = "" @@ -77,7 +80,8 @@ def main(output, file): %(App:profile)s, NULL, // UAName %(App:sourceurl)s, - "%(AppUpdate:url)s" + "%(AppUpdate:url)s", + %(App:sourcestamp)s };""" % appdata ) diff --git a/build/variables.py b/build/variables.py @@ -100,9 +100,6 @@ def source_repo_header(output): "could not resolve changeset; " "try setting MOZ_SOURCE_CHANGESET" ) - if changeset: - output.write("#define MOZ_SOURCE_STAMP %s\n" % changeset) - if repo and buildconfig.substs.get("MOZ_INCLUDE_SOURCE_INFO"): source = "%s/rev/%s" % (repo, changeset) output.write("#define MOZ_SOURCE_REPO %s\n" % repo) diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp @@ -11,13 +11,13 @@ #include "mozilla/webrender/RendererOGL.h" #include "mozilla/gfx/gfxVars.h" #include "mozilla/layers/CompositorThread.h" -#include "mozilla/HelperMacros.h" #include "mozilla/StaticPrefs_gfx.h" #include "mozilla/StaticPrefs_webgl.h" #include "mozilla/ToString.h" #include "mozilla/webrender/RenderCompositor.h" #include "mozilla/widget/CompositorWidget.h" #include "mozilla/layers/SynchronousTask.h" +#include "mozilla/XREAppData.h" #include "nsDisplayList.h" #include "nsThreadUtils.h" #include "TextDrawTarget.h" @@ -26,17 +26,14 @@ #include "source-repo.h" -#ifdef MOZ_SOURCE_STAMP -# define MOZ_SOURCE_STAMP_VALUE MOZ_STRINGIFY(MOZ_SOURCE_STAMP) -#else -# define MOZ_SOURCE_STAMP_VALUE nullptr -#endif - static mozilla::LazyLogModule sWrDLLog("wr.dl"); #define WRDL_LOG(...) \ MOZ_LOG(sWrDLLog, LogLevel::Debug, ("WRDL(%p): " __VA_ARGS__)) +extern const mozilla::XREAppData* gAppData; + namespace mozilla { + using namespace layers; namespace wr { @@ -907,7 +904,7 @@ void WebRenderAPI::Capture() { // SCENE | FRAME | TILE_CACHE uint8_t bits = 15; // TODO: get from JavaScript const char* path = "wr-capture"; // TODO: get from JavaScript - const char* revision = MOZ_SOURCE_STAMP_VALUE; + const char* revision = gAppData->sourceStamp; wr_api_capture(mDocHandle, path, revision, bits); } @@ -918,7 +915,7 @@ void WebRenderAPI::StartCaptureSequence(const nsACString& aPath, } wr_api_start_capture_sequence(mDocHandle, PromiseFlatCString(aPath).get(), - MOZ_SOURCE_STAMP_VALUE, aFlags); + gAppData->sourceStamp, aFlags); mCaptureSequence = true; } diff --git a/xpcom/build/XREAppData.h b/xpcom/build/XREAppData.h @@ -178,6 +178,11 @@ class XREAppData { */ CharPtr updateURL; + /** + * The changeset to the source revision for this build of the application. + */ + CharPtr sourceStamp; + #if defined(XP_WIN) && defined(MOZ_SANDBOX) /** * Chromium sandbox BrokerServices. @@ -225,6 +230,7 @@ struct StaticXREAppData { const char* UAName; const char* sourceURL; const char* updateURL; + const char* sourceStamp; }; } // namespace mozilla diff --git a/xpcom/glue/XREAppData.cpp b/xpcom/glue/XREAppData.cpp @@ -25,6 +25,7 @@ XREAppData& XREAppData::operator=(const StaticXREAppData& aOther) { UAName = aOther.UAName; sourceURL = aOther.sourceURL; updateURL = aOther.updateURL; + sourceStamp = aOther.sourceStamp; return *this; }