Bug 1277624 - Don't use anonymous namespace in headers; r=me

Trivial patch to not use anonymous namespace in headers, which can
introduce multiple copies of the same code in different compilation
units.
This commit is contained in:
Jim Chen 2016-06-27 14:49:55 -04:00
Родитель 7b8185966f
Коммит 9f20364a07
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -11,7 +11,7 @@
namespace mozilla {
namespace jni {
namespace {
namespace detail {
// Helper class to convert an arbitrary type to a jvalue, e.g. Value(123).val.
struct Value
@ -29,8 +29,9 @@ struct Value
jvalue val;
};
}
} // namespace detail
using namespace detail;
// Base class for Method<>, Field<>, and Constructor<>.
class Accessor

Просмотреть файл

@ -71,9 +71,9 @@ namespace jni {
* };
*/
namespace {
namespace detail {
uintptr_t CheckNativeHandle(JNIEnv* env, uintptr_t handle)
inline uintptr_t CheckNativeHandle(JNIEnv* env, uintptr_t handle)
{
if (!handle) {
if (!env->ExceptionCheck()) {
@ -173,7 +173,9 @@ struct NativePtr<Impl, /* UseWeakPtr = */ true>
}
};
} // namespace
} // namespace detail
using namespace detail;
/**
* For C++ classes whose native methods all return void, they can choose to
@ -222,10 +224,6 @@ namespace detail {
template<class Traits, class Impl, class Args, bool IsStatic, bool IsVoid>
class NativeStubImpl;
}
namespace {
// ProxyArg is used to handle JNI ref arguments for proxies. Because a proxied
// call may happen outside of the original JNI native call, we must save all
// JNI ref arguments as global refs to avoid the arguments going out of scope.
@ -417,7 +415,7 @@ Dispatch(ProxyNativeCall<Impl, O, S, V, A...>&& call)
template<typename T>
void Dispatch(const T&) {}
} // namespace
} // namespace detail
template<class Cls, class Impl> class NativeImpl;