зеркало из https://github.com/mozilla/pjs.git
[mq]: Backout changeset 78e519331f40 because of build bustage on android
This commit is contained in:
Родитель
a765395a4a
Коммит
c4f2ee1b35
|
@ -4648,7 +4648,6 @@ cairo-android)
|
|||
TK_LIBS='$(MOZ_CAIRO_LIBS)'
|
||||
MOZ_WEBGL=1
|
||||
MOZ_PDF_PRINTING=1
|
||||
MOZ_INSTRUMENT_EVENT_LOOP=1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
|
|
@ -1567,23 +1567,4 @@ public class GeckoAppShell
|
|||
sCameraBuffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static SynchronousQueue<Date> sTracerQueue = new SynchronousQueue<Date>();
|
||||
public static void fireAndWaitForTracerEvent() {
|
||||
getMainHandler().post(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
sTracerQueue.put(new Date());
|
||||
} catch(InterruptedException ie) {
|
||||
Log.w("GeckoAppShell", "exception firing tracer", ie);
|
||||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
sTracerQueue.take();
|
||||
} catch(InterruptedException ie) {
|
||||
Log.w("GeckoAppShell", "exception firing tracer", ie);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
#include "nsOSHelperAppService.h"
|
||||
#include "nsWindow.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ALOG_BRIDGE(args...) ALOG(args)
|
||||
|
@ -147,7 +146,6 @@ AndroidBridge::Init(JNIEnv *jEnv,
|
|||
jScanMedia = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "scanMedia", "(Ljava/lang/String;Ljava/lang/String;)V");
|
||||
jGetSystemColors = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getSystemColors", "()[I");
|
||||
jGetIconForExtension = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getIconForExtension", "(Ljava/lang/String;I)[B");
|
||||
jFireAndWaitForTracerEvent = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "fireAndWaitForTracerEvent", "()V");
|
||||
jCreateShortcut = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "createShortcut", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
||||
jGetShowPasswordSetting = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getShowPasswordSetting", "()Z");
|
||||
jPostToJavaThread = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "postToJavaThread", "(Z)V");
|
||||
|
@ -1012,77 +1010,6 @@ AndroidBridge::OpenGraphicsLibraries()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::FireAndWaitForTracerEvent() {
|
||||
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass,
|
||||
jFireAndWaitForTracerEvent);
|
||||
}
|
||||
|
||||
|
||||
namespace mozilla {
|
||||
class TracerRunnable : public nsRunnable{
|
||||
public:
|
||||
TracerRunnable() {
|
||||
mTracerLock = new Mutex("TracerRunnable");
|
||||
mTracerCondVar = new CondVar(*mTracerLock, "TracerRunnable");
|
||||
mMainThread = do_GetMainThread();
|
||||
|
||||
}
|
||||
~TracerRunnable() {
|
||||
delete mTracerCondVar;
|
||||
delete mTracerLock;
|
||||
mTracerLock = nsnull;
|
||||
mTracerCondVar = nsnull;
|
||||
}
|
||||
|
||||
virtual nsresult Run() {
|
||||
MutexAutoLock lock(*mTracerLock);
|
||||
if (!AndroidBridge::Bridge())
|
||||
return NS_OK;
|
||||
|
||||
AndroidBridge::Bridge()->FireAndWaitForTracerEvent();
|
||||
mHasRun = PR_TRUE;
|
||||
mTracerCondVar->Notify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool Fire() {
|
||||
if (!mTracerLock || !mTracerCondVar)
|
||||
return false;
|
||||
MutexAutoLock lock(*mTracerLock);
|
||||
mHasRun = PR_FALSE;
|
||||
mMainThread->Dispatch(this, NS_DISPATCH_NORMAL);
|
||||
while (!mHasRun)
|
||||
mTracerCondVar->Wait();
|
||||
return true;
|
||||
}
|
||||
private:
|
||||
Mutex* mTracerLock;
|
||||
CondVar* mTracerCondVar;
|
||||
PRBool mHasRun;
|
||||
nsCOMPtr<nsIThread> mMainThread;
|
||||
|
||||
};
|
||||
nsCOMPtr<TracerRunnable> sTracerRunnable;
|
||||
|
||||
bool InitWidgetTracing() {
|
||||
if (!sTracerRunnable)
|
||||
sTracerRunnable = new TracerRunnable();
|
||||
return true;
|
||||
}
|
||||
|
||||
void CleanUpWidgetTracing() {
|
||||
if (sTracerRunnable)
|
||||
delete sTracerRunnable;
|
||||
sTracerRunnable = nsnull;
|
||||
}
|
||||
|
||||
bool FireAndWaitForTracerEvent() {
|
||||
if (sTracerRunnable)
|
||||
return sTracerRunnable->Fire();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool
|
||||
AndroidBridge::HasNativeBitmapAccess()
|
||||
{
|
||||
|
|
|
@ -213,8 +213,6 @@ public:
|
|||
|
||||
bool GetShowPasswordSetting();
|
||||
|
||||
void FireAndWaitForTracerEvent();
|
||||
|
||||
struct AutoLocalJNIFrame {
|
||||
AutoLocalJNIFrame(int nEntries = 128) : mEntries(nEntries) {
|
||||
// Make sure there is enough space to store a local ref to the
|
||||
|
@ -352,7 +350,6 @@ protected:
|
|||
jmethodID jScanMedia;
|
||||
jmethodID jGetSystemColors;
|
||||
jmethodID jGetIconForExtension;
|
||||
jmethodID jFireAndWaitForTracerEvent;
|
||||
jmethodID jCreateShortcut;
|
||||
jmethodID jGetShowPasswordSetting;
|
||||
jmethodID jPostToJavaThread;
|
||||
|
|
Загрузка…
Ссылка в новой задаче