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 c38e5d7e06
commit 02ce1ca25c
2 changed files with 36 additions and 2 deletions

View File

@ -118,6 +118,7 @@ nsXREDirProvider::Initialize(nsIFile *aXULAppDir,
}
}
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;