Bug 620931 part 4 - Fix resource://app/ to always point to the same as resource:///. r=bsmedberg

This commit is contained in:
Mike Hommey 2011-05-10 15:50:15 +02:00
parent 7de58a1cfa
commit addaf9f17c
2 changed files with 7 additions and 3 deletions

View File

@ -76,6 +76,7 @@ static nsResProtocolHandler *gResHandler = nsnull;
static PRLogModuleInfo *gResLog;
#endif
#define kAPP NS_LITERAL_CSTRING("app")
#define kGRE NS_LITERAL_CSTRING("gre")
//----------------------------------------------------------------------------
@ -180,6 +181,12 @@ nsResProtocolHandler::Init()
rv = SetSubstitution(EmptyCString(), uri);
NS_ENSURE_SUCCESS(rv, rv);
//
// make resource://app/ point to the application directory or omnijar
//
rv = SetSubstitution(kAPP, uri);
NS_ENSURE_SUCCESS(rv, rv);
//
// make resource://gre/ point to the GRE directory
//

View File

@ -301,9 +301,6 @@ nsXREDirProvider::GetFile(const char* aProperty, PRBool* aPersistent,
if (NS_SUCCEEDED(rv))
file = lf;
}
else if (!strcmp(aProperty, "resource:app")) {
rv = GetAppDir()->Clone(getter_AddRefs(file));
}
else if (!strcmp(aProperty, NS_APP_PROFILE_DIR_STARTUP) && mProfileDir) {
return mProfileDir->Clone(aFile);