Bug 1257319 - Remove BROADCAST GeckoEvent; r=me

Remove the now-obsolete BROADCAST GeckoEvent.
This commit is contained in:
Jim Chen 2016-03-23 14:42:38 -04:00
Родитель d6e1f310e4
Коммит bcb596d239
5 изменённых файлов: 2 добавлений и 45 удалений

Просмотреть файл

@ -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;