зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1257319 - Remove BROADCAST GeckoEvent; r=me
Remove the now-obsolete BROADCAST GeckoEvent.
This commit is contained in:
Родитель
d6e1f310e4
Коммит
bcb596d239
|
@ -77,7 +77,6 @@ public class GeckoEvent {
|
|||
APP_FOREGROUNDING(10),
|
||||
LOAD_URI(12),
|
||||
NOOP(15),
|
||||
BROADCAST(19),
|
||||
VIEWPORT(20),
|
||||
VISITED(21),
|
||||
NETWORK_CHANGED(22),
|
||||
|
@ -461,14 +460,6 @@ public class GeckoEvent {
|
|||
return event;
|
||||
}
|
||||
|
||||
@RobocopTarget
|
||||
public static GeckoEvent createBroadcastEvent(String subject, String data) {
|
||||
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.BROADCAST);
|
||||
event.mCharacters = subject;
|
||||
event.mCharactersExtra = data;
|
||||
return event;
|
||||
}
|
||||
|
||||
public static GeckoEvent createViewportEvent(ImmutableViewportMetrics metrics, DisplayPortMetrics displayPort) {
|
||||
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.VIEWPORT);
|
||||
event.mCharacters = "Viewport:Change";
|
||||
|
|
|
@ -63,29 +63,6 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *jenv, jclass jc,
|
|||
nsAppShell::PostEvent(AndroidGeckoEvent::MakeFromJavaObject(jenv, event));
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoObservers(JNIEnv *aEnv, jclass,
|
||||
jstring aTopic, jstring aData)
|
||||
{
|
||||
if (!NS_IsMainThread()) {
|
||||
jni::ThrowException(aEnv,
|
||||
"java/lang/IllegalThreadStateException", "Not on Gecko main thread");
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> obsServ =
|
||||
mozilla::services::GetObserverService();
|
||||
if (!obsServ) {
|
||||
jni::ThrowException(aEnv,
|
||||
"java/lang/IllegalStateException", "No observer service");
|
||||
return;
|
||||
}
|
||||
|
||||
const nsJNICString topic(aTopic, aEnv);
|
||||
const nsJNIString data(aData, aEnv);
|
||||
obsServ->NotifyObservers(nullptr, topic.get(), data.get());
|
||||
}
|
||||
|
||||
NS_EXPORT jlong JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_runUiThreadCallback(JNIEnv* env, jclass)
|
||||
{
|
||||
|
|
|
@ -390,8 +390,7 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj)
|
|||
break;
|
||||
}
|
||||
|
||||
case VIEWPORT:
|
||||
case BROADCAST: {
|
||||
case VIEWPORT: {
|
||||
ReadCharactersField(jenv);
|
||||
ReadCharactersExtraField(jenv);
|
||||
break;
|
||||
|
|
|
@ -444,14 +444,6 @@ public:
|
|||
return event;
|
||||
}
|
||||
|
||||
static AndroidGeckoEvent* MakeBroadcastEvent(const nsCString& topic, const nsCString& data) {
|
||||
AndroidGeckoEvent* event = new AndroidGeckoEvent();
|
||||
event->Init(BROADCAST);
|
||||
CopyUTF8toUTF16(topic, event->mCharacters);
|
||||
CopyUTF8toUTF16(data, event->mCharactersExtra);
|
||||
return event;
|
||||
}
|
||||
|
||||
static AndroidGeckoEvent* MakeAddObserver(const nsAString &key, nsIObserver *observer) {
|
||||
AndroidGeckoEvent *event = new AndroidGeckoEvent();
|
||||
event->Init(ADD_OBSERVER);
|
||||
|
@ -641,7 +633,6 @@ public:
|
|||
LOAD_URI = 12,
|
||||
NOOP = 15,
|
||||
APZ_INPUT_EVENT = 17, // used internally in AndroidJNI/nsAppShell/nsWindow
|
||||
BROADCAST = 19,
|
||||
VIEWPORT = 20,
|
||||
VISITED = 21,
|
||||
NETWORK_CHANGED = 22,
|
||||
|
|
|
@ -678,8 +678,7 @@ nsAppShell::LegacyGeckoEvent::Run()
|
|||
break;
|
||||
}
|
||||
|
||||
case AndroidGeckoEvent::VIEWPORT:
|
||||
case AndroidGeckoEvent::BROADCAST: {
|
||||
case AndroidGeckoEvent::VIEWPORT: {
|
||||
if (curEvent->Characters().Length() == 0)
|
||||
break;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче