зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 763cc10e0bb1 (bug 1144127) for B2G reftest bustage.
--HG-- extra : rebase_source : d907c21617681811bc41fb5f563259af8c514dde
This commit is contained in:
Родитель
7c658cfe88
Коммит
da8ce3499b
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче