Bug 1344629 - Part 7.5: Add constructors for jni::StringParam that accept literal strings. r=dbaron
☠☠ backed out by 8d1f842be870 ☠ ☠
authorDavid Major <dmajor@mozilla.com>
Tue, 14 Mar 2017 15:26:36 +1300
changeset 347437 2b460fe020afba0b8e3bee63dbab781e63350ef2
parent 347436 0ada91b0452e646a8e394e34f84fd3ad9160a2fc
child 347438 d9b330f9bc245c8bea3333aef3d47e1454d47180
push id31496
push usercbook@mozilla.com
push dateTue, 14 Mar 2017 13:21:57 +0000
treeherdermozilla-central@9a26ed658fdc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1344629
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1344629 - Part 7.5: Add constructors for jni::StringParam that accept literal strings. r=dbaron MozReview-Commit-ID: 8vSf7TGwPmD
widget/android/jni/Refs.h
--- a/widget/android/jni/Refs.h
+++ b/widget/android/jni/Refs.h
@@ -743,26 +743,36 @@ public:
         , mEnv(nullptr)
     {}
 
     MOZ_IMPLICIT StringParam(const nsAString& str, JNIEnv* env = Ref::FindEnv())
         : Ref(GetString(env, str))
         , mEnv(env)
     {}
 
+    MOZ_IMPLICIT StringParam(const nsLiteralString& str, JNIEnv* env = Ref::FindEnv())
+        : Ref(GetString(env, str))
+        , mEnv(env)
+    {}
+
     MOZ_IMPLICIT StringParam(const char16_t* str, JNIEnv* env = Ref::FindEnv())
         : Ref(GetString(env, nsDependentString(str)))
         , mEnv(env)
     {}
 
     MOZ_IMPLICIT StringParam(const nsACString& str, JNIEnv* env = Ref::FindEnv())
         : Ref(GetString(env, NS_ConvertUTF8toUTF16(str)))
         , mEnv(env)
     {}
 
+    MOZ_IMPLICIT StringParam(const nsLiteralCString& str, JNIEnv* env = Ref::FindEnv())
+        : Ref(GetString(env, NS_ConvertUTF8toUTF16(str)))
+        , mEnv(env)
+    {}
+
     MOZ_IMPLICIT StringParam(const char* str, JNIEnv* env = Ref::FindEnv())
         : Ref(GetString(env, NS_ConvertUTF8toUTF16(str)))
         , mEnv(env)
     {}
 
     StringParam(StringParam&& other)
         : Ref(other.Get())
         , mEnv(other.mEnv)