mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 734302 - Part 3: Add a menu item for toggling the profiler on mobile; r=BenWa,dougt
--HG-- rename : mobile/android/base/resources/menu-v11/gecko_menu.xml => mobile/android/base/resources/menu-v11/gecko_menu.xml.in rename : mobile/android/base/resources/menu/gecko_menu.xml => mobile/android/base/resources/menu/gecko_menu.xml.in
This commit is contained in:
parent
5fc8781e5d
commit
dd92570f6d
@ -236,6 +236,7 @@
|
||||
@BINPATH@/components/pref.xpt
|
||||
@BINPATH@/components/prefetch.xpt
|
||||
@BINPATH@/components/profile.xpt
|
||||
@BINPATH@/components/profiler.xpt
|
||||
@BINPATH@/components/proxyObject.xpt
|
||||
@BINPATH@/components/rdf.xpt
|
||||
@BINPATH@/components/satchel.xpt
|
||||
|
@ -40,6 +40,9 @@ package @ANDROID_PACKAGE_NAME@;
|
||||
|
||||
import org.mozilla.gecko.GeckoApp;
|
||||
import org.mozilla.gecko.GeckoAppShell;
|
||||
import org.mozilla.gecko.GeckoEvent;
|
||||
import org.mozilla.gecko.R;
|
||||
import android.view.MenuItem;
|
||||
|
||||
public class App extends GeckoApp {
|
||||
public String getPackageName() {
|
||||
@ -65,5 +68,16 @@ public class App extends GeckoApp {
|
||||
return "Redirector/@MOZ_APP_VERSION@ (Android; rv:@MOZ_APP_VERSION@)";
|
||||
return getDefaultUAString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
#ifdef MOZ_PROFILING
|
||||
if (item.getItemId() == R.id.toggle_profiling) {
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("ToggleProfiling", null));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -175,6 +175,8 @@ FENNEC_PP_JAVA_FILES = \
|
||||
|
||||
FENNEC_PP_XML_FILES = \
|
||||
res/layout/abouthome_content.xml \
|
||||
res/menu/gecko_menu.xml \
|
||||
res/menu-v11/gecko_menu.xml \
|
||||
$(NULL)
|
||||
|
||||
|
||||
@ -531,11 +533,6 @@ RES_COLOR = \
|
||||
|
||||
RES_MENU = \
|
||||
res/menu/awesomebar_contextmenu.xml \
|
||||
res/menu/gecko_menu.xml \
|
||||
$(NULL)
|
||||
|
||||
RES_MENU_V11 = \
|
||||
res/menu-v11/gecko_menu.xml \
|
||||
$(NULL)
|
||||
|
||||
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
|
||||
@ -598,7 +595,7 @@ MOZ_ANDROID_DRAWABLES += \
|
||||
|
||||
MOZ_ANDROID_DRAWABLES += $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn | tr '\n' ' '; fi)
|
||||
|
||||
RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_V11) $(RES_LAYOUT_LAND_V14) $(RES_VALUES) $(RES_VALUES_V11) $(RES_XML) $(RES_ANIM) $(RES_DRAWABLE_NODPI) $(RES_DRAWABLE_BASE) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LAND_V14) $(RES_DRAWABLE_LAND_MDPI_V14) $(RES_DRAWABLE_LAND_HDPI_V14) $(RES_DRAWABLE_LAND_XHDPI_V14) $(RES_COLOR) $(RES_MENU) $(RES_MENU_V11)
|
||||
RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_V11) $(RES_LAYOUT_LAND_V14) $(RES_VALUES) $(RES_VALUES_V11) $(RES_XML) $(RES_ANIM) $(RES_DRAWABLE_NODPI) $(RES_DRAWABLE_BASE) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LAND_V14) $(RES_DRAWABLE_LAND_MDPI_V14) $(RES_DRAWABLE_LAND_HDPI_V14) $(RES_DRAWABLE_LAND_XHDPI_V14) $(RES_COLOR) $(RES_MENU)
|
||||
|
||||
RES_DIRS= \
|
||||
res/layout \
|
||||
@ -624,6 +621,7 @@ RES_DIRS= \
|
||||
res/drawable-land-xhdpi-v14 \
|
||||
res/color \
|
||||
res/menu \
|
||||
res/menu-v11 \
|
||||
$(NULL)
|
||||
|
||||
|
||||
|
@ -37,6 +37,11 @@
|
||||
<item android:id="@+id/settings"
|
||||
android:title="@string/settings" />
|
||||
|
||||
#ifdef MOZ_PROFILING
|
||||
<item android:id="@+id/toggle_profiling"
|
||||
android:title="@string/toggle_profiling" />
|
||||
#endif
|
||||
|
||||
<item android:id="@+id/quit"
|
||||
android:title="@string/quit"
|
||||
android:orderInCategory="10" />
|
@ -38,6 +38,11 @@
|
||||
<item android:id="@+id/settings"
|
||||
android:title="@string/settings" />
|
||||
|
||||
#ifdef MOZ_PROFILING
|
||||
<item android:id="@+id/toggle_profiling"
|
||||
android:title="@string/toggle_profiling" />
|
||||
#endif
|
||||
|
||||
<item android:id="@+id/quit"
|
||||
android:title="@string/quit"
|
||||
android:orderInCategory="10" />
|
@ -88,6 +88,9 @@
|
||||
<string name="addons">&addons;</string>
|
||||
<string name="downloads">&downloads;</string>
|
||||
<string name="char_encoding">&char_encoding;</string>
|
||||
<!-- This string only appears in developer builds, which
|
||||
is why it is not localizable. -->
|
||||
<string name="toggle_profiling">Toggle Profiling</string>
|
||||
|
||||
<string name="site_settings_title">&site_settings_title;</string>
|
||||
<string name="site_settings_cancel">&site_settings_cancel;</string>
|
||||
|
@ -193,6 +193,7 @@ var BrowserApp = {
|
||||
Services.obs.addObserver(this, "Viewport:Change", false);
|
||||
Services.obs.addObserver(this, "Passwords:Init", false);
|
||||
Services.obs.addObserver(this, "FormHistory:Init", false);
|
||||
Services.obs.addObserver(this, "ToggleProfiling", false);
|
||||
|
||||
Services.obs.addObserver(this, "sessionstore-state-purge-complete", false);
|
||||
|
||||
@ -952,6 +953,14 @@ var BrowserApp = {
|
||||
Services.obs.removeObserver(this, "FormHistory:Init", false);
|
||||
} else if (aTopic == "sessionstore-state-purge-complete") {
|
||||
sendMessageToJava({ gecko: { type: "Session:StatePurged" }});
|
||||
} else if (aTopic == "ToggleProfiling") {
|
||||
let profiler = Cc["@mozilla.org/tools/profiler;1"].
|
||||
getService(Ci.nsIProfiler);
|
||||
if (profiler.IsActive()) {
|
||||
profiler.StopProfiler();
|
||||
} else {
|
||||
profiler.StartProfiler(100000, 25, ["stackwalk"], 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -231,6 +231,7 @@
|
||||
@BINPATH@/components/pref.xpt
|
||||
@BINPATH@/components/prefetch.xpt
|
||||
@BINPATH@/components/profile.xpt
|
||||
@BINPATH@/components/profiler.xpt
|
||||
@BINPATH@/components/proxyObject.xpt
|
||||
@BINPATH@/components/rdf.xpt
|
||||
@BINPATH@/components/satchel.xpt
|
||||
|
@ -338,13 +338,7 @@ class TableTicker: public Sampler {
|
||||
, mPrimaryThreadProfile(aEntrySize, aStack)
|
||||
, mSaveRequested(false)
|
||||
{
|
||||
#if defined(USE_LIBUNWIND) && defined(ANDROID)
|
||||
// We don't have the Gecko Profiler add-on on Android, but we know that
|
||||
// libunwind is available, so we can always walk the stacks.
|
||||
mUseStackWalk = true;
|
||||
#else
|
||||
mUseStackWalk = hasFeature(aFeatures, aFeatureCount, "stackwalk");
|
||||
#endif
|
||||
|
||||
//XXX: It's probably worth splitting the jank profiler out from the regular profiler at some point
|
||||
mJankOnly = hasFeature(aFeatures, aFeatureCount, "jank");
|
||||
|
Loading…
Reference in New Issue
Block a user