зеркало из https://github.com/mozilla/gecko-dev.git
Necko only changes for the setting relative path.
This commit is contained in:
Родитель
b44058b222
Коммит
e37d05ffaa
|
@ -118,15 +118,17 @@ nsChromeProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI,
|
|||
nsIURI* url;
|
||||
if (aBaseURI) {
|
||||
rv = aBaseURI->Clone(&url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = url->SetRelativePath(aSpec);
|
||||
}
|
||||
else {
|
||||
rv = nsComponentManager::CreateInstance(kStandardURLCID, nsnull,
|
||||
nsCOMTypeInfo<nsIURI>::GetIID(),
|
||||
(void**)&url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = url->SetSpec((char*)aSpec);
|
||||
}
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = url->SetSpec((char*)aSpec);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(url);
|
||||
return rv;
|
||||
|
|
|
@ -256,7 +256,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
|
|||
#endif
|
||||
|
||||
// Construct a chrome URL and use it to look up a resource.
|
||||
nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/";
|
||||
nsAutoString windowType = nsAutoString("chrome://") + hostStr ;
|
||||
|
||||
// Stash any search part of the URL for later
|
||||
#ifdef NECKO
|
||||
|
@ -293,12 +293,12 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
|
|||
if (slashIndex == -1)
|
||||
slashIndex = restOfURL.Length();
|
||||
|
||||
restOfURL.Mid(packageType, 1, slashIndex - 1);
|
||||
restOfURL.Mid(packageType, 0, slashIndex);
|
||||
|
||||
if (slashIndex < restOfURL.Length()-1)
|
||||
{
|
||||
// There are some extra subdirectories to remember.
|
||||
restOfURL.Right(path, restOfURL.Length()-slashIndex-1);
|
||||
restOfURL.Right(path, restOfURL.Length()-slashIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ public:
|
|||
nsresult Eval() {
|
||||
nsresult rv;
|
||||
|
||||
//TODO Change this to GetSpec and then skip past the javascript:
|
||||
// Get the expression:
|
||||
char* jsExpr;
|
||||
rv = mURI->GetPath(&jsExpr);
|
||||
|
|
|
@ -118,15 +118,17 @@ nsChromeProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI,
|
|||
nsIURI* url;
|
||||
if (aBaseURI) {
|
||||
rv = aBaseURI->Clone(&url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = url->SetRelativePath(aSpec);
|
||||
}
|
||||
else {
|
||||
rv = nsComponentManager::CreateInstance(kStandardURLCID, nsnull,
|
||||
nsCOMTypeInfo<nsIURI>::GetIID(),
|
||||
(void**)&url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = url->SetSpec((char*)aSpec);
|
||||
}
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = url->SetSpec((char*)aSpec);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(url);
|
||||
return rv;
|
||||
|
|
|
@ -256,7 +256,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
|
|||
#endif
|
||||
|
||||
// Construct a chrome URL and use it to look up a resource.
|
||||
nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/";
|
||||
nsAutoString windowType = nsAutoString("chrome://") + hostStr ;
|
||||
|
||||
// Stash any search part of the URL for later
|
||||
#ifdef NECKO
|
||||
|
@ -293,12 +293,12 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
|
|||
if (slashIndex == -1)
|
||||
slashIndex = restOfURL.Length();
|
||||
|
||||
restOfURL.Mid(packageType, 1, slashIndex - 1);
|
||||
restOfURL.Mid(packageType, 0, slashIndex);
|
||||
|
||||
if (slashIndex < restOfURL.Length()-1)
|
||||
{
|
||||
// There are some extra subdirectories to remember.
|
||||
restOfURL.Right(path, restOfURL.Length()-slashIndex-1);
|
||||
restOfURL.Right(path, restOfURL.Length()-slashIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче