Bug 1292323 - Update usage of UsesNativeCallProxy; r=snorp

Remove uses of UsesNativeCallProxy and UsesGeckoThreadProxy, now that
they are not needed.

Remove cases where we had to invoke a call in a proxy, because the call
is now specified to be invoked directly in the WrapForJNI annotation,
without the need to go through the proxy.

For SmsManager and AlarmReceiver, we no longer need to manually dispatch
everything to the Gecko thread because that's now handled automatically.
This commit is contained in:
Jim Chen
2016-08-12 23:15:53 -04:00
parent 4c84dd5b3f
commit d7d6d9ceda
10 changed files with 117 additions and 210 deletions

View File

@@ -96,23 +96,10 @@ StaticRefPtr<WakeLockListener> sWakeLockListener;
class GeckoThreadSupport final
: public java::GeckoThread::Natives<GeckoThreadSupport>
, public UsesGeckoThreadProxy
{
static uint32_t sPauseCount;
public:
template<typename Functor>
static void OnNativeCall(Functor&& aCall)
{
if (aCall.IsTarget(&SpeculativeConnect) ||
aCall.IsTarget(&WaitOnGecko)) {
aCall();
return;
}
return UsesGeckoThreadProxy::OnNativeCall(aCall);
}
static void SpeculativeConnect(jni::String::Param aUriStr)
{
if (!NS_IsMainThread()) {
@@ -201,6 +188,8 @@ public:
static void CreateServices(jni::String::Param aCategory, jni::String::Param aData)
{
MOZ_ASSERT(NS_IsMainThread());
nsCString category(aCategory->ToCString());
NS_CreateServicesFromCategory(
@@ -216,19 +205,8 @@ uint32_t GeckoThreadSupport::sPauseCount;
class GeckoAppShellSupport final
: public java::GeckoAppShell::Natives<GeckoAppShellSupport>
, public UsesGeckoThreadProxy
{
public:
template<typename Functor>
static void OnNativeCall(Functor&& aCall)
{
if (aCall.IsTarget(&SyncNotifyObservers)) {
aCall();
return;
}
return UsesGeckoThreadProxy::OnNativeCall(aCall);
}
static void SyncNotifyObservers(jni::String::Param aTopic,
jni::String::Param aData)
{