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_android.h"
|
||||||
#include "base/android/jni_registrar.h"
|
#include "base/android/jni_registrar.h"
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
|
#include "base/logging.h"
|
||||||
#include "base/message_loop/message_loop.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"
|
#include "jni/BaseRunLoop_jni.h"
|
||||||
|
|
||||||
using base::android::JavaParamRef;
|
using base::android::JavaParamRef;
|
||||||
@@ -25,15 +28,13 @@ static jlong CreateBaseRunLoop(JNIEnv* env,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void Run(JNIEnv* env,
|
static void Run(JNIEnv* env,
|
||||||
const JavaParamRef<jobject>& jcaller,
|
const JavaParamRef<jobject>& jcaller) {
|
||||||
jlong runLoopID) {
|
base::RunLoop().Run();
|
||||||
reinterpret_cast<base::MessageLoop*>(runLoopID)->Run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RunUntilIdle(JNIEnv* env,
|
static void RunUntilIdle(JNIEnv* env,
|
||||||
const JavaParamRef<jobject>& jcaller,
|
const JavaParamRef<jobject>& jcaller) {
|
||||||
jlong runLoopID) {
|
base::RunLoop().RunUntilIdle();
|
||||||
reinterpret_cast<base::MessageLoop*>(runLoopID)->RunUntilIdle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Quit(JNIEnv* env,
|
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
|
// use it across threads. |RunJavaRunnable| will acquire a new JNIEnv before
|
||||||
// running the Runnable.
|
// running the Runnable.
|
||||||
runnable_ref.Reset(env, runnable);
|
runnable_ref.Reset(env, runnable);
|
||||||
reinterpret_cast<base::MessageLoop*>(runLoopID)->PostDelayedTask(
|
reinterpret_cast<base::MessageLoop*>(runLoopID)
|
||||||
FROM_HERE, base::Bind(&RunJavaRunnable, runnable_ref),
|
->task_runner()
|
||||||
base::TimeDelta::FromMicroseconds(delay));
|
->PostDelayedTask(FROM_HERE, base::Bind(&RunJavaRunnable, runnable_ref),
|
||||||
|
base::TimeDelta::FromMicroseconds(delay));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DeleteMessageLoop(JNIEnv* env,
|
static void DeleteMessageLoop(JNIEnv* env,
|
||||||
|
@@ -27,13 +27,13 @@ class BaseRunLoop implements RunLoop {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
assert mRunLoopID != 0 : "The run loop cannot run once closed";
|
assert mRunLoopID != 0 : "The run loop cannot run once closed";
|
||||||
nativeRun(mRunLoopID);
|
nativeRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runUntilIdle() {
|
public void runUntilIdle() {
|
||||||
assert mRunLoopID != 0 : "The run loop cannot run once closed";
|
assert mRunLoopID != 0 : "The run loop cannot run once closed";
|
||||||
nativeRunUntilIdle(mRunLoopID);
|
nativeRunUntilIdle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -66,8 +66,8 @@ class BaseRunLoop implements RunLoop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private native long nativeCreateBaseRunLoop();
|
private native long nativeCreateBaseRunLoop();
|
||||||
private native void nativeRun(long runLoopID);
|
private native void nativeRun();
|
||||||
private native void nativeRunUntilIdle(long runLoopID);
|
private native void nativeRunUntilIdle();
|
||||||
private native void nativeQuit(long runLoopID);
|
private native void nativeQuit(long runLoopID);
|
||||||
private native void nativePostDelayedTask(long runLoopID, Runnable runnable, long delay);
|
private native void nativePostDelayedTask(long runLoopID, Runnable runnable, long delay);
|
||||||
private native void nativeDeleteMessageLoop(long runLoopID);
|
private native void nativeDeleteMessageLoop(long runLoopID);
|
||||||
|
Reference in New Issue
Block a user