Remove calls to deprecated MessageLoop methods from mojo/.
This CL removes calls to these methods from mojo/ files: - MessageLoop::PostTask - MessageLoop::PostDelayedTask - MessageLoop::ReleaseSoon - MessageLoop::DeleteSoon - MessageLoop::Run - MessageLoop::RunUntilIdle BUG=616447 Review-Url: https://codereview.chromium.org/2272253003 Cr-Commit-Position: refs/heads/master@{#415407}
This commit is contained in:
mojo/android/system
@ -10,7 +10,10 @@
|
||||
#include "base/android/jni_android.h"
|
||||
#include "base/android/jni_registrar.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "jni/BaseRunLoop_jni.h"
|
||||
|
||||
using base::android::JavaParamRef;
|
||||
@ -25,15 +28,13 @@ static jlong CreateBaseRunLoop(JNIEnv* env,
|
||||
}
|
||||
|
||||
static void Run(JNIEnv* env,
|
||||
const JavaParamRef<jobject>& jcaller,
|
||||
jlong runLoopID) {
|
||||
reinterpret_cast<base::MessageLoop*>(runLoopID)->Run();
|
||||
const JavaParamRef<jobject>& jcaller) {
|
||||
base::RunLoop().Run();
|
||||
}
|
||||
|
||||
static void RunUntilIdle(JNIEnv* env,
|
||||
const JavaParamRef<jobject>& jcaller,
|
||||
jlong runLoopID) {
|
||||
reinterpret_cast<base::MessageLoop*>(runLoopID)->RunUntilIdle();
|
||||
const JavaParamRef<jobject>& jcaller) {
|
||||
base::RunLoop().RunUntilIdle();
|
||||
}
|
||||
|
||||
static void Quit(JNIEnv* env,
|
||||
@ -58,9 +59,10 @@ static void PostDelayedTask(JNIEnv* env,
|
||||
// use it across threads. |RunJavaRunnable| will acquire a new JNIEnv before
|
||||
// running the Runnable.
|
||||
runnable_ref.Reset(env, runnable);
|
||||
reinterpret_cast<base::MessageLoop*>(runLoopID)->PostDelayedTask(
|
||||
FROM_HERE, base::Bind(&RunJavaRunnable, runnable_ref),
|
||||
base::TimeDelta::FromMicroseconds(delay));
|
||||
reinterpret_cast<base::MessageLoop*>(runLoopID)
|
||||
->task_runner()
|
||||
->PostDelayedTask(FROM_HERE, base::Bind(&RunJavaRunnable, runnable_ref),
|
||||
base::TimeDelta::FromMicroseconds(delay));
|
||||
}
|
||||
|
||||
static void DeleteMessageLoop(JNIEnv* env,
|
||||
|
@ -27,13 +27,13 @@ class BaseRunLoop implements RunLoop {
|
||||
@Override
|
||||
public void run() {
|
||||
assert mRunLoopID != 0 : "The run loop cannot run once closed";
|
||||
nativeRun(mRunLoopID);
|
||||
nativeRun();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runUntilIdle() {
|
||||
assert mRunLoopID != 0 : "The run loop cannot run once closed";
|
||||
nativeRunUntilIdle(mRunLoopID);
|
||||
nativeRunUntilIdle();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,8 +66,8 @@ class BaseRunLoop implements RunLoop {
|
||||
}
|
||||
|
||||
private native long nativeCreateBaseRunLoop();
|
||||
private native void nativeRun(long runLoopID);
|
||||
private native void nativeRunUntilIdle(long runLoopID);
|
||||
private native void nativeRun();
|
||||
private native void nativeRunUntilIdle();
|
||||
private native void nativeQuit(long runLoopID);
|
||||
private native void nativePostDelayedTask(long runLoopID, Runnable runnable, long delay);
|
||||
private native void nativeDeleteMessageLoop(long runLoopID);
|
||||
|
Reference in New Issue
Block a user