Bug 1635428 - Part 1: Move mozilla::IsDevelopmentBuild to Omnijar.h r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D142569
This commit is contained in:
Kagami Sascha Rosylight 2022-03-31 23:36:25 +00:00
Родитель f9cf190188
Коммит 1e83450022
7 изменённых файлов: 15 добавлений и 26 удалений

Просмотреть файл

@ -132,10 +132,6 @@
#include "nsQueryObject.h"
#include "nsSandboxFlags.h"
#if !defined(XP_WIN)
# include "mozilla/Omnijar.h"
#endif
#include "ChildProfilerController.h"
#if defined(MOZ_SANDBOX)
@ -5018,14 +5014,6 @@ bool StartOpenBSDSandbox(GeckoProcessType type) {
}
#endif
#if !defined(XP_WIN)
bool IsDevelopmentBuild() {
nsCOMPtr<nsIFile> path = mozilla::Omnijar::GetPath(mozilla::Omnijar::GRE);
// If the path doesn't exist, we're a dev build.
return path == nullptr;
}
#endif /* !XP_WIN */
} // namespace mozilla
/* static */

Просмотреть файл

@ -57,16 +57,6 @@ class PScriptCacheChild;
namespace widget {
enum class ThemeChangeKind : uint8_t;
}
#if !defined(XP_WIN)
// Returns whether or not the currently running build is an unpackaged
// developer build. This check is implemented by looking for omni.ja in the
// the obj/dist dir. We use this routine to detect when the build dir will
// use symlinks to the repo and object dir. On Windows, dev builds don't
// use symlinks.
bool IsDevelopmentBuild();
#endif /* !XP_WIN */
namespace dom {
namespace ipc {

Просмотреть файл

@ -19,7 +19,7 @@
#include <string>
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
# include "mozilla/dom/ContentChild.h"
# include "mozilla/Omnijar.h"
# include "mozilla/Preferences.h"
# include "mozilla/Sandbox.h"
# include "mozilla/SandboxSettings.h"

Просмотреть файл

@ -8,7 +8,6 @@
#include "mozilla/BinarySearch.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/Promise-inl.h"
#include "mozilla/ExtensionPolicyService.h"
@ -17,6 +16,7 @@
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/net/NeckoChild.h"
#include "mozilla/Omnijar.h"
#include "mozilla/RefPtr.h"
#include "mozilla/ResultExtensions.h"

Просмотреть файл

@ -11,13 +11,13 @@
#include "base/shared_memory.h"
#include "mozilla/Array.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/Omnijar.h"
#include "mozilla/Preferences.h"
#include "mozilla/SandboxLaunch.h"
#include "mozilla/SandboxSettings.h"
#include "mozilla/StaticPrefs_security.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/dom/ContentChild.h"
#include "nsComponentManagerUtils.h"
#include "nsPrintfCString.h"
#include "nsString.h"
@ -32,6 +32,7 @@
#include "nsIFile.h"
#include "nsNetCID.h"
#include "prenv.h"
#ifdef ANDROID
# include "cutils/properties.h"

Просмотреть файл

@ -9,7 +9,7 @@
#include "base/command_line.h"
#include "base/process_util.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/Omnijar.h"
#include "nsDirectoryServiceDefs.h"
#include "nsCOMPtr.h"
#include "nsComponentManagerUtils.h"

Просмотреть файл

@ -156,6 +156,16 @@ class Omnijar {
static void CleanUpOne(Type aType);
}; /* class Omnijar */
/**
* Returns whether or not the currently running build is an unpackaged
* developer build. This check is implemented by looking for omni.ja in the
* the obj/dist dir. We use this routine to detect when the build dir will
* use symlinks to the repo and object dir.
*/
inline bool IsDevelopmentBuild() {
return !Omnijar::HasOmnijar(mozilla::Omnijar::GRE);
}
} /* namespace mozilla */
#endif /* mozilla_Omnijar_h */