mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
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:
parent
7b8185966f
commit
9f20364a07
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user