mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1200343 - Remove pref events from GeckoEvent; r=snorp
Now that we use native calls, we can remove the pref-related events from GeckoEvent.
This commit is contained in:
parent
67b18214ea
commit
b0bd9828c5
@ -97,9 +97,6 @@ public class GeckoEvent {
|
||||
LOW_MEMORY(35),
|
||||
NETWORK_LINK_CHANGE(36),
|
||||
TELEMETRY_HISTOGRAM_ADD(37),
|
||||
PREFERENCES_OBSERVE(39),
|
||||
PREFERENCES_GET(40),
|
||||
PREFERENCES_REMOVE_OBSERVERS(41),
|
||||
TELEMETRY_UI_SESSION_START(42),
|
||||
TELEMETRY_UI_SESSION_STOP(43),
|
||||
TELEMETRY_UI_EVENT(44),
|
||||
@ -225,8 +222,6 @@ public class GeckoEvent {
|
||||
private float mGamepadButtonValue;
|
||||
private float[] mGamepadValues;
|
||||
|
||||
private String[] mPrefNames;
|
||||
|
||||
private Object mObject;
|
||||
|
||||
private GeckoEvent(NativeGeckoEvent event) {
|
||||
@ -767,29 +762,6 @@ public class GeckoEvent {
|
||||
return event;
|
||||
}
|
||||
|
||||
@RobocopTarget
|
||||
public static GeckoEvent createPreferencesObserveEvent(int requestId, String[] prefNames) {
|
||||
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.PREFERENCES_OBSERVE);
|
||||
event.mCount = requestId;
|
||||
event.mPrefNames = prefNames;
|
||||
return event;
|
||||
}
|
||||
|
||||
@RobocopTarget
|
||||
public static GeckoEvent createPreferencesGetEvent(int requestId, String[] prefNames) {
|
||||
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.PREFERENCES_GET);
|
||||
event.mCount = requestId;
|
||||
event.mPrefNames = prefNames;
|
||||
return event;
|
||||
}
|
||||
|
||||
@RobocopTarget
|
||||
public static GeckoEvent createPreferencesRemoveObserversEvent(int requestId) {
|
||||
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.PREFERENCES_REMOVE_OBSERVERS);
|
||||
event.mCount = requestId;
|
||||
return event;
|
||||
}
|
||||
|
||||
public static GeckoEvent createLowMemoryEvent(int level) {
|
||||
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.LOW_MEMORY);
|
||||
event.mMetaState = level;
|
||||
|
@ -70,7 +70,6 @@ jfieldID AndroidGeckoEvent::jGamepadButtonField = 0;
|
||||
jfieldID AndroidGeckoEvent::jGamepadButtonPressedField = 0;
|
||||
jfieldID AndroidGeckoEvent::jGamepadButtonValueField = 0;
|
||||
jfieldID AndroidGeckoEvent::jGamepadValuesField = 0;
|
||||
jfieldID AndroidGeckoEvent::jPrefNamesField = 0;
|
||||
jfieldID AndroidGeckoEvent::jObjectField = 0;
|
||||
|
||||
jclass AndroidPoint::jPointClass = 0;
|
||||
@ -179,7 +178,6 @@ AndroidGeckoEvent::InitGeckoEventClass(JNIEnv *jEnv)
|
||||
jGamepadButtonPressedField = geckoEvent.getField("mGamepadButtonPressed", "Z");
|
||||
jGamepadButtonValueField = geckoEvent.getField("mGamepadButtonValue", "F");
|
||||
jGamepadValuesField = geckoEvent.getField("mGamepadValues", "[F");
|
||||
jPrefNamesField = geckoEvent.getField("mPrefNames", "[Ljava/lang/String;");
|
||||
jObjectField = geckoEvent.getField("mObject", "Ljava/lang/Object;");
|
||||
}
|
||||
|
||||
@ -609,18 +607,6 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj)
|
||||
break;
|
||||
}
|
||||
|
||||
case PREFERENCES_OBSERVE:
|
||||
case PREFERENCES_GET: {
|
||||
ReadStringArray(mPrefNames, jenv, jPrefNamesField);
|
||||
mCount = jenv->GetIntField(jobj, jCountField);
|
||||
break;
|
||||
}
|
||||
|
||||
case PREFERENCES_REMOVE_OBSERVERS: {
|
||||
mCount = jenv->GetIntField(jobj, jCountField);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -524,7 +524,6 @@ public:
|
||||
const nsTArray<int>& ToolTypes() { return mToolTypes; }
|
||||
const nsTArray<float>& Orientations() { return mOrientations; }
|
||||
const nsTArray<nsIntPoint>& PointRadii() { return mPointRadii; }
|
||||
const nsTArray<nsString>& PrefNames() { return mPrefNames; }
|
||||
double X() { return mX; }
|
||||
double Y() { return mY; }
|
||||
double Z() { return mZ; }
|
||||
@ -621,7 +620,6 @@ protected:
|
||||
float mGamepadButtonValue;
|
||||
nsTArray<float> mGamepadValues;
|
||||
nsCOMPtr<nsIObserver> mObserver;
|
||||
nsTArray<nsString> mPrefNames;
|
||||
MultiTouchInput mApzInput;
|
||||
mozilla::layers::ScrollableLayerGuid mApzGuid;
|
||||
uint64_t mApzInputBlockId;
|
||||
@ -691,7 +689,6 @@ protected:
|
||||
static jfieldID jRangeBackColorField;
|
||||
static jfieldID jRangeLineColorField;
|
||||
static jfieldID jLocationField;
|
||||
static jfieldID jPrefNamesField;
|
||||
|
||||
static jfieldID jConnectionTypeField;
|
||||
static jfieldID jIsWifiField;
|
||||
@ -745,9 +742,6 @@ public:
|
||||
NETWORK_LINK_CHANGE = 36,
|
||||
TELEMETRY_HISTOGRAM_ADD = 37,
|
||||
ADD_OBSERVER = 38,
|
||||
PREFERENCES_OBSERVE = 39,
|
||||
PREFERENCES_GET = 40,
|
||||
PREFERENCES_REMOVE_OBSERVERS = 41,
|
||||
TELEMETRY_UI_SESSION_START = 42,
|
||||
TELEMETRY_UI_SESSION_STOP = 43,
|
||||
TELEMETRY_UI_EVENT = 44,
|
||||
|
@ -723,27 +723,6 @@ nsAppShell::LegacyGeckoEvent::Run()
|
||||
nsAppShell::gAppShell->AddObserver(curEvent->Characters(), curEvent->Observer());
|
||||
break;
|
||||
|
||||
case AndroidGeckoEvent::PREFERENCES_GET:
|
||||
case AndroidGeckoEvent::PREFERENCES_OBSERVE: {
|
||||
const nsTArray<nsString> &prefNames = curEvent->PrefNames();
|
||||
size_t count = prefNames.Length();
|
||||
nsAutoArrayPtr<const char16_t*> prefNamePtrs(new const char16_t*[count]);
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
prefNamePtrs[i] = prefNames[i].get();
|
||||
}
|
||||
|
||||
if (curEvent->Type() == AndroidGeckoEvent::PREFERENCES_GET) {
|
||||
nsAppShell::gAppShell->mBrowserApp->GetPreferences(curEvent->RequestId(), prefNamePtrs, count);
|
||||
} else {
|
||||
nsAppShell::gAppShell->mBrowserApp->ObservePreferences(curEvent->RequestId(), prefNamePtrs, count);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case AndroidGeckoEvent::PREFERENCES_REMOVE_OBSERVERS:
|
||||
nsAppShell::gAppShell->mBrowserApp->RemovePreferenceObservers(curEvent->RequestId());
|
||||
break;
|
||||
|
||||
case AndroidGeckoEvent::LOW_MEMORY:
|
||||
// TODO hook in memory-reduction stuff for different levels here
|
||||
if (curEvent->MetaState() >= AndroidGeckoEvent::MEMORY_PRESSURE_MEDIUM) {
|
||||
|
Loading…
Reference in New Issue
Block a user