Backed out changeset 763cc10e0bb1 (bug 1144127) for B2G reftest bustage.

This commit is contained in:
Ryan VanderMeulen 2015-03-20 12:23:11 -04:00
parent 70285ec3f2
commit 78913c4393
2 changed files with 36 additions and 2 deletions

View File

@ -113,11 +113,12 @@ nsXREDirProvider::Initialize(nsIFile *aXULAppDir,
if (app) {
bool per = false;
app->GetFile(NS_APP_USER_PROFILE_50_DIR, &per, getter_AddRefs(mProfileDir));
NS_ASSERTION(per, "NS_APP_USER_PROFILE_50_DIR must be persistent!");
NS_ASSERTION(mProfileDir, "NS_APP_USER_PROFILE_50_DIR not defined! This shouldn't happen!");
NS_ASSERTION(per, "NS_APP_USER_PROFILE_50_DIR must be persistent!");
NS_ASSERTION(mProfileDir, "NS_APP_USER_PROFILE_50_DIR not defined! This shouldn't happen!");
}
}
LoadAppBundleDirs();
return NS_OK;
}
@ -643,6 +644,36 @@ nsXREDirProvider::LoadExtensionBundleDirectories()
}
}
void
nsXREDirProvider::LoadAppBundleDirs()
{
nsCOMPtr<nsIFile> dir;
bool persistent = false;
nsresult rv = GetFile(XRE_APP_DISTRIBUTION_DIR, &persistent, getter_AddRefs(dir));
if (NS_FAILED(rv))
return;
dir->AppendNative(NS_LITERAL_CSTRING("bundles"));
nsCOMPtr<nsISimpleEnumerator> e;
rv = dir->GetDirectoryEntries(getter_AddRefs(e));
if (NS_FAILED(rv))
return;
nsCOMPtr<nsIDirectoryEnumerator> files = do_QueryInterface(e);
if (!files)
return;
nsCOMPtr<nsIFile> subdir;
while (NS_SUCCEEDED(files->GetNextFile(getter_AddRefs(subdir))) && subdir) {
mAppBundleDirectories.AppendObject(subdir);
nsCOMPtr<nsIFile> manifest =
CloneAndAppend(subdir, "chrome.manifest");
XRE_AddManifestLocation(NS_COMPONENT_LOCATION, manifest);
}
}
static const char *const kAppendPrefDir[] = { "defaults", "preferences", nullptr };
#ifdef DEBUG_bsmedberg

View File

@ -127,6 +127,9 @@ protected:
// Calculate and register extension and theme bundle directories.
void LoadExtensionBundleDirectories();
// Calculate and register app-bundled extension directories.
void LoadAppBundleDirs();
void Append(nsIFile* aDirectory);
nsCOMPtr<nsIDirectoryServiceProvider> mAppProvider;