summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/AddonPathService.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 12:46:29 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 12:46:29 +0200
commitb8145b3d592cf0290cc17a6223816b817e3e3b77 (patch)
tree426fae594db93e6f0bc188c35bc022102ef8520b /toolkit/mozapps/extensions/AddonPathService.cpp
parentc75dae3ed21bfa5a8ae46cd83d18329af5bea05a (diff)
downloadUXP-b8145b3d592cf0290cc17a6223816b817e3e3b77.tar
UXP-b8145b3d592cf0290cc17a6223816b817e3e3b77.tar.gz
UXP-b8145b3d592cf0290cc17a6223816b817e3e3b77.tar.lz
UXP-b8145b3d592cf0290cc17a6223816b817e3e3b77.tar.xz
UXP-b8145b3d592cf0290cc17a6223816b817e3e3b77.zip
Bug 1263935 - Expose native version of mapURIToAddonId via amIAddonPathService
Issue #102
Diffstat (limited to 'toolkit/mozapps/extensions/AddonPathService.cpp')
-rw-r--r--toolkit/mozapps/extensions/AddonPathService.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/toolkit/mozapps/extensions/AddonPathService.cpp b/toolkit/mozapps/extensions/AddonPathService.cpp
index 006149100..ddfdbe817 100644
--- a/toolkit/mozapps/extensions/AddonPathService.cpp
+++ b/toolkit/mozapps/extensions/AddonPathService.cpp
@@ -128,6 +128,16 @@ AddonPathService::InsertPath(const nsAString& path, const nsAString& addonIdStri
return NS_OK;
}
+NS_IMETHODIMP
+AddonPathService::MapURIToAddonId(nsIURI* aURI, nsAString& addonIdString)
+{
+ if (JSAddonId* id = MapURIToAddonID(aURI)) {
+ JSFlatString* flat = JS_ASSERT_STRING_IS_FLAT(JS::StringOfAddonId(id));
+ AssignJSFlatString(addonIdString, flat);
+ }
+ return NS_OK;
+}
+
static nsresult
ResolveURI(nsIURI* aURI, nsAString& out)
{