forked from mirrors/gecko-dev
Bug 1822484 - Rename IsDevelopmentBuild. r=necko-reviewers,media-playback-reviewers,padenot,emilio
Differential Revision: https://phabricator.services.mozilla.com/D172748
This commit is contained in:
parent
c062dcce43
commit
9b67b694bf
9 changed files with 24 additions and 24 deletions
|
|
@ -2564,10 +2564,10 @@ static void CacheSandboxParams(std::vector<std::string>& aCachedParams) {
|
|||
info.testingReadPath2 = testingReadPath2.get();
|
||||
}
|
||||
|
||||
// TESTING_READ_PATH3, TESTING_READ_PATH4. In development builds,
|
||||
// TESTING_READ_PATH3, TESTING_READ_PATH4. In non-packaged builds,
|
||||
// these are used to whitelist the repo dir and object dir respectively.
|
||||
nsresult rv;
|
||||
if (mozilla::IsDevelopmentBuild()) {
|
||||
if (!mozilla::IsPackagedBuild()) {
|
||||
// Repo dir
|
||||
nsCOMPtr<nsIFile> repoDir;
|
||||
rv = nsMacUtilsImpl::GetRepoDir(getter_AddRefs(repoDir));
|
||||
|
|
|
|||
|
|
@ -220,9 +220,9 @@ bool GMPProcessParent::FillMacSandboxInfo(MacSandboxInfo& aInfo) {
|
|||
"resolved plugin dir path: %s",
|
||||
resolvedPluginPath.get());
|
||||
|
||||
if (mozilla::IsDevelopmentBuild()) {
|
||||
if (!mozilla::IsPackagedBuild()) {
|
||||
GMP_LOG_DEBUG(
|
||||
"GMPProcessParent::FillMacSandboxInfo: IsDevelopmentBuild()=true");
|
||||
"GMPProcessParent::FillMacSandboxInfo: IsPackagedBuild()=false");
|
||||
|
||||
// Repo dir
|
||||
nsCOMPtr<nsIFile> repoDir;
|
||||
|
|
|
|||
|
|
@ -632,11 +632,11 @@ Result<bool, nsresult> ExtensionProtocolHandler::AllowExternalResource(
|
|||
MOZ_ASSERT(!IsNeckoChild());
|
||||
|
||||
#if defined(XP_WIN)
|
||||
// On Windows, dev builds don't use symlinks so we never need to
|
||||
// On Windows, non-package builds don't use symlinks so we never need to
|
||||
// allow a resource from outside of the extension dir.
|
||||
return false;
|
||||
#else
|
||||
if (!mozilla::IsDevelopmentBuild()) {
|
||||
if (mozilla::IsPackagedBuild()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -666,7 +666,7 @@ Result<bool, nsresult> ExtensionProtocolHandler::AllowExternalResource(
|
|||
// The |aRequestedFile| argument must already be Normalize()'d
|
||||
Result<bool, nsresult> ExtensionProtocolHandler::DevRepoContains(
|
||||
nsIFile* aRequestedFile) {
|
||||
MOZ_ASSERT(mozilla::IsDevelopmentBuild());
|
||||
MOZ_ASSERT(!mozilla::IsPackagedBuild());
|
||||
MOZ_ASSERT(!IsNeckoChild());
|
||||
|
||||
// On the first invocation, set mDevRepo
|
||||
|
|
@ -691,7 +691,7 @@ Result<bool, nsresult> ExtensionProtocolHandler::DevRepoContains(
|
|||
#if !defined(XP_WIN)
|
||||
Result<bool, nsresult> ExtensionProtocolHandler::AppDirContains(
|
||||
nsIFile* aExtensionDir) {
|
||||
MOZ_ASSERT(mozilla::IsDevelopmentBuild());
|
||||
MOZ_ASSERT(!mozilla::IsPackagedBuild());
|
||||
MOZ_ASSERT(!IsNeckoChild());
|
||||
|
||||
// On the first invocation, set mAppDir
|
||||
|
|
|
|||
|
|
@ -605,10 +605,10 @@ void SandboxBrokerPolicyFactory::InitContentPolicy() {
|
|||
}
|
||||
}
|
||||
|
||||
if (mozilla::IsDevelopmentBuild()) {
|
||||
// If this is a developer build the resources are symlinks to outside the
|
||||
// binary dir. Therefore in non-release builds we allow reads from the whole
|
||||
// repository. MOZ_DEVELOPER_REPO_DIR is set by mach run.
|
||||
if (!mozilla::IsPackagedBuild()) {
|
||||
// If this is not a packaged build the resources are likely symlinks to
|
||||
// outside the binary dir. Therefore in non-release builds we allow reads
|
||||
// from the whole repository. MOZ_DEVELOPER_REPO_DIR is set by mach run.
|
||||
const char* developer_repo_dir = PR_GetEnv("MOZ_DEVELOPER_REPO_DIR");
|
||||
if (developer_repo_dir) {
|
||||
policy->AddDir(rdonly, developer_repo_dir);
|
||||
|
|
@ -857,10 +857,10 @@ SandboxBrokerPolicyFactory::GetRDDPolicy(int aPid) {
|
|||
}
|
||||
}
|
||||
|
||||
if (mozilla::IsDevelopmentBuild()) {
|
||||
// If this is a developer build the resources are symlinks to outside the
|
||||
// binary dir. Therefore in non-release builds we allow reads from the whole
|
||||
// repository. MOZ_DEVELOPER_REPO_DIR is set by mach run.
|
||||
if (!mozilla::IsPackagedBuild()) {
|
||||
// If this is not a packaged build the resources are likely symlinks to
|
||||
// outside the binary dir. Therefore in non-release builds we allow reads
|
||||
// from the whole repository. MOZ_DEVELOPER_REPO_DIR is set by mach run.
|
||||
const char* developer_repo_dir = PR_GetEnv("MOZ_DEVELOPER_REPO_DIR");
|
||||
if (developer_repo_dir) {
|
||||
policy->AddDir(rdonly, developer_repo_dir);
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ bool SandboxBroker::LaunchApp(const wchar_t* aPath, const wchar_t* aArguments,
|
|||
// Enable the child process to write log files when setup
|
||||
AddMozLogRulesToPolicy(mPolicy, aEnvironment);
|
||||
|
||||
if (mozilla::IsDevelopmentBuild()) {
|
||||
if (!mozilla::IsPackagedBuild()) {
|
||||
AddDeveloperRepoDirToPolicy(mPolicy);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@ bool JOG::EnsureRuntimeMetricsRegistered(bool aForce) {
|
|||
|
||||
MOZ_LOG(sLog, LogLevel::Debug, ("Determining whether there's JOG for you."));
|
||||
|
||||
if (!mozilla::IsDevelopmentBuild()) {
|
||||
if (mozilla::IsPackagedBuild()) {
|
||||
// Supporting Artifact Builds is a developer-only thing.
|
||||
// We're on the main thread here.
|
||||
// Let's not spend any more time than we need to.
|
||||
MOZ_LOG(sLog, LogLevel::Debug, ("!IsDevelopmentBuild. No JOG for you."));
|
||||
MOZ_LOG(sLog, LogLevel::Debug, ("IsPackagedBuild. No JOG for you."));
|
||||
return false;
|
||||
}
|
||||
// The metrics we need to process were placed in GreD in jogfile.json
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class JOG {
|
|||
*
|
||||
* Locates the runtime metrics file and, if present, loads and processes it.
|
||||
*
|
||||
* Only does any work at all if mozilla::IsDevelopmentBuild()
|
||||
* Only does any work at all if !mozilla::IsPackagedBuild()
|
||||
*
|
||||
* **Note:** When this function does something, it is expensive, running
|
||||
* synchronous file I/O to ensure that the registration is complete when this
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ static nsresult GetDirFromBundlePlist(const nsAString& aKey, nsIFile** aDir) {
|
|||
|
||||
nsresult nsMacUtilsImpl::GetRepoDir(nsIFile** aRepoDir) {
|
||||
#if defined(MOZ_SANDBOX)
|
||||
MOZ_ASSERT(mozilla::IsDevelopmentBuild());
|
||||
MOZ_ASSERT(!mozilla::IsPackagedBuild());
|
||||
#endif
|
||||
return GetDirFromBundlePlist(NS_LITERAL_STRING_FROM_CSTRING(MAC_DEV_REPO_KEY),
|
||||
aRepoDir);
|
||||
|
|
@ -350,7 +350,7 @@ nsresult nsMacUtilsImpl::GetRepoDir(nsIFile** aRepoDir) {
|
|||
|
||||
nsresult nsMacUtilsImpl::GetObjDir(nsIFile** aObjDir) {
|
||||
#if defined(MOZ_SANDBOX)
|
||||
MOZ_ASSERT(mozilla::IsDevelopmentBuild());
|
||||
MOZ_ASSERT(!mozilla::IsPackagedBuild());
|
||||
#endif
|
||||
return GetDirFromBundlePlist(NS_LITERAL_STRING_FROM_CSTRING(MAC_DEV_OBJ_KEY),
|
||||
aObjDir);
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ class Omnijar {
|
|||
* 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);
|
||||
inline bool IsPackagedBuild() {
|
||||
return Omnijar::HasOmnijar(mozilla::Omnijar::GRE);
|
||||
}
|
||||
|
||||
} /* namespace mozilla */
|
||||
|
|
|
|||
Loading…
Reference in a new issue