-
Notifications
You must be signed in to change notification settings - Fork 15
/
nsResProtocolHandler-old-behaviour.diff
43 lines (39 loc) · 1.47 KB
/
nsResProtocolHandler-old-behaviour.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp
index 97788082f..9c977f048 100644
--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
@@ -9,6 +9,7 @@
#include "nsResProtocolHandler.h"
#include "nsIIOService.h"
+#include "nsDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "nsNetUtil.h"
#include "nsURLHelper.h"
@@ -131,11 +132,18 @@ nsResProtocolHandler::Init()
rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::GRE, greURI);
NS_ENSURE_SUCCESS(rv, rv);
+
//
// make resource:/// point to the application directory or omnijar
//
+ nsCOMPtr<nsIFile> file;
+ rv = NS_GetSpecialDirectory(NS_OS_CURRENT_PROCESS_DIR, getter_AddRefs(file));
+ NS_ENSURE_SUCCESS(rv, rv);
+ nsCOMPtr<nsIFile> parent;
+ file->GetParent(getter_AddRefs(parent));
+
nsCOMPtr<nsIURI> uri;
- rv = NS_NewURI(getter_AddRefs(uri), appURI.Length() ? appURI : greURI);
+ rv = mIOService->NewFileURI(parent, getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv);
rv = SetSubstitution(EmptyCString(), uri);
@@ -144,6 +152,10 @@ nsResProtocolHandler::Init()
//
// make resource://app/ point to the application directory or omnijar
//
+ //nsCOMPtr<nsIURI> uri;
+ rv = NS_NewURI(getter_AddRefs(uri), appURI.Length() ? appURI : greURI);
+ NS_ENSURE_SUCCESS(rv, rv);
+
rv = SetSubstitution(kAPP, uri);
NS_ENSURE_SUCCESS(rv, rv);