Backed out changeset bd51857879db (bug 1862957) for causing WakeLock related failures...
[gecko.git] / xpcom / base / nsMacUtilsImpl.h
blob9a20b539d193ffbd976643ae119bc34757d1b46c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsMacUtilsImpl_h___
8 #define nsMacUtilsImpl_h___
10 #include "nsString.h"
11 #include "mozilla/Atomics.h"
12 #include "mozilla/Attributes.h"
13 #include "mozilla/StaticMutex.h"
14 #include "mozilla/StaticPtr.h"
16 using mozilla::Atomic;
17 using mozilla::StaticAutoPtr;
18 using mozilla::StaticMutex;
20 class nsIFile;
22 namespace nsMacUtilsImpl {
24 // Return the repo directory and the repo object directory respectively.
25 // These should only be used on Mac developer builds to determine the path
26 // to the repo or object directory.
27 nsresult GetRepoDir(nsIFile** aRepoDir);
28 nsresult GetObjDir(nsIFile** aObjDir);
30 #if defined(MOZ_SANDBOX) || defined(__aarch64__)
31 bool GetAppPath(nsCString& aAppPath);
32 #endif /* MOZ_SANDBOX || __aarch64__ */
34 #if defined(MOZ_SANDBOX) && defined(DEBUG)
35 nsresult GetBloatLogDir(nsCString& aDirectoryPath);
36 nsresult GetDirectoryPath(const char* aPath, nsCString& aDirectoryPath);
37 #endif /* MOZ_SANDBOX && DEBUG */
39 void EnableTCSMIfAvailable();
40 bool IsTCSMAvailable();
41 uint32_t GetPhysicalCPUCount();
42 nsresult GetArchitecturesForBundle(uint32_t* aArchMask);
43 nsresult GetArchitecturesForBinary(const char* aPath, uint32_t* aArchMask);
45 #if defined(__aarch64__)
46 // Pre-translate binaries to avoid translation delays when launching
47 // x64 child process instances for the first time. i.e. on first launch
48 // after installation or after an update. Translations are cached so
49 // repeated launches of the binaries do not encounter delays.
50 int PreTranslateXUL();
51 int PreTranslateBinary(nsCString aBinaryPath);
52 #endif
53 } // namespace nsMacUtilsImpl
55 #endif /* nsMacUtilsImpl_h___ */