--- a/ipc/glue/EnvironmentMap.h+++ b/ipc/glue/EnvironmentMap.h@@ -1,10 +1,8 @@-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */-/* vim: set ts=8 sts=2 et sw=2 tw=80: */ // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SANDBOXING_COMMON_ENVIRONMENTMAP_H_ #define SANDBOXING_COMMON_ENVIRONMENTMAP_H_ #include <map>@@ -15,17 +13,17 @@ namespace base { #if defined(OS_WIN) typedef std::wstring NativeEnvironmentString; typedef std::map<NativeEnvironmentString, NativeEnvironmentString> EnvironmentMap; #define ENVIRONMENT_LITERAL(x) L##x-#define ENVIRONMENT_STRING(x) ((std::wstring)(NS_ConvertUTF8toUTF16((x)).get()))+#define ENVIRONMENT_STRING(x) (std::wstring)(NS_ConvertUTF8toUTF16((x)).get()) // Returns a modified environment vector constructed from the given environment // and the list of changes given in |changes|. Each key in the environment is // matched against the first element of the pairs. In the event of a match, the // value is replaced by the second of the pair, unless the second is empty, in // which case the key-value is removed. // // This Windows version takes and returns a Windows-style environment block@@ -37,17 +35,17 @@ NativeEnvironmentString AlterEnvironment #elif defined(OS_POSIX) typedef std::string NativeEnvironmentString; typedef std::map<NativeEnvironmentString, NativeEnvironmentString> EnvironmentMap; #define ENVIRONMENT_LITERAL(x) x-#define ENVIRONMENT_STRING(x) x+#define ENVIRONMENT_STRING(x) ((x)).get() // See general comments for the Windows version above. // // This Posix version takes and returns a Posix-style environment block, which // is a null-terminated list of pointers to null-terminated strings. The // returned array will have appended to it the storage for the array itself so // there is only one pointer to manage, but this means that you can't copy the // array without keeping the original around.

--- a/tools/profiler/public/GeckoProfiler.h+++ b/tools/profiler/public/GeckoProfiler.h@@ -924,21 +924,30 @@ public: protected: MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER const char* mCategory; const char* mMarkerName; const mozilla::Maybe<nsID> mDocShellId; const mozilla::Maybe<uint32_t> mDocShellHistoryId; };-// Get the MOZ_PROFILER_STARTUP* environment variables that should be-// supplied to a child process that is about to be launched, in order-// to make that child process start with the same profiler settings as-// in the current process. The given function is invoked once for-// each variable to be set.-void GetProfilerEnvVarsForChildProcess(- std::function<void(const char* key, const char* value)>&& aSetEnv);+// Set MOZ_PROFILER_STARTUP* environment variables that will be inherited into+// a child process that is about to be launched, in order to make that child+// process start with the same profiler settings as in the current process.+class MOZ_RAII AutoSetProfilerEnvVarsForChildProcess+{+public:+ explicit AutoSetProfilerEnvVarsForChildProcess(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);+ ~AutoSetProfilerEnvVarsForChildProcess();++private:+ MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER+ char mSetCapacity[64];+ char mSetInterval[64];+ char mSetFeaturesBitfield[64];+ char mSetFilters[1024];+}; } // namespace mozilla #endif // !MOZ_GECKO_PROFILER #endif // GeckoProfiler_h