WebWorkers: New c++ interface for NativeRunnable

Reviewed By: mhorowitz, lexs

Differential Revision: D2779083

fb-gh-sync-id: dc36b71504b4e74b1671bb48f72d001c9c87721b
This commit is contained in:
Andy Street
2016-01-06 04:16:44 -08:00
committed by facebook-github-bot-3
parent 7d70b86a7b
commit cf350a69de
4 changed files with 80 additions and 8 deletions

View File

@@ -9,20 +9,19 @@
package com.facebook.react.bridge.queue;
import com.facebook.jni.Countable;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
/**
* A Runnable that has a native run implementation.
*/
@DoNotStrip
public class NativeRunnable extends Countable implements Runnable {
public class NativeRunnable implements Runnable {
/**
* Should only be instantiated via native (JNI) code.
*/
@DoNotStrip
private NativeRunnable() {
private final HybridData mHybridData;
private NativeRunnable(HybridData hybridData) {
mHybridData = hybridData;
}
public native void run();

View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.facebook.react.bridge.queue;
import com.facebook.jni.Countable;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
/**
* A Runnable that has a native run implementation.
*/
@DoNotStrip
public class NativeRunnableDeprecated extends Countable implements Runnable {
@DoNotStrip
private NativeRunnableDeprecated() {
}
public native void run();
}