tor-browser

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

commit 74bd6c9d12f1f7b9ef0df8abccb43d037273c7d8
parent 4780d8eb2e94a18d5e0297057f08f7c2df8bad97
Author: Markus Stange <mstange.moz@gmail.com>
Date:   Thu,  2 Oct 2025 20:49:11 +0000

Bug 1987007 - Remove stray indent from CommitToScreen. r=bradwerth

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

Diffstat:
Mgfx/layers/NativeLayerCA.mm | 81++++++++++++++++++++++++++++++++++++++-----------------------------------------
1 file changed, 39 insertions(+), 42 deletions(-)

diff --git a/gfx/layers/NativeLayerCA.mm b/gfx/layers/NativeLayerCA.mm @@ -353,52 +353,49 @@ bool NativeLayerRootCA::AreOffMainThreadCommitsSuspended() { } bool NativeLayerRootCA::CommitToScreen() { - { - MutexAutoLock lock(mMutex); + MutexAutoLock lock(mMutex); - if (!NS_IsMainThread() && mOffMainThreadCommitsSuspended) { - mCommitPending = true; - return false; - } + if (!NS_IsMainThread() && mOffMainThreadCommitsSuspended) { + mCommitPending = true; + return false; + } - CommitRepresentation(WhichRepresentation::ONSCREEN, mOnscreenRootCALayer, - mSublayers, mMutatedOnscreenLayerStructure, - mWindowIsFullscreen); - mMutatedOnscreenLayerStructure = false; - - mCommitPending = false; - - if (StaticPrefs::gfx_webrender_debug_dump_native_layer_tree_to_file()) { - static uint32_t sFrameID = 0; - uint32_t frameID = sFrameID++; - - NSString* dirPath = - [NSString stringWithFormat:@"%@/Desktop/nativelayerdumps-%d", - NSHomeDirectory(), getpid()]; - if ([NSFileManager.defaultManager createDirectoryAtPath:dirPath - withIntermediateDirectories:YES - attributes:nil - error:nullptr]) { - NSString* filename = - [NSString stringWithFormat:@"frame-%d.html", frameID]; - NSString* filePath = [dirPath stringByAppendingPathComponent:filename]; - DumpLayerTreeToFile([filePath UTF8String], lock); - } else { - NSLog(@"Failed to create directory %@", dirPath); - } + CommitRepresentation(WhichRepresentation::ONSCREEN, mOnscreenRootCALayer, + mSublayers, mMutatedOnscreenLayerStructure, + mWindowIsFullscreen); + mMutatedOnscreenLayerStructure = false; + + mCommitPending = false; + + if (StaticPrefs::gfx_webrender_debug_dump_native_layer_tree_to_file()) { + static uint32_t sFrameID = 0; + uint32_t frameID = sFrameID++; + + NSString* dirPath = + [NSString stringWithFormat:@"%@/Desktop/nativelayerdumps-%d", + NSHomeDirectory(), getpid()]; + if ([NSFileManager.defaultManager createDirectoryAtPath:dirPath + withIntermediateDirectories:YES + attributes:nil + error:nullptr]) { + NSString* filename = + [NSString stringWithFormat:@"frame-%d.html", frameID]; + NSString* filePath = [dirPath stringByAppendingPathComponent:filename]; + DumpLayerTreeToFile([filePath UTF8String], lock); + } else { + NSLog(@"Failed to create directory %@", dirPath); } + } - // Decide if we are going to emit telemetry about video low power on this - // commit. - static const int32_t TELEMETRY_COMMIT_PERIOD = - StaticPrefs::gfx_core_animation_low_power_telemetry_frames_AtStartup(); - mTelemetryCommitCount = - (mTelemetryCommitCount + 1) % TELEMETRY_COMMIT_PERIOD; - if (mTelemetryCommitCount == 0) { - // Figure out if we are hitting video low power mode. - VideoLowPowerType videoLowPower = CheckVideoLowPower(lock); - EmitTelemetryForVideoLowPower(videoLowPower); - } + // Decide if we are going to emit telemetry about video low power on this + // commit. + static const int32_t TELEMETRY_COMMIT_PERIOD = + StaticPrefs::gfx_core_animation_low_power_telemetry_frames_AtStartup(); + mTelemetryCommitCount = (mTelemetryCommitCount + 1) % TELEMETRY_COMMIT_PERIOD; + if (mTelemetryCommitCount == 0) { + // Figure out if we are hitting video low power mode. + VideoLowPowerType videoLowPower = CheckVideoLowPower(lock); + EmitTelemetryForVideoLowPower(videoLowPower); } return true;