tor-browser

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

commit 8cfac1e837d98af7dd1ea4f3c7a7379243d0834f
parent be499e88c865f308755b115ee8265126a7866b22
Author: Nazım Can Altınova <canaltinova@gmail.com>
Date:   Tue, 21 Oct 2025 21:15:34 +0000

Bug 1979114 - Make ProfileGenerationAdditionalInformation MoveOnly and remove the copy constructors of additional information structs r=mstange,profiler-reviewers

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

Diffstat:
Mtools/profiler/gecko/ProfilerTypes.ipdlh | 3++-
Mtools/profiler/gecko/nsProfiler.h | 2+-
Mtools/profiler/public/ProfileAdditionalInformation.h | 19+++++++++++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/tools/profiler/gecko/ProfilerTypes.ipdlh b/tools/profiler/gecko/ProfilerTypes.ipdlh @@ -4,7 +4,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ using class mozilla::TimeStamp from "mozilla/TimeStamp.h"; -using struct mozilla::ProfileGenerationAdditionalInformation from "ProfileAdditionalInformation.h"; +[MoveOnly] using struct mozilla::ProfileGenerationAdditionalInformation from + "ProfileAdditionalInformation.h"; namespace mozilla { diff --git a/tools/profiler/gecko/nsProfiler.h b/tools/profiler/gecko/nsProfiler.h @@ -52,7 +52,7 @@ class nsProfiler final : public nsIProfiler { mozilla::MozPromise<mozilla::void_t, nsresult, true>; using GatheringPromise = mozilla::MozPromise<mozilla::ProfileAndAdditionalInformation, nsresult, - false>; + true>; using SymbolTablePromise = mozilla::MozPromise<mozilla::SymbolTable, nsresult, true>; diff --git a/tools/profiler/public/ProfileAdditionalInformation.h b/tools/profiler/public/ProfileAdditionalInformation.h @@ -36,6 +36,16 @@ struct ProfileGenerationAdditionalInformation { size_t SizeOf() const { return mSharedLibraries.SizeOf(); } + ProfileGenerationAdditionalInformation( + const ProfileGenerationAdditionalInformation& other) = delete; + ProfileGenerationAdditionalInformation& operator=( + const ProfileGenerationAdditionalInformation&) = delete; + + ProfileGenerationAdditionalInformation( + ProfileGenerationAdditionalInformation&& other) = default; + ProfileGenerationAdditionalInformation& operator=( + ProfileGenerationAdditionalInformation&& other) = default; + void Append(ProfileGenerationAdditionalInformation&& aOther) { mSharedLibraries.AddAllSharedLibraries(aOther.mSharedLibraries); } @@ -58,6 +68,15 @@ struct ProfileAndAdditionalInformation { : mProfile(std::move(aProfile)), mAdditionalInformation(Some(std::move(aAdditionalInformation))) {} + ProfileAndAdditionalInformation(const ProfileAndAdditionalInformation&) = + delete; + ProfileAndAdditionalInformation& operator=( + const ProfileAndAdditionalInformation&) = delete; + + ProfileAndAdditionalInformation(ProfileAndAdditionalInformation&&) = default; + ProfileAndAdditionalInformation& operator=( + ProfileAndAdditionalInformation&&) = default; + size_t SizeOf() const { size_t size = mProfile.Length(); if (mAdditionalInformation.isSome()) {