mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge mozilla-central to mozilla-inbound
This commit is contained in:
commit
b5b3a57e1e
@ -3,7 +3,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
ifndef .PYMAKE
|
||||
ifeq (,$(MAKE_VERSION))
|
||||
$(error GNU Make is required)
|
||||
endif
|
||||
@ -11,7 +10,6 @@ make_min_ver := 3.81
|
||||
ifneq ($(make_min_ver),$(firstword $(sort $(make_min_ver) $(MAKE_VERSION))))
|
||||
$(error GNU Make $(make_min_ver) or higher is required)
|
||||
endif
|
||||
endif
|
||||
|
||||
export TOPLEVEL_BUILD := 1
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "5aa4dc2b48dca49517a50d5ba07a0c907af0a4a0",
|
||||
"revision": "c2a75dc08b6c97aa2fb7cdf547f7231d96381106",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="aecb3041c71c5627aea30628ee82fc74e8af0d47"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="87a7746568ac5708e828026160c0732ba252300f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -4,13 +4,6 @@
|
||||
|
||||
GAIA_PATH := gaia/profile
|
||||
|
||||
ifdef .PYMAKE
|
||||
# For use of GNU make in pymake builds.
|
||||
GAIA_MAKE=$(GMAKE)
|
||||
else
|
||||
GAIA_MAKE=$(MAKE)
|
||||
endif
|
||||
|
||||
# This is needed to avoid making run-b2g depend on mozglue
|
||||
WRAP_LDFLAGS :=
|
||||
|
||||
@ -19,6 +12,6 @@ GENERATED_DIRS += $(DIST)/bin/$(GAIA_PATH)
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
libs::
|
||||
+$(GAIA_MAKE) -j1 -C $(GAIADIR) clean
|
||||
+$(GAIA_MAKE) -j1 -C $(GAIADIR) profile
|
||||
+$(MAKE) -j1 -C $(GAIADIR) clean
|
||||
+$(MAKE) -j1 -C $(GAIADIR) profile
|
||||
(cd $(GAIADIR)/profile && tar $(TAR_CREATE_FLAGS) - .) | (cd $(abspath $(DIST))/bin/$(GAIA_PATH) && tar -xf -)
|
||||
|
@ -90,6 +90,7 @@ SocialUI = {
|
||||
if (!this._initialized) {
|
||||
return;
|
||||
}
|
||||
SocialSidebar.saveWindowState();
|
||||
|
||||
Services.obs.removeObserver(this, "social:ambient-notification-changed");
|
||||
Services.obs.removeObserver(this, "social:profile-changed");
|
||||
@ -710,6 +711,11 @@ SocialSidebar = {
|
||||
},
|
||||
|
||||
restoreWindowState: function() {
|
||||
// Window state is used to allow different sidebar providers in each window.
|
||||
// We also store the provider used in a pref as the default sidebar to
|
||||
// maintain that state for users who do not restore window state. The
|
||||
// existence of social.sidebar.provider means the sidebar is open with that
|
||||
// provider.
|
||||
this._initialized = true;
|
||||
if (!this.canShow)
|
||||
return;
|
||||
@ -737,13 +743,22 @@ SocialSidebar = {
|
||||
let data = SessionStore.getWindowValue(window, "socialSidebar");
|
||||
// if this window doesn't have it's own state, use the state from the opener
|
||||
if (!data && window.opener && !window.opener.closed) {
|
||||
data = SessionStore.getWindowValue(window.opener, "socialSidebar");
|
||||
try {
|
||||
data = SessionStore.getWindowValue(window.opener, "socialSidebar");
|
||||
} catch(e) {
|
||||
// Window is not tracked, which happens on osx if the window is opened
|
||||
// from the hidden window. That happens when you close the last window
|
||||
// without quiting firefox, then open a new window.
|
||||
}
|
||||
}
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
document.getElementById("social-sidebar-browser").setAttribute("origin", data.origin);
|
||||
if (!data.hidden)
|
||||
this.show(data.origin);
|
||||
} else if (Services.prefs.prefHasUserValue("social.sidebar.provider")) {
|
||||
// no window state, use the global state if it is available
|
||||
this.show(Services.prefs.getCharPref("social.sidebar.provider"));
|
||||
}
|
||||
},
|
||||
|
||||
@ -754,7 +769,18 @@ SocialSidebar = {
|
||||
"hidden": broadcaster.hidden,
|
||||
"origin": sidebarOrigin
|
||||
};
|
||||
SessionStore.setWindowValue(window, "socialSidebar", JSON.stringify(data));
|
||||
|
||||
// Save a global state for users who do not restore state.
|
||||
if (broadcaster.hidden)
|
||||
Services.prefs.clearUserPref("social.sidebar.provider");
|
||||
else
|
||||
Services.prefs.setCharPref("social.sidebar.provider", sidebarOrigin);
|
||||
|
||||
try {
|
||||
SessionStore.setWindowValue(window, "socialSidebar", JSON.stringify(data));
|
||||
} catch(e) {
|
||||
// window not tracked during uninit
|
||||
}
|
||||
},
|
||||
|
||||
setSidebarVisibilityState: function(aEnabled) {
|
||||
|
@ -3,15 +3,13 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
add_task(function* test_healthreport_search_recording() {
|
||||
try {
|
||||
let cm = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
|
||||
cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider");
|
||||
} catch (ex) {
|
||||
// Health Report disabled, or no SearchesProvider.
|
||||
ok(true, "Firefox Health Report is not enabled.");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -20,72 +18,63 @@ function test() {
|
||||
.wrappedJSObject
|
||||
.healthReporter;
|
||||
ok(reporter, "Health Reporter available.");
|
||||
reporter.onInit().then(function onInit() {
|
||||
let provider = reporter.getProvider("org.mozilla.searches");
|
||||
ok(provider, "Searches provider is available.");
|
||||
let m = provider.getMeasurement("counts", 3);
|
||||
yield reporter.onInit();
|
||||
let provider = reporter.getProvider("org.mozilla.searches");
|
||||
ok(provider, "Searches provider is available.");
|
||||
let m = provider.getMeasurement("counts", 3);
|
||||
|
||||
m.getValues().then(function onData(data) {
|
||||
let now = new Date();
|
||||
let oldCount = 0;
|
||||
let data = yield m.getValues();
|
||||
let now = new Date();
|
||||
let oldCount = 0;
|
||||
|
||||
// This will to be need changed if default search engine is not Google.
|
||||
let field = "google.urlbar";
|
||||
// This will to be need changed if default search engine is not Google.
|
||||
let field = "google.urlbar";
|
||||
|
||||
if (data.days.hasDay(now)) {
|
||||
let day = data.days.getDay(now);
|
||||
if (day.has(field)) {
|
||||
oldCount = day.get(field);
|
||||
}
|
||||
}
|
||||
if (data.days.hasDay(now)) {
|
||||
let day = data.days.getDay(now);
|
||||
if (day.has(field)) {
|
||||
oldCount = day.get(field);
|
||||
}
|
||||
}
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab;
|
||||
let tab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
let searchStr = "firefox health report";
|
||||
let expectedURL = Services.search.currentEngine.
|
||||
getSubmission(searchStr, "", "keyword").uri.spec;
|
||||
let searchStr = "firefox health report";
|
||||
let expectedURL = Services.search.currentEngine.
|
||||
getSubmission(searchStr, "", "keyword").uri.spec;
|
||||
|
||||
// Expect the search URL to load but stop it as soon as it starts.
|
||||
let loadPromise = waitForDocLoadAndStopIt(expectedURL);
|
||||
// Expect the search URL to load but stop it as soon as it starts.
|
||||
let docLoadPromise = waitForDocLoadAndStopIt(expectedURL);
|
||||
|
||||
// Meanwhile, poll for the new measurement.
|
||||
let count = 0;
|
||||
let measurementDeferred = Promise.defer();
|
||||
function getNewMeasurement() {
|
||||
if (count++ >= 10) {
|
||||
ok(false, "Timed out waiting for new measurement");
|
||||
measurementDeferred.resolve();
|
||||
return;
|
||||
}
|
||||
m.getValues().then(function onData(data) {
|
||||
if (data.days.hasDay(now)) {
|
||||
let day = data.days.getDay(now);
|
||||
if (day.has(field)) {
|
||||
let newCount = day.get(field);
|
||||
if (newCount > oldCount) {
|
||||
is(newCount, oldCount + 1,
|
||||
"Exactly one search has been recorded.");
|
||||
measurementDeferred.resolve();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
executeSoon(getNewMeasurement);
|
||||
});
|
||||
}
|
||||
executeSoon(getNewMeasurement);
|
||||
// Trigger the search.
|
||||
gURLBar.value = searchStr;
|
||||
gURLBar.handleCommand();
|
||||
|
||||
// Trigger the search.
|
||||
gURLBar.value = searchStr;
|
||||
gURLBar.handleCommand();
|
||||
yield docLoadPromise;
|
||||
|
||||
// Wait for the page load and new measurement.
|
||||
Promise.all([loadPromise, measurementDeferred.promise]).then(() => {
|
||||
gBrowser.removeTab(tab);
|
||||
finish();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
data = yield m.getValues();
|
||||
ok(data.days.hasDay(now), "We have a search measurement for today.");
|
||||
let day = data.days.getDay(now);
|
||||
ok(day.has(field), "Have a search count for the urlbar.");
|
||||
let newCount = day.get(field);
|
||||
is(newCount, oldCount + 1, "We recorded one new search.");
|
||||
|
||||
// We should record the default search engine if Telemetry is enabled.
|
||||
let oldTelemetry = Services.prefs.getBoolPref("toolkit.telemetry.enabled");
|
||||
Services.prefs.setBoolPref("toolkit.telemetry.enabled", true);
|
||||
|
||||
m = provider.getMeasurement("engines", 1);
|
||||
yield provider.collectDailyData();
|
||||
data = yield m.getValues();
|
||||
|
||||
ok(data.days.hasDay(now), "Have engines data when Telemetry is enabled.");
|
||||
day = data.days.getDay(now);
|
||||
ok(day.has("default"), "We have default engine data.");
|
||||
is(day.get("default"), "google", "The default engine is reported properly.");
|
||||
|
||||
// Restore.
|
||||
Services.prefs.setBoolPref("toolkit.telemetry.enabled", oldTelemetry);
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
});
|
||||
|
@ -30,17 +30,20 @@ function openWindowAndWaitForInit(parentWin, callback) {
|
||||
}, topic, false);
|
||||
}
|
||||
|
||||
function closeWindow(w, cb) {
|
||||
waitForNotification("domwindowclosed", cb);
|
||||
w.close();
|
||||
}
|
||||
|
||||
function closeOneWindow(cb) {
|
||||
let w = createdWindows.pop();
|
||||
if (!w) {
|
||||
if (!w || w.closed) {
|
||||
cb();
|
||||
return;
|
||||
}
|
||||
waitForCondition(function() w.closed,
|
||||
function() {
|
||||
info("window closed, " + createdWindows.length + " windows left");
|
||||
closeOneWindow(cb);
|
||||
}, "window did not close");
|
||||
closeWindow(w, function() {
|
||||
closeOneWindow(cb);
|
||||
});
|
||||
w.close();
|
||||
}
|
||||
|
||||
@ -126,6 +129,51 @@ let tests = {
|
||||
}, cbnext);
|
||||
},
|
||||
|
||||
testGlobalState: function(cbnext) {
|
||||
setManifestPref("social.manifest.test", manifest);
|
||||
ok(!SocialSidebar.opened, "sidebar is closed initially");
|
||||
ok(!Services.prefs.prefHasUserValue("social.sidebar.provider"), "global state unset");
|
||||
// mimick no session state in opener so we exercise the global state via pref
|
||||
SessionStore.deleteWindowValue(window, "socialSidebar");
|
||||
ok(!SessionStore.getWindowValue(window, "socialSidebar"), "window state unset");
|
||||
SocialService.addProvider(manifest, function() {
|
||||
openWindowAndWaitForInit(window, function(w1) {
|
||||
w1.SocialSidebar.show();
|
||||
waitForCondition(function() w1.SocialSidebar.opened,
|
||||
function() {
|
||||
ok(Services.prefs.prefHasUserValue("social.sidebar.provider"), "global state set");
|
||||
ok(!SocialSidebar.opened, "1. main sidebar is still closed");
|
||||
ok(w1.SocialSidebar.opened, "1. window sidebar is open");
|
||||
closeWindow(w1, function() {
|
||||
// this time, the global state should cause the sidebar to be opened
|
||||
// in the new window
|
||||
openWindowAndWaitForInit(window, function(w1) {
|
||||
ok(!SocialSidebar.opened, "2. main sidebar is still closed");
|
||||
ok(w1.SocialSidebar.opened, "2. window sidebar is open");
|
||||
w1.SocialSidebar.hide();
|
||||
ok(!w1.SocialSidebar.opened, "2. window sidebar is closed");
|
||||
ok(!Services.prefs.prefHasUserValue("social.sidebar.provider"), "2. global state unset");
|
||||
// global state should now be no sidebar gets opened on new window
|
||||
closeWindow(w1, function() {
|
||||
ok(!Services.prefs.prefHasUserValue("social.sidebar.provider"), "3. global state unset");
|
||||
ok(!SocialSidebar.opened, "3. main sidebar is still closed");
|
||||
openWindowAndWaitForInit(window, function(w1) {
|
||||
ok(!Services.prefs.prefHasUserValue("social.sidebar.provider"), "4. global state unset");
|
||||
ok(!SocialSidebar.opened, "4. main sidebar is still closed");
|
||||
ok(!w1.SocialSidebar.opened, "4. window sidebar is closed");
|
||||
SocialService.removeProvider(manifest.origin, function() {
|
||||
Services.prefs.clearUserPref("social.manifest.test");
|
||||
cbnext();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// Check per window sidebar functionality, including migration from using
|
||||
// prefs to using session state, and state inheritance of windows (new windows
|
||||
// inherit state from the opener).
|
||||
|
@ -597,6 +597,7 @@ Experiments.Experiments.prototype = {
|
||||
active: experiment.enabled,
|
||||
endDate: experiment.endDate.getTime(),
|
||||
detailURL: experiment._homepageURL,
|
||||
branch: experiment.branch,
|
||||
});
|
||||
}
|
||||
|
||||
@ -628,6 +629,54 @@ Experiments.Experiments.prototype = {
|
||||
return info;
|
||||
},
|
||||
|
||||
/**
|
||||
* Experiment "branch" support. If an experiment has multiple branches, it
|
||||
* can record the branch with the experiment system and it will
|
||||
* automatically be included in data reporting (FHR/telemetry payloads).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the experiment branch for the specified experiment ID.
|
||||
* @returns Promise<>
|
||||
*/
|
||||
setExperimentBranch: Task.async(function*(id, branchstr) {
|
||||
yield this._loadTask;
|
||||
let e = this._experiments.get(id);
|
||||
if (!e) {
|
||||
throw new Error("Experiment not found");
|
||||
}
|
||||
e.branch = String(branchstr);
|
||||
this._dirty = true;
|
||||
Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC, null);
|
||||
yield this._run();
|
||||
}),
|
||||
/**
|
||||
* Get the branch of the specified experiment. If the experiment is unknown,
|
||||
* throws an error.
|
||||
*
|
||||
* @param id The ID of the experiment. Pass null for the currently running
|
||||
* experiment.
|
||||
* @returns Promise<string|null>
|
||||
* @throws Error if the specified experiment ID is unknown, or if there is no
|
||||
* current experiment.
|
||||
*/
|
||||
getExperimentBranch: Task.async(function*(id=null) {
|
||||
yield this._loadTask;
|
||||
let e;
|
||||
if (id) {
|
||||
e = this._experiments.get(id);
|
||||
if (!e) {
|
||||
throw new Error("Experiment not found");
|
||||
}
|
||||
} else {
|
||||
e = this._getActiveExperiment();
|
||||
if (e === null) {
|
||||
throw new Error("No active experiment");
|
||||
}
|
||||
}
|
||||
return e.branch;
|
||||
}),
|
||||
|
||||
/**
|
||||
* Determine whether another date has the same UTC day as now().
|
||||
*/
|
||||
@ -1013,6 +1062,17 @@ Experiments.Experiments.prototype = {
|
||||
return e.id;
|
||||
},
|
||||
|
||||
getActiveExperimentBranch: function() {
|
||||
if (!this._experiments) {
|
||||
return null;
|
||||
}
|
||||
let e = this._getActiveExperiment();
|
||||
if (!e) {
|
||||
return null;
|
||||
}
|
||||
return e.branch;
|
||||
},
|
||||
|
||||
_getActiveExperiment: function () {
|
||||
let enabled = [experiment for ([,experiment] of this._experiments) if (experiment._enabled)];
|
||||
|
||||
@ -1258,6 +1318,8 @@ Experiments.ExperimentEntry = function (policy) {
|
||||
this._lastChangedDate = null;
|
||||
// Has this experiment failed to activate before?
|
||||
this._failedStart = false;
|
||||
// The experiment branch
|
||||
this._branch = null;
|
||||
|
||||
// We grab these from the addon after download.
|
||||
this._name = null;
|
||||
@ -1306,6 +1368,7 @@ Experiments.ExperimentEntry.prototype = {
|
||||
"_addonId",
|
||||
"_startDate",
|
||||
"_endDate",
|
||||
"_branch",
|
||||
]),
|
||||
|
||||
DATE_KEYS: new Set([
|
||||
@ -1313,6 +1376,10 @@ Experiments.ExperimentEntry.prototype = {
|
||||
"_endDate",
|
||||
]),
|
||||
|
||||
UPGRADE_KEYS: new Map([
|
||||
["_branch", null],
|
||||
]),
|
||||
|
||||
ADDON_CHANGE_NONE: 0,
|
||||
ADDON_CHANGE_INSTALL: 1,
|
||||
ADDON_CHANGE_UNINSTALL: 2,
|
||||
@ -1344,6 +1411,14 @@ Experiments.ExperimentEntry.prototype = {
|
||||
return this._manifestData.id;
|
||||
},
|
||||
|
||||
get branch() {
|
||||
return this._branch;
|
||||
},
|
||||
|
||||
set branch(v) {
|
||||
this._branch = v;
|
||||
},
|
||||
|
||||
get startDate() {
|
||||
return this._startDate;
|
||||
},
|
||||
@ -1376,6 +1451,12 @@ Experiments.ExperimentEntry.prototype = {
|
||||
* @return boolean Whether initialization succeeded.
|
||||
*/
|
||||
initFromCacheData: function (data) {
|
||||
for (let [key, dval] of this.UPGRADE_KEYS) {
|
||||
if (!(key in data)) {
|
||||
data.set(key, dval);
|
||||
}
|
||||
}
|
||||
|
||||
for (let key of this.SERIALIZE_KEYS) {
|
||||
if (!(key in data) && !this.DATE_KEYS.has(key)) {
|
||||
this._log.error("initFromCacheData() - missing required key " + key);
|
||||
@ -1970,6 +2051,9 @@ let stripDateToMidnight = function (d) {
|
||||
function ExperimentsLastActiveMeasurement1() {
|
||||
Metrics.Measurement.call(this);
|
||||
}
|
||||
function ExperimentsLastActiveMeasurement2() {
|
||||
Metrics.Measurement.call(this);
|
||||
}
|
||||
|
||||
const FIELD_DAILY_LAST_TEXT = {type: Metrics.Storage.FIELD_DAILY_LAST_TEXT};
|
||||
|
||||
@ -1983,6 +2067,17 @@ ExperimentsLastActiveMeasurement1.prototype = Object.freeze({
|
||||
lastActive: FIELD_DAILY_LAST_TEXT,
|
||||
}
|
||||
});
|
||||
ExperimentsLastActiveMeasurement2.prototype = Object.freeze({
|
||||
__proto__: Metrics.Measurement.prototype,
|
||||
|
||||
name: "info",
|
||||
version: 2,
|
||||
|
||||
fields: {
|
||||
lastActive: FIELD_DAILY_LAST_TEXT,
|
||||
lastActiveBranch: FIELD_DAILY_LAST_TEXT,
|
||||
}
|
||||
});
|
||||
|
||||
this.ExperimentsProvider = function () {
|
||||
Metrics.Provider.call(this);
|
||||
@ -1997,6 +2092,7 @@ ExperimentsProvider.prototype = Object.freeze({
|
||||
|
||||
measurementTypes: [
|
||||
ExperimentsLastActiveMeasurement1,
|
||||
ExperimentsLastActiveMeasurement2,
|
||||
],
|
||||
|
||||
_OBSERVERS: [
|
||||
@ -2040,8 +2136,8 @@ ExperimentsProvider.prototype = Object.freeze({
|
||||
this._experiments = Experiments.instance();
|
||||
}
|
||||
|
||||
let m = this.getMeasurement(ExperimentsLastActiveMeasurement1.prototype.name,
|
||||
ExperimentsLastActiveMeasurement1.prototype.version);
|
||||
let m = this.getMeasurement(ExperimentsLastActiveMeasurement2.prototype.name,
|
||||
ExperimentsLastActiveMeasurement2.prototype.version);
|
||||
|
||||
return this.enqueueStorageOperation(() => {
|
||||
return Task.spawn(function* recordTask() {
|
||||
@ -2055,6 +2151,11 @@ ExperimentsProvider.prototype = Object.freeze({
|
||||
this._log.info("Recording last active experiment: " + todayActive.id);
|
||||
yield m.setDailyLastText("lastActive", todayActive.id,
|
||||
this._experiments._policy.now());
|
||||
let branch = todayActive.branch;
|
||||
if (branch) {
|
||||
yield m.setDailyLastText("lastActiveBranch", branch,
|
||||
this._experiments._policy.now());
|
||||
}
|
||||
}.bind(this));
|
||||
});
|
||||
},
|
||||
|
@ -76,6 +76,7 @@ const FAKE_EXPERIMENTS_1 = [
|
||||
description: "experiment 1",
|
||||
active: true,
|
||||
detailUrl: "https://dummy/experiment1",
|
||||
branch: "foo",
|
||||
},
|
||||
];
|
||||
|
||||
@ -87,6 +88,7 @@ const FAKE_EXPERIMENTS_2 = [
|
||||
active: false,
|
||||
endDate: new Date(2014, 2, 11, 2, 4, 35, 42).getTime(),
|
||||
detailUrl: "https://dummy/experiment2",
|
||||
branch: null,
|
||||
},
|
||||
{
|
||||
id: "id1",
|
||||
@ -95,6 +97,7 @@ const FAKE_EXPERIMENTS_2 = [
|
||||
active: false,
|
||||
endDate: new Date(2014, 2, 10, 0, 0, 0, 0).getTime(),
|
||||
detailURL: "https://dummy/experiment1",
|
||||
branch: null,
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -171,6 +171,14 @@ add_task(function* test_getExperiments() {
|
||||
let addons = yield getExperimentAddons();
|
||||
Assert.equal(addons.length, 0, "Precondition: No experiment add-ons are installed.");
|
||||
|
||||
try {
|
||||
let b = yield experiments.getExperimentBranch();
|
||||
Assert.ok(false, "getExperimentBranch should fail with no experiment");
|
||||
}
|
||||
catch (e) {
|
||||
Assert.ok(true, "getExperimentBranch correctly threw");
|
||||
}
|
||||
|
||||
// Trigger update, clock set for experiment 1 to start.
|
||||
|
||||
now = futureDate(startDate1, 5 * MS_IN_ONE_DAY);
|
||||
@ -196,6 +204,19 @@ add_task(function* test_getExperiments() {
|
||||
"Property " + k + " should match reference data.");
|
||||
}
|
||||
|
||||
let b = yield experiments.getExperimentBranch();
|
||||
Assert.strictEqual(b, null, "getExperimentBranch should return null by default");
|
||||
|
||||
b = yield experiments.getExperimentBranch(EXPERIMENT1_ID);
|
||||
Assert.strictEqual(b, null, "getExperimentsBranch should return null (with id)");
|
||||
|
||||
yield experiments.setExperimentBranch(EXPERIMENT1_ID, "foo");
|
||||
b = yield experiments.getExperimentBranch();
|
||||
Assert.strictEqual(b, "foo", "getExperimentsBranch should return the set value");
|
||||
|
||||
Assert.equal(observerFireCount, ++expectedObserverFireCount,
|
||||
"Experiments observer should have been called.");
|
||||
|
||||
Assert.equal(gTimerScheduleOffset, 10 * MS_IN_ONE_DAY,
|
||||
"Experiment re-evaluation should have been scheduled correctly.");
|
||||
|
||||
|
@ -190,6 +190,13 @@ add_task(function* test_cache() {
|
||||
checkExperimentListsEqual(experimentListData.slice(1), list);
|
||||
checkExperimentSerializations(experiments._experiments.values());
|
||||
|
||||
let branch = yield experiments.getExperimentBranch(EXPERIMENT1_ID);
|
||||
Assert.strictEqual(branch, null);
|
||||
|
||||
yield experiments.setExperimentBranch(EXPERIMENT1_ID, "testbranch");
|
||||
branch = yield experiments.getExperimentBranch(EXPERIMENT1_ID);
|
||||
Assert.strictEqual(branch, "testbranch");
|
||||
|
||||
// Re-init, clock set for experiment 1 to stop.
|
||||
|
||||
now = futureDate(now, 20 * MS_IN_ONE_DAY);
|
||||
@ -207,6 +214,9 @@ add_task(function* test_cache() {
|
||||
checkExperimentListsEqual(experimentListData.slice(1), list);
|
||||
checkExperimentSerializations(experiments._experiments.values());
|
||||
|
||||
branch = yield experiments.getExperimentBranch(EXPERIMENT1_ID);
|
||||
Assert.strictEqual(branch, "testbranch");
|
||||
|
||||
// Re-init, clock set for experiment 2 to start.
|
||||
|
||||
now = futureDate(startDates[1], 20 * MS_IN_ONE_DAY);
|
||||
|
@ -9,6 +9,8 @@ Cu.import("resource:///modules/experiments/Experiments.jsm");
|
||||
Cu.import("resource://testing-common/services/healthreport/utils.jsm");
|
||||
Cu.import("resource://testing-common/services-common/logging.js");
|
||||
|
||||
const kMeasurementVersion = 2;
|
||||
|
||||
function getStorageAndProvider(name) {
|
||||
return Task.spawn(function* get() {
|
||||
let storage = yield Metrics.Storage(name);
|
||||
@ -53,7 +55,7 @@ add_task(function* test_collect() {
|
||||
|
||||
// Initial state should not report anything.
|
||||
yield provider.collectDailyData();
|
||||
let m = provider.getMeasurement("info", 1);
|
||||
let m = provider.getMeasurement("info", kMeasurementVersion);
|
||||
let values = yield m.getValues();
|
||||
Assert.equal(values.days.size, 0, "Have no data if no experiments known.");
|
||||
|
||||
@ -69,6 +71,8 @@ add_task(function* test_collect() {
|
||||
let day = values.days.getDay(now);
|
||||
Assert.ok(day.has("lastActive"), "Has lastActive field.");
|
||||
Assert.equal(day.get("lastActive"), "id2", "Last active ID is sane.");
|
||||
Assert.strictEqual(day.get("lastActiveBranch"), undefined,
|
||||
"no branch should be set yet");
|
||||
|
||||
// Making an experiment active replaces the lastActive value.
|
||||
replaceExperiments(provider._experiments, FAKE_EXPERIMENTS_1);
|
||||
@ -76,6 +80,8 @@ add_task(function* test_collect() {
|
||||
values = yield m.getValues();
|
||||
day = values.days.getDay(now);
|
||||
Assert.equal(day.get("lastActive"), "id1", "Last active ID is the active experiment.");
|
||||
Assert.equal(day.get("lastActiveBranch"), "foo",
|
||||
"Experiment branch should be visible");
|
||||
|
||||
// And make sure the observer works.
|
||||
replaceExperiments(provider._experiments, FAKE_EXPERIMENTS_2);
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -185,9 +185,7 @@ dnl A high level macro for selecting compiler options.
|
||||
AC_DEFUN([MOZ_COMPILER_OPTS],
|
||||
[
|
||||
if test "${MOZ_PSEUDO_DERECURSE-unset}" = unset; then
|
||||
dnl Don't enable on pymake, because of bug 918652. Bug 912979 is an annoyance
|
||||
dnl with pymake, too.
|
||||
MOZ_PSEUDO_DERECURSE=no-pymake
|
||||
MOZ_PSEUDO_DERECURSE=1
|
||||
fi
|
||||
|
||||
MOZ_DEBUGGING_OPTS
|
||||
@ -246,6 +244,13 @@ if test "$GNU_CC" -a -n "$MOZ_FORCE_GOLD"; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$GNU_CC"; then
|
||||
if $CC $LDFLAGS -Wl,--version 2>&1 | grep -q "GNU ld"; then
|
||||
LD_IS_BFD=1
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST([LD_IS_BFD])
|
||||
|
||||
if test "$GNU_CC"; then
|
||||
if test -z "$DEVELOPER_OPTIONS"; then
|
||||
|
@ -88,22 +88,9 @@ GB is likely entering the point of diminishing returns.
|
||||
|
||||
This cause impacts both clobber and incremental builds.
|
||||
|
||||
You are building with pymake
|
||||
============================
|
||||
|
||||
Pymake is slower than GNU make. One reason is Python is generally slower
|
||||
than C. The build system maintainers are consistently looking at
|
||||
optimizing pymake. However, it is death by a thousand cuts.
|
||||
|
||||
This cause impacts both clobber and incremental builds.
|
||||
|
||||
You are building on Windows
|
||||
===========================
|
||||
|
||||
Builds on Windows are slow for a few reasons. First, Windows builds use
|
||||
pymake, not GNU make (because of compatibility issues with GNU make).
|
||||
But, there are other sources of slowness.
|
||||
|
||||
New processes on Windows are about a magnitude slower to spawn than on
|
||||
UNIX-y systems such as Linux. This is because Windows has optimized new
|
||||
threads while the \*NIX platforms typically optimize new processes.
|
||||
|
@ -46,8 +46,7 @@ except KeyError:
|
||||
try:
|
||||
proc = subprocess.Popen([binscope_path, "/target", binary_path,
|
||||
"/output", log_file_path, "/sympath", symbol_path,
|
||||
"/c", "ATLVersionCheck", "/c", "ATLVulnCheck", "/c", "FunctionPointersCheck",
|
||||
"/c", "SharedSectionCheck", "/c", "APTCACheck", "/c", "NXCheck",
|
||||
"/c", "ATLVersionCheck", "/c", "ATLVulnCheck", "/c", "SharedSectionCheck", "/c", "APTCACheck", "/c", "NXCheck",
|
||||
"/c", "GSCheck", "/c", "GSFunctionSafeBuffersCheck", "/c", "GSFriendlyInitCheck",
|
||||
"/c", "CompilerVersionCheck", "/c", "SafeSEHCheck", "/c", "SNCheck",
|
||||
"/c", "DBCheck"], stdout=subprocess.PIPE)
|
||||
|
@ -145,13 +145,6 @@ endif
|
||||
|
||||
ifndef MOZ_OBJDIR
|
||||
MOZ_OBJDIR = obj-$(CONFIG_GUESS)
|
||||
else
|
||||
# On Windows Pymake builds check MOZ_OBJDIR doesn't start with "/"
|
||||
ifneq (,$(findstring mingw,$(CONFIG_GUESS)))
|
||||
ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(MOZ_OBJDIR))))
|
||||
$(error For Windows Pymake builds, MOZ_OBJDIR must be a Windows [and not MSYS] style path.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_BUILD_PROJECTS
|
||||
|
@ -194,16 +194,6 @@ endif
|
||||
CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
|
||||
AUTOCONF_TOOLS = $(topsrcdir)/build/autoconf
|
||||
|
||||
# Disable MOZ_PSEUDO_DERECURSE when it contains no-pymake and we're running
|
||||
# pymake. This can be removed when no-pymake is removed from the default in
|
||||
# build/autoconf/compiler-opts.m4.
|
||||
ifdef .PYMAKE
|
||||
comma = ,
|
||||
ifneq (,$(filter no-pymake,$(subst $(comma), ,$(MOZ_PSEUDO_DERECURSE))))
|
||||
MOZ_PSEUDO_DERECURSE :=
|
||||
endif
|
||||
endif
|
||||
|
||||
# Disable MOZ_PSEUDO_DERECURSE on PGO builds until it's fixed.
|
||||
ifneq (,$(MOZ_PROFILE_USE)$(MOZ_PROFILE_GENERATE))
|
||||
MOZ_PSEUDO_DERECURSE :=
|
||||
@ -238,10 +228,6 @@ MKDIR ?= mkdir
|
||||
SLEEP ?= sleep
|
||||
TOUCH ?= touch
|
||||
|
||||
ifdef .PYMAKE
|
||||
PYCOMMANDPATH += $(PYTHON_SITE_PACKAGES)
|
||||
endif
|
||||
|
||||
PYTHON_PATH = $(PYTHON) $(topsrcdir)/config/pythonpath.py
|
||||
|
||||
# determine debug-related options
|
||||
@ -720,9 +706,6 @@ endif # NSINSTALL_BIN
|
||||
|
||||
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT, $(OS_ARCH)))
|
||||
INSTALL = $(NSINSTALL) -t
|
||||
ifdef .PYMAKE
|
||||
install_cmd = $(NSINSTALL_NATIVECMD) -t $(1)
|
||||
endif # .PYMAKE
|
||||
|
||||
else
|
||||
|
||||
@ -839,6 +822,7 @@ endif
|
||||
define CHECK_BINARY
|
||||
$(call CHECK_STDCXX,$(1))
|
||||
$(call CHECK_TEXTREL,$(1))
|
||||
$(call LOCAL_CHECKS,$(1))
|
||||
endef
|
||||
|
||||
# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
|
||||
|
@ -27,8 +27,4 @@ core_winabspath = $(error core_winabspath is unsupported)
|
||||
#
|
||||
# libs::
|
||||
# $(call py_action,purge_manifests,_build_manifests/purge/foo.manifest)
|
||||
ifdef .PYMAKE
|
||||
py_action = %mozbuild.action.$(1) main $(2)
|
||||
else
|
||||
py_action = $(PYTHON) -m mozbuild.action.$(1) $(2)
|
||||
endif
|
||||
|
@ -35,23 +35,8 @@ endif
|
||||
USE_AUTOTARGETS_MK = 1
|
||||
include $(topsrcdir)/config/makefiles/makeutils.mk
|
||||
|
||||
# Only build with Pymake (not GNU make) on Windows.
|
||||
ifeq ($(HOST_OS_ARCH),WINNT)
|
||||
ifndef L10NBASEDIR
|
||||
ifndef .PYMAKE
|
||||
$(error Pymake is required to build on Windows. Run |./mach build| to \
|
||||
automatically use pymake or invoke pymake directly via \
|
||||
|python build/pymake/make.py|.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef REBUILD_CHECK
|
||||
ifdef .PYMAKE
|
||||
REPORT_BUILD = @%rebuild_check rebuild_check $@ $^
|
||||
else
|
||||
REPORT_BUILD = $(info $(shell $(PYTHON) $(MOZILLA_DIR)/config/rebuild_check.py $@ $^))
|
||||
endif
|
||||
else
|
||||
REPORT_BUILD = $(info $(notdir $@))
|
||||
endif
|
||||
@ -66,15 +51,11 @@ endif
|
||||
# ELOG prints out failed command when building silently (gmake -s). Pymake
|
||||
# prints out failed commands anyway, so ELOG just makes things worse by
|
||||
# forcing shell invocations.
|
||||
ifndef .PYMAKE
|
||||
ifneq (,$(findstring s, $(filter-out --%, $(MAKEFLAGS))))
|
||||
ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
|
||||
else
|
||||
ELOG :=
|
||||
endif # -s
|
||||
else
|
||||
ELOG :=
|
||||
endif # ifndef .PYMAKE
|
||||
|
||||
_VPATH_SRCS = $(abspath $<)
|
||||
|
||||
@ -238,7 +219,7 @@ endif
|
||||
COMPILE_CFLAGS += $(COMPILE_PDB_FLAG)
|
||||
COMPILE_CXXFLAGS += $(COMPILE_PDB_FLAG)
|
||||
|
||||
LINK_PDBFILE = $(basename $(@F)).pdb
|
||||
LINK_PDBFILE ?= $(basename $(@F)).pdb
|
||||
ifdef MOZ_DEBUG
|
||||
CODFILE=$(basename $(@F)).cod
|
||||
endif
|
||||
@ -1142,9 +1123,7 @@ else
|
||||
endif
|
||||
|
||||
# Cancel GNU make built-in implicit rules
|
||||
ifndef .PYMAKE
|
||||
MAKEFLAGS += -r
|
||||
endif
|
||||
|
||||
ifneq (,$(filter WINNT,$(OS_ARCH)))
|
||||
SEP := ;
|
||||
|
@ -22,7 +22,6 @@ tgts =\
|
||||
$(NULL)
|
||||
|
||||
export MAKE
|
||||
export .PYMAKE
|
||||
|
||||
##------------------_##
|
||||
##---] TARGETS [---##
|
||||
|
@ -2697,11 +2697,12 @@ this.DOMApplicationRegistry = {
|
||||
_manifestCache: {},
|
||||
|
||||
_readManifests: function(aData) {
|
||||
let manifestCache = this._manifestCache;
|
||||
return Task.spawn(function*() {
|
||||
for (let elem of aData) {
|
||||
let id = elem.id;
|
||||
|
||||
if (!this._manifestCache[id]) {
|
||||
if (!manifestCache[id]) {
|
||||
// the manifest file used to be named manifest.json, so fallback on this.
|
||||
let baseDir = this.webapps[id].basePath == this.getCoreAppsBasePath()
|
||||
? "coreAppsDir" : DIRECTORY_NAME;
|
||||
@ -2710,14 +2711,14 @@ this.DOMApplicationRegistry = {
|
||||
|
||||
let fileNames = ["manifest.webapp", "update.webapp", "manifest.json"];
|
||||
for (let fileName of fileNames) {
|
||||
this._manifestCache[id] = yield AppsUtils.loadJSONAsync(OS.Path.join(dir.path, fileName));
|
||||
if (this._manifestCache[id]) {
|
||||
manifestCache[id] = yield AppsUtils.loadJSONAsync(OS.Path.join(dir.path, fileName));
|
||||
if (manifestCache[id]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elem.manifest = this._manifestCache[id];
|
||||
elem.manifest = manifestCache[id];
|
||||
}
|
||||
|
||||
return aData;
|
||||
|
@ -371,17 +371,13 @@ BluetoothHfpManager::ResetCallArray()
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothHfpManager::Reset()
|
||||
BluetoothHfpManager::Cleanup()
|
||||
{
|
||||
mReceiveVgsFlag = false;
|
||||
mDialingRequestProcessed = true;
|
||||
|
||||
mConnectionState = BTHF_CONNECTION_STATE_DISCONNECTED;
|
||||
mPrevConnectionState = BTHF_CONNECTION_STATE_DISCONNECTED;
|
||||
mAudioState = BTHF_AUDIO_STATE_DISCONNECTED;
|
||||
|
||||
// Phone & Device CIND
|
||||
ResetCallArray();
|
||||
mBattChg = 5;
|
||||
mService = 0;
|
||||
mRoam = 0;
|
||||
@ -390,6 +386,16 @@ BluetoothHfpManager::Reset()
|
||||
mController = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothHfpManager::Reset()
|
||||
{
|
||||
// Phone & Device CIND
|
||||
ResetCallArray();
|
||||
// Clear Sco state
|
||||
mAudioState = BTHF_AUDIO_STATE_DISCONNECTED;
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothHfpManager::Init()
|
||||
{
|
||||
@ -818,7 +824,7 @@ BluetoothHfpManager::NotifyConnectionStateChanged(const nsAString& aType)
|
||||
} else {
|
||||
OnDisconnect(EmptyString());
|
||||
}
|
||||
Reset();
|
||||
Cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,6 +136,7 @@ private:
|
||||
|
||||
BluetoothHfpManager();
|
||||
bool Init();
|
||||
void Cleanup();
|
||||
|
||||
void HandleShutdown();
|
||||
void HandleVolumeChanged(const nsAString& aData);
|
||||
|
@ -354,10 +354,17 @@ public:
|
||||
// Whether or not this is the root scroll frame for the root content document.
|
||||
bool mIsRoot;
|
||||
|
||||
// Whether or not this frame is for an element marked 'scrollgrab'.
|
||||
bool mHasScrollgrab;
|
||||
|
||||
public:
|
||||
void SetHasScrollgrab(bool aHasScrollgrab)
|
||||
{
|
||||
mHasScrollgrab = aHasScrollgrab;
|
||||
}
|
||||
|
||||
bool GetHasScrollgrab() const
|
||||
{
|
||||
return mHasScrollgrab;
|
||||
}
|
||||
|
||||
void SetScrollOffset(const CSSPoint& aScrollOffset)
|
||||
{
|
||||
mScrollOffset = aScrollOffset;
|
||||
@ -460,6 +467,9 @@ private:
|
||||
// New fields from now on should be made private and old fields should
|
||||
// be refactored to be private.
|
||||
|
||||
// Whether or not this frame is for an element marked 'scrollgrab'.
|
||||
bool mHasScrollgrab;
|
||||
|
||||
// A unique ID assigned to each scrollable frame.
|
||||
ViewID mScrollId;
|
||||
|
||||
|
@ -374,114 +374,8 @@ APZCTreeManager::ReceiveInputEvent(const InputData& aEvent,
|
||||
gfx3DMatrix transformToGecko;
|
||||
switch (aEvent.mInputType) {
|
||||
case MULTITOUCH_INPUT: {
|
||||
const MultiTouchInput& multiTouchInput = aEvent.AsMultiTouchInput();
|
||||
if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_START) {
|
||||
// If we are in an overscrolled state and a second finger goes down,
|
||||
// ignore that second touch point completely. The touch-start for it is
|
||||
// dropped completely; subsequent touch events until the touch-end for it
|
||||
// will have this touch point filtered out.
|
||||
if (mApzcForInputBlock && mApzcForInputBlock->IsOverscrolled()) {
|
||||
if (mRetainedTouchIdentifier == -1) {
|
||||
mRetainedTouchIdentifier = mApzcForInputBlock->GetLastTouchIdentifier();
|
||||
}
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
// MULTITOUCH_START input contains all active touches of the current
|
||||
// session thus resetting mTouchCount.
|
||||
mTouchCount = multiTouchInput.mTouches.Length();
|
||||
mInOverscrolledApzc = false;
|
||||
mApzcForInputBlock = GetTargetAPZC(ScreenPoint(multiTouchInput.mTouches[0].mScreenPoint),
|
||||
&mInOverscrolledApzc);
|
||||
if (multiTouchInput.mTouches.Length() == 1) {
|
||||
// If we have one touch point, this might be the start of a pan.
|
||||
// Prepare for possible overscroll handoff.
|
||||
BuildOverscrollHandoffChain(mApzcForInputBlock);
|
||||
}
|
||||
for (size_t i = 1; i < multiTouchInput.mTouches.Length(); i++) {
|
||||
nsRefPtr<AsyncPanZoomController> apzc2 = GetTargetAPZC(ScreenPoint(multiTouchInput.mTouches[i].mScreenPoint),
|
||||
&mInOverscrolledApzc);
|
||||
mApzcForInputBlock = CommonAncestor(mApzcForInputBlock.get(), apzc2.get());
|
||||
APZCTM_LOG("Using APZC %p as the common ancestor\n", mApzcForInputBlock.get());
|
||||
// For now, we only ever want to do pinching on the root APZC for a given layers id. So
|
||||
// when we find the common ancestor of multiple points, also walk up to the root APZC.
|
||||
mApzcForInputBlock = RootAPZCForLayersId(mApzcForInputBlock);
|
||||
APZCTM_LOG("Using APZC %p as the root APZC for multi-touch\n", mApzcForInputBlock.get());
|
||||
}
|
||||
|
||||
if (mApzcForInputBlock) {
|
||||
// Cache transformToApzc so it can be used for future events in this block.
|
||||
GetInputTransforms(mApzcForInputBlock, transformToApzc, transformToGecko);
|
||||
mCachedTransformToApzcForInputBlock = transformToApzc;
|
||||
} else {
|
||||
// Reset the cached apz transform
|
||||
mCachedTransformToApzcForInputBlock = gfx3DMatrix();
|
||||
}
|
||||
} else if (mApzcForInputBlock) {
|
||||
APZCTM_LOG("Re-using APZC %p as continuation of event block\n", mApzcForInputBlock.get());
|
||||
}
|
||||
|
||||
// If we receive a touch-cancel, it means all touches are finished, so we
|
||||
// can stop ignoring any that we were ignoring.
|
||||
if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_CANCEL) {
|
||||
mRetainedTouchIdentifier = -1;
|
||||
}
|
||||
|
||||
if (mApzcForInputBlock) {
|
||||
mApzcForInputBlock->GetGuid(aOutTargetGuid);
|
||||
// Use the cached transform to compute the point to send to the APZC.
|
||||
// This ensures that the sequence of touch points an APZC sees in an
|
||||
// input block are all in the same coordinate space.
|
||||
transformToApzc = mCachedTransformToApzcForInputBlock;
|
||||
|
||||
// Make a copy of the input event that we pass, with some modifications,
|
||||
// to the target APZC.
|
||||
MultiTouchInput inputForApzc(multiTouchInput);
|
||||
|
||||
// If we are currently ignoring any touch points, filter them out from
|
||||
// the set of touch points included in this event.
|
||||
if (mRetainedTouchIdentifier != -1) {
|
||||
for (size_t j = 0; j < inputForApzc.mTouches.Length(); ++j) {
|
||||
if (inputForApzc.mTouches[j].mIdentifier != mRetainedTouchIdentifier) {
|
||||
// TODO(botond): Once we get rid of ReceiveInputEvent(WidgetInputEvent),
|
||||
// the signature of this function will change to take the InputData
|
||||
// via non-const reference. We can then remove the touch point from
|
||||
// multiTouchInput rather than the copy (inputForApzc), so that
|
||||
// content doesn't get it either.
|
||||
inputForApzc.mTouches.RemoveElementAt(j);
|
||||
--j;
|
||||
}
|
||||
}
|
||||
if (inputForApzc.mTouches.IsEmpty()) {
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < inputForApzc.mTouches.Length(); i++) {
|
||||
ApplyTransform(&(inputForApzc.mTouches[i].mScreenPoint), transformToApzc);
|
||||
}
|
||||
mApzcForInputBlock->ReceiveInputEvent(inputForApzc);
|
||||
}
|
||||
result = mInOverscrolledApzc ? nsEventStatus_eConsumeNoDefault
|
||||
: mApzcForInputBlock ? nsEventStatus_eConsumeDoDefault
|
||||
: nsEventStatus_eIgnore;
|
||||
if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_CANCEL ||
|
||||
multiTouchInput.mType == MultiTouchInput::MULTITOUCH_END) {
|
||||
if (mTouchCount >= multiTouchInput.mTouches.Length()) {
|
||||
// MULTITOUCH_END input contains only released touches thus decrementing.
|
||||
mTouchCount -= multiTouchInput.mTouches.Length();
|
||||
} else {
|
||||
NS_WARNING("Got an unexpected touchend/touchcancel");
|
||||
mTouchCount = 0;
|
||||
}
|
||||
// If we have an mApzcForInputBlock and it's the end of the touch sequence
|
||||
// then null it out so we don't keep a dangling reference and leak things.
|
||||
if (mTouchCount == 0) {
|
||||
mApzcForInputBlock = nullptr;
|
||||
mInOverscrolledApzc = false;
|
||||
mRetainedTouchIdentifier = -1;
|
||||
ClearOverscrollHandoffChain();
|
||||
}
|
||||
}
|
||||
MultiTouchInput touchInput = aEvent.AsMultiTouchInput();
|
||||
result = ProcessTouchInput(touchInput, aOutTargetGuid);
|
||||
break;
|
||||
} case PANGESTURE_INPUT: {
|
||||
const PanGestureInput& panInput = aEvent.AsPanGestureInput();
|
||||
@ -542,20 +436,17 @@ APZCTreeManager::ReceiveInputEvent(const InputData& aEvent,
|
||||
}
|
||||
|
||||
already_AddRefed<AsyncPanZoomController>
|
||||
APZCTreeManager::GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent,
|
||||
APZCTreeManager::GetTouchInputBlockAPZC(const MultiTouchInput& aEvent,
|
||||
bool* aOutInOverscrolledApzc)
|
||||
{
|
||||
ScreenPoint point = ScreenPoint(aEvent.touches[0]->mRefPoint.x, aEvent.touches[0]->mRefPoint.y);
|
||||
// Ignore events if any touch hits inside an overscrolled apzc.
|
||||
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(point, aOutInOverscrolledApzc);
|
||||
if (aEvent.touches.Length() == 1) {
|
||||
// If we have one touch point, this might be the start of a pan.
|
||||
// Prepare for possible overscroll handoff.
|
||||
BuildOverscrollHandoffChain(apzc);
|
||||
nsRefPtr<AsyncPanZoomController> apzc;
|
||||
if (aEvent.mTouches.Length() == 0) {
|
||||
return apzc.forget();
|
||||
}
|
||||
for (size_t i = 1; i < aEvent.touches.Length(); i++) {
|
||||
point = ScreenPoint(aEvent.touches[i]->mRefPoint.x, aEvent.touches[i]->mRefPoint.y);
|
||||
nsRefPtr<AsyncPanZoomController> apzc2 = GetTargetAPZC(point, aOutInOverscrolledApzc);
|
||||
|
||||
apzc = GetTargetAPZC(aEvent.mTouches[0].mScreenPoint, aOutInOverscrolledApzc);
|
||||
for (size_t i = 1; i < aEvent.mTouches.Length(); i++) {
|
||||
nsRefPtr<AsyncPanZoomController> apzc2 = GetTargetAPZC(aEvent.mTouches[i].mScreenPoint, aOutInOverscrolledApzc);
|
||||
apzc = CommonAncestor(apzc.get(), apzc2.get());
|
||||
APZCTM_LOG("Using APZC %p as the common ancestor\n", apzc.get());
|
||||
// For now, we only ever want to do pinching on the root APZC for a given layers id. So
|
||||
@ -563,19 +454,18 @@ APZCTreeManager::GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent,
|
||||
apzc = RootAPZCForLayersId(apzc);
|
||||
APZCTM_LOG("Using APZC %p as the root APZC for multi-touch\n", apzc.get());
|
||||
}
|
||||
|
||||
// Prepare for possible overscroll handoff.
|
||||
BuildOverscrollHandoffChain(apzc);
|
||||
|
||||
return apzc.forget();
|
||||
}
|
||||
|
||||
nsEventStatus
|
||||
APZCTreeManager::ProcessTouchEvent(WidgetTouchEvent& aEvent,
|
||||
APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
|
||||
ScrollableLayerGuid* aOutTargetGuid)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!aEvent.touches.Length()) {
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
if (aEvent.message == NS_TOUCH_START) {
|
||||
if (aInput.mType == MultiTouchInput::MULTITOUCH_START) {
|
||||
// If we are in an overscrolled state and a second finger goes down,
|
||||
// ignore that second touch point completely. The touch-start for it is
|
||||
// dropped completely; subsequent touch events until the touch-end for it
|
||||
@ -586,11 +476,23 @@ APZCTreeManager::ProcessTouchEvent(WidgetTouchEvent& aEvent,
|
||||
}
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
// NS_TOUCH_START event contains all active touches of the current
|
||||
// session thus resetting mTouchCount.
|
||||
mTouchCount = aEvent.touches.Length();
|
||||
mTouchCount = aInput.mTouches.Length();
|
||||
mInOverscrolledApzc = false;
|
||||
mApzcForInputBlock = GetTouchInputBlockAPZC(aEvent, &mInOverscrolledApzc);
|
||||
nsRefPtr<AsyncPanZoomController> apzc = GetTouchInputBlockAPZC(aInput, &mInOverscrolledApzc);
|
||||
if (apzc != mApzcForInputBlock) {
|
||||
// If we're moving to a different APZC as our input target, then send a cancel event
|
||||
// to the old one so that it clears its internal state. Otherwise it could get left
|
||||
// in the middle of a panning touch block (for example) and not clean up properly.
|
||||
if (mApzcForInputBlock) {
|
||||
MultiTouchInput cancel(MultiTouchInput::MULTITOUCH_CANCEL, 0, TimeStamp::Now(), 0);
|
||||
mApzcForInputBlock->ReceiveInputEvent(cancel);
|
||||
}
|
||||
mApzcForInputBlock = apzc;
|
||||
}
|
||||
|
||||
if (mApzcForInputBlock) {
|
||||
// Cache apz transform so it can be used for future events in this block.
|
||||
gfx3DMatrix transformToGecko;
|
||||
@ -599,26 +501,28 @@ APZCTreeManager::ProcessTouchEvent(WidgetTouchEvent& aEvent,
|
||||
// Reset the cached apz transform
|
||||
mCachedTransformToApzcForInputBlock = gfx3DMatrix();
|
||||
}
|
||||
} else if (mApzcForInputBlock) {
|
||||
APZCTM_LOG("Re-using APZC %p as continuation of event block\n", mApzcForInputBlock.get());
|
||||
}
|
||||
|
||||
// If we receive a touch-cancel, it means all touches are finished, so we
|
||||
// can stop ignoring any that we were ignoring.
|
||||
if (aEvent.message == NS_TOUCH_CANCEL) {
|
||||
if (aInput.mType == MultiTouchInput::MULTITOUCH_CANCEL) {
|
||||
mRetainedTouchIdentifier = -1;
|
||||
}
|
||||
|
||||
// If we are currently ignoring any touch points, filter them out from the
|
||||
// set of touch points included in this event. Note that we modify aEvent
|
||||
// set of touch points included in this event. Note that we modify aInput
|
||||
// itself, so that the touch points are also filtered out when the caller
|
||||
// passes the event on to content.
|
||||
if (mRetainedTouchIdentifier != -1) {
|
||||
for (size_t j = 0; j < aEvent.touches.Length(); ++j) {
|
||||
if (aEvent.touches[j]->Identifier() != mRetainedTouchIdentifier) {
|
||||
aEvent.touches.RemoveElementAt(j);
|
||||
for (size_t j = 0; j < aInput.mTouches.Length(); ++j) {
|
||||
if (aInput.mTouches[j].mIdentifier != mRetainedTouchIdentifier) {
|
||||
aInput.mTouches.RemoveElementAt(j);
|
||||
--j;
|
||||
}
|
||||
}
|
||||
if (aEvent.touches.IsEmpty()) {
|
||||
if (aInput.mTouches.IsEmpty()) {
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
@ -629,7 +533,7 @@ APZCTreeManager::ProcessTouchEvent(WidgetTouchEvent& aEvent,
|
||||
// This ensures that the sequence of touch points an APZC sees in an
|
||||
// input block are all in the same coordinate space.
|
||||
gfx3DMatrix transformToApzc = mCachedTransformToApzcForInputBlock;
|
||||
MultiTouchInput inputForApzc(aEvent);
|
||||
MultiTouchInput inputForApzc(aInput);
|
||||
for (size_t i = 0; i < inputForApzc.mTouches.Length(); i++) {
|
||||
ApplyTransform(&(inputForApzc.mTouches[i].mScreenPoint), transformToApzc);
|
||||
}
|
||||
@ -641,31 +545,36 @@ APZCTreeManager::ProcessTouchEvent(WidgetTouchEvent& aEvent,
|
||||
gfx3DMatrix transformToGecko;
|
||||
GetInputTransforms(mApzcForInputBlock, transformToApzc, transformToGecko);
|
||||
gfx3DMatrix outTransform = transformToApzc * transformToGecko;
|
||||
for (size_t i = 0; i < aEvent.touches.Length(); i++) {
|
||||
ApplyTransform(&(aEvent.touches[i]->mRefPoint), outTransform);
|
||||
for (size_t i = 0; i < aInput.mTouches.Length(); i++) {
|
||||
ApplyTransform(&(aInput.mTouches[i].mScreenPoint), outTransform);
|
||||
}
|
||||
}
|
||||
|
||||
nsEventStatus result = mInOverscrolledApzc ? nsEventStatus_eConsumeNoDefault
|
||||
: mApzcForInputBlock ? nsEventStatus_eConsumeDoDefault
|
||||
: nsEventStatus_eIgnore;
|
||||
// If we have an mApzcForInputBlock and it's the end of the touch sequence
|
||||
// then null it out so we don't keep a dangling reference and leak things.
|
||||
if (aEvent.message == NS_TOUCH_CANCEL ||
|
||||
aEvent.message == NS_TOUCH_END) {
|
||||
if (mTouchCount >= aEvent.touches.Length()) {
|
||||
|
||||
if (aInput.mType == MultiTouchInput::MULTITOUCH_END) {
|
||||
if (mTouchCount >= aInput.mTouches.Length()) {
|
||||
// NS_TOUCH_END event contains only released touches thus decrementing.
|
||||
mTouchCount -= aEvent.touches.Length();
|
||||
mTouchCount -= aInput.mTouches.Length();
|
||||
} else {
|
||||
NS_WARNING("Got an unexpected touchend/touchcancel");
|
||||
mTouchCount = 0;
|
||||
}
|
||||
if (mTouchCount == 0) {
|
||||
mApzcForInputBlock = nullptr;
|
||||
mInOverscrolledApzc = false;
|
||||
mRetainedTouchIdentifier = -1;
|
||||
ClearOverscrollHandoffChain();
|
||||
}
|
||||
} else if (aInput.mType == MultiTouchInput::MULTITOUCH_CANCEL) {
|
||||
mTouchCount = 0;
|
||||
}
|
||||
|
||||
// If it's the end of the touch sequence then clear out variables so we
|
||||
// keep dangling references and leak things.
|
||||
if (mTouchCount == 0) {
|
||||
mApzcForInputBlock = nullptr;
|
||||
mInOverscrolledApzc = false;
|
||||
mRetainedTouchIdentifier = -1;
|
||||
ClearOverscrollHandoffChain();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -714,12 +623,27 @@ nsEventStatus
|
||||
APZCTreeManager::ReceiveInputEvent(WidgetInputEvent& aEvent,
|
||||
ScrollableLayerGuid* aOutTargetGuid)
|
||||
{
|
||||
// This function will be removed as part of bug 930939.
|
||||
// In general it is preferable to use the version of ReceiveInputEvent
|
||||
// that takes an InputData, as that is usable from off-main-thread.
|
||||
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
switch (aEvent.eventStructType) {
|
||||
case NS_TOUCH_EVENT: {
|
||||
WidgetTouchEvent& touchEvent = *aEvent.AsTouchEvent();
|
||||
return ProcessTouchEvent(touchEvent, aOutTargetGuid);
|
||||
MultiTouchInput touchInput(touchEvent);
|
||||
nsEventStatus result = ProcessTouchInput(touchInput, aOutTargetGuid);
|
||||
// touchInput was modified in-place to possibly remove some
|
||||
// touch points (if we are overscrolled), and the coordinates were
|
||||
// modified using the APZ untransform. We need to copy these changes
|
||||
// back into the WidgetInputEvent.
|
||||
touchEvent.touches.Clear();
|
||||
touchEvent.touches.SetCapacity(touchInput.mTouches.Length());
|
||||
for (size_t i = 0; i < touchInput.mTouches.Length(); i++) {
|
||||
*touchEvent.touches.AppendElement() = touchInput.mTouches[i].ToNewDOMTouch();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
default: {
|
||||
return ProcessEvent(aEvent, aOutTargetGuid);
|
||||
@ -1043,6 +967,8 @@ APZCTreeManager::BuildOverscrollHandoffChain(const nsRefPtr<AsyncPanZoomControll
|
||||
mOverscrollHandoffChain.clear();
|
||||
return;
|
||||
}
|
||||
APZCTM_LOG("mOverscrollHandoffChain[%d] = %p\n", mOverscrollHandoffChain.length(), apzc);
|
||||
|
||||
if (apzc->GetScrollHandoffParentId() == FrameMetrics::NULL_SCROLL_ID) {
|
||||
if (!apzc->IsRootForLayersId()) {
|
||||
// This probably indicates a bug or missed case in layout code
|
||||
|
@ -25,6 +25,7 @@ class gfx3DMatrix;
|
||||
|
||||
namespace mozilla {
|
||||
class InputData;
|
||||
class MultiTouchInput;
|
||||
|
||||
namespace layers {
|
||||
|
||||
@ -329,9 +330,9 @@ private:
|
||||
bool* aOutInOverscrolledApzc);
|
||||
already_AddRefed<AsyncPanZoomController> CommonAncestor(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2);
|
||||
already_AddRefed<AsyncPanZoomController> RootAPZCForLayersId(AsyncPanZoomController* aApzc);
|
||||
already_AddRefed<AsyncPanZoomController> GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent,
|
||||
already_AddRefed<AsyncPanZoomController> GetTouchInputBlockAPZC(const MultiTouchInput& aEvent,
|
||||
bool* aOutInOverscrolledApzc);
|
||||
nsEventStatus ProcessTouchEvent(WidgetTouchEvent& touchEvent,
|
||||
nsEventStatus ProcessTouchInput(MultiTouchInput& aInput,
|
||||
ScrollableLayerGuid* aOutTargetGuid);
|
||||
nsEventStatus ProcessEvent(WidgetInputEvent& inputEvent,
|
||||
ScrollableLayerGuid* aOutTargetGuid);
|
||||
|
@ -957,6 +957,7 @@ nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent)
|
||||
mX.EndTouch(aEvent.mTime);
|
||||
mY.EndTouch(aEvent.mTime);
|
||||
SetState(FLING);
|
||||
APZC_LOG("%p starting a fling animation\n", this);
|
||||
StartAnimation(new FlingAnimation(*this,
|
||||
true /* apply acceleration */,
|
||||
false /* allow overscroll */));
|
||||
@ -1503,6 +1504,7 @@ bool AsyncPanZoomController::AttemptScroll(const ScreenPoint& aStartPoint,
|
||||
// If there is no APZC later in the handoff chain that accepted the
|
||||
// overscroll, try to accept it ourselves. We only accept it if we
|
||||
// are pannable.
|
||||
APZC_LOG("%p taking overscroll during panning\n", this);
|
||||
return OverscrollBy(cssOverscroll);
|
||||
}
|
||||
|
||||
@ -1629,6 +1631,7 @@ bool FlingAnimation::Sample(FrameMetrics& aFrameMetrics,
|
||||
shouldContinueFlingY = mApzc.mY.FlingApplyFrictionOrCancel(aDelta, friction, threshold);
|
||||
// If we shouldn't continue the fling, let's just stop and repaint.
|
||||
if (!shouldContinueFlingX && !shouldContinueFlingY) {
|
||||
APZC_LOG("%p ending fling animation. overscrolled=%d\n", &mApzc, mApzc.IsOverscrolled());
|
||||
// If we are in overscroll, schedule the snap-back animation that relieves it.
|
||||
if (mApzc.IsOverscrolled()) {
|
||||
mDeferredTasks.append(NewRunnableMethod(&mApzc, &AsyncPanZoomController::StartSnapBack));
|
||||
@ -2288,7 +2291,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
|
||||
mFrameMetrics.SetRootCompositionSize(aLayerMetrics.GetRootCompositionSize());
|
||||
mFrameMetrics.mResolution = aLayerMetrics.mResolution;
|
||||
mFrameMetrics.mCumulativeResolution = aLayerMetrics.mCumulativeResolution;
|
||||
mFrameMetrics.mHasScrollgrab = aLayerMetrics.mHasScrollgrab;
|
||||
mFrameMetrics.SetHasScrollgrab(aLayerMetrics.GetHasScrollgrab());
|
||||
|
||||
if (scrollOffsetUpdated) {
|
||||
APZC_LOG("%p updating scroll offset from (%f, %f) to (%f, %f)\n", this,
|
||||
|
@ -316,7 +316,7 @@ public:
|
||||
* Returns whether this APZC is for an element marked with the 'scrollgrab'
|
||||
* attribute.
|
||||
*/
|
||||
bool HasScrollgrab() const { return mFrameMetrics.mHasScrollgrab; }
|
||||
bool HasScrollgrab() const { return mFrameMetrics.GetHasScrollgrab(); }
|
||||
|
||||
/**
|
||||
* Returns whether this APZC has room to be panned (in any direction).
|
||||
|
@ -350,7 +350,9 @@ ContainerRender(ContainerT* aContainer,
|
||||
// with the background color by drawing a rectangle of the background color
|
||||
// over the entire composited area before drawing the container contents.
|
||||
if (AsyncPanZoomController* apzc = aContainer->GetAsyncPanZoomController()) {
|
||||
if (apzc->IsOverscrolled()) {
|
||||
// Make sure not to do this on a "scrollinfo" layer (one with an empty visible
|
||||
// region) because it's just a placeholder for APZ purposes.
|
||||
if (apzc->IsOverscrolled() && !aContainer->GetVisibleRegion().IsEmpty()) {
|
||||
gfxRGBA color = aContainer->GetBackgroundColor();
|
||||
// If the background is completely transparent, there's no point in
|
||||
// drawing anything for it. Hopefully the layers behind, if any, will
|
||||
|
@ -44,32 +44,24 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifdef ENABLE_INTL_API
|
||||
ifndef MOZ_NATIVE_ICU
|
||||
ifdef .PYMAKE
|
||||
ICU_MAKE = $(GMAKE)
|
||||
else
|
||||
ICU_MAKE = $(MAKE)
|
||||
endif
|
||||
|
||||
default:: buildicu
|
||||
|
||||
# - ICU requires GNU make according to its readme.html. pymake can't be used
|
||||
# because it doesn't support order only dependencies.
|
||||
# - Force ICU to use the standard suffix for object files because expandlibs
|
||||
# will discard all files with a non-standard suffix (bug 857450).
|
||||
# - Options for genrb: -k strict parsing; -R omit collation tailoring rules.
|
||||
buildicu::
|
||||
# ICU's build system is full of races, so force non-parallel build.
|
||||
ifdef CROSS_COMPILE
|
||||
+$(ICU_MAKE) -j1 -C host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R -C'
|
||||
+$(MAKE) -j1 -C host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R -C'
|
||||
endif
|
||||
+$(ICU_MAKE) -j1 -C target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R'
|
||||
+$(MAKE) -j1 -C target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R'
|
||||
$(ICU_LIB_RENAME)
|
||||
|
||||
distclean clean::
|
||||
ifdef CROSS_COMPILE
|
||||
+$(ICU_MAKE) -C host $@ STATIC_O=$(OBJ_SUFFIX)
|
||||
+$(MAKE) -C host $@ STATIC_O=$(OBJ_SUFFIX)
|
||||
endif
|
||||
+$(ICU_MAKE) -C target $@ STATIC_O=$(OBJ_SUFFIX)
|
||||
+$(MAKE) -C target $@ STATIC_O=$(OBJ_SUFFIX)
|
||||
|
||||
endif
|
||||
endif
|
||||
|
@ -4,7 +4,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
ifndef .PYMAKE
|
||||
ifeq (,$(MAKE_VERSION))
|
||||
$(error GNU Make is required)
|
||||
endif
|
||||
@ -12,7 +11,6 @@ make_min_ver := 3.81
|
||||
ifneq ($(make_min_ver),$(firstword $(sort $(make_min_ver) $(MAKE_VERSION))))
|
||||
$(error GNU Make $(make_min_ver) or higher is required)
|
||||
endif
|
||||
endif
|
||||
|
||||
TOPLEVEL_BUILD := 1
|
||||
|
||||
|
@ -803,7 +803,7 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
|
||||
// in the FrameMetrics so APZ knows to provide the scroll grabbing
|
||||
// behaviour.
|
||||
if (aScrollFrame && nsContentUtils::HasScrollgrab(aScrollFrame->GetContent())) {
|
||||
metrics.mHasScrollgrab = true;
|
||||
metrics.SetHasScrollgrab(true);
|
||||
}
|
||||
|
||||
aRoot->SetFrameMetrics(metrics);
|
||||
|
@ -5,6 +5,7 @@
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import org.mozilla.gecko.widget.GeckoPopupMenu;
|
||||
import org.mozilla.gecko.menu.GeckoMenuItem;
|
||||
|
||||
import android.view.Gravity;
|
||||
import android.view.Menu;
|
||||
@ -99,7 +100,7 @@ class ActionModeCompat implements GeckoPopupMenu.OnMenuItemClickListener,
|
||||
/* GeckoPopupMenu.onMenuItemLongClickListener */
|
||||
@Override
|
||||
public boolean onMenuItemLongClick(MenuItem item) {
|
||||
showTooltip(item);
|
||||
showTooltip((GeckoMenuItem) item);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -109,7 +110,7 @@ class ActionModeCompat implements GeckoPopupMenu.OnMenuItemClickListener,
|
||||
mPresenter.endActionModeCompat();
|
||||
}
|
||||
|
||||
private void showTooltip(MenuItem item) {
|
||||
private void showTooltip(GeckoMenuItem item) {
|
||||
// Computes the tooltip toast screen position (shown when long-tapping the menu item) with regards to the
|
||||
// menu item's position (i.e below the item and slightly to the left)
|
||||
int[] location = new int[2];
|
||||
|
@ -758,12 +758,17 @@ public class BrowserApp extends GeckoApp
|
||||
if (!TextUtils.isEmpty(text)) {
|
||||
Tabs.getInstance().loadUrl(text);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.CONTEXT_MENU);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "pasteandgo");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (itemId == R.id.site_settings) {
|
||||
// This can be selected from either the browser menu or the contextmenu, depending on the size and version (v11+) of the phone.
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Permissions:Get", null));
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "site_settings");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -771,11 +776,13 @@ public class BrowserApp extends GeckoApp
|
||||
String text = Clipboard.getText();
|
||||
if (!TextUtils.isEmpty(text)) {
|
||||
enterEditingMode(text);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "paste");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (itemId == R.id.subscribe) {
|
||||
// This can be selected from either the browser menu or the contextmenu, depending on the size and version (v11+) of the phone.
|
||||
Tab tab = Tabs.getInstance().getSelectedTab();
|
||||
if (tab != null && tab.hasFeeds()) {
|
||||
JSONObject args = new JSONObject();
|
||||
@ -785,6 +792,9 @@ public class BrowserApp extends GeckoApp
|
||||
Log.e(LOGTAG, "error building json arguments");
|
||||
}
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Feeds:Subscribe", args.toString()));
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "subscribe");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -815,6 +825,7 @@ public class BrowserApp extends GeckoApp
|
||||
String url = tab.getURL();
|
||||
if (url != null) {
|
||||
Clipboard.setText(url);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "copyurl");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -518,7 +518,8 @@ var SelectionHandler = {
|
||||
id: "selectall_action",
|
||||
icon: "drawable://ab_select_all",
|
||||
action: function(aElement) {
|
||||
SelectionHandler.startSelection(aElement)
|
||||
SelectionHandler.startSelection(aElement);
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "select_all");
|
||||
},
|
||||
order: 5,
|
||||
selector: {
|
||||
@ -541,6 +542,7 @@ var SelectionHandler = {
|
||||
|
||||
// copySelection closes the selection. Show a caret where we just cut the text.
|
||||
SelectionHandler.attachCaret(aElement);
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "cut");
|
||||
},
|
||||
order: 4,
|
||||
selector: {
|
||||
@ -557,6 +559,7 @@ var SelectionHandler = {
|
||||
icon: "drawable://ab_copy",
|
||||
action: function() {
|
||||
SelectionHandler.copySelection();
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "copy");
|
||||
},
|
||||
order: 3,
|
||||
selector: {
|
||||
@ -581,6 +584,7 @@ var SelectionHandler = {
|
||||
target.editor.paste(Ci.nsIClipboard.kGlobalClipboard);
|
||||
target.focus();
|
||||
SelectionHandler._closeSelection();
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "paste");
|
||||
}
|
||||
},
|
||||
order: 2,
|
||||
@ -601,6 +605,7 @@ var SelectionHandler = {
|
||||
icon: "drawable://ic_menu_share",
|
||||
action: function() {
|
||||
SelectionHandler.shareSelection();
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "share");
|
||||
},
|
||||
selector: {
|
||||
matches: function() {
|
||||
@ -618,6 +623,7 @@ var SelectionHandler = {
|
||||
action: function() {
|
||||
SelectionHandler.searchSelection();
|
||||
SelectionHandler._closeSelection();
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "search");
|
||||
},
|
||||
order: 1,
|
||||
selector: {
|
||||
@ -633,6 +639,7 @@ var SelectionHandler = {
|
||||
icon: "drawable://phone",
|
||||
action: function() {
|
||||
SelectionHandler.callSelection();
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "call");
|
||||
},
|
||||
order: 1,
|
||||
selector: {
|
||||
|
@ -434,9 +434,7 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
args.append('-s')
|
||||
|
||||
# Print entering/leaving directory messages. Some consumers look at
|
||||
# these to measure progress. Ideally, we'd do everything with pymake
|
||||
# and use hooks in its API. Unfortunately, it doesn't provide that
|
||||
# feature... yet.
|
||||
# these to measure progress.
|
||||
if print_directory:
|
||||
args.append('-w')
|
||||
|
||||
|
@ -460,11 +460,6 @@ $(addprefix export-,$(NSS_DIRS)): export-%: private_export-%
|
||||
$(addprefix private_export-,$(NSS_DIRS)): EXTRA_GMAKE_FLAGS =
|
||||
$(addprefix private_export-,$(NSS_DIRS)): private_export-%:
|
||||
|
||||
# Work around bug #836228 in pymake
|
||||
ifdef .PYMAKE
|
||||
$(foreach p,libs export private_export,$(addprefix $(p)-,$(NSS_DIRS))): *=$(subst $(NULL) $(NULL),-,$(wordlist 2,$(words $(subst -, ,$@)),$(subst -, ,$@)))
|
||||
endif
|
||||
|
||||
$(foreach p,libs export private_export,$(addprefix $(p)-,$(NSS_DIRS))):
|
||||
$(DEFAULT_GMAKE_ENV) $(MAKE) -C $(NSS_SRCDIR)/security/$* $(@:-$*=) $(DEFAULT_GMAKE_FLAGS)
|
||||
|
||||
|
@ -1402,6 +1402,36 @@ Example
|
||||
"google.urlbar": 7
|
||||
},
|
||||
|
||||
org.mozilla.searches.engines
|
||||
----------------------------
|
||||
|
||||
This measurement contains information about search engines.
|
||||
|
||||
Version 1
|
||||
^^^^^^^^^
|
||||
|
||||
This version debuted with Firefox 31 on desktop. It contains the
|
||||
following properties:
|
||||
|
||||
default
|
||||
Daily string identifier or name of the default search engine provider.
|
||||
|
||||
This field will only be collected if Telemetry is enabled. If
|
||||
Telemetry is enabled and then later disabled, this field may
|
||||
disappear from future days in the payload.
|
||||
|
||||
The special value ``NONE`` could occur if there is no default search
|
||||
engine.
|
||||
|
||||
The special value ``UNDEFINED`` could occur if a default search
|
||||
engine exists but its identifier could not be determined.
|
||||
|
||||
This field's contents are
|
||||
``Services.search.defaultEngine.identifier`` (if defined) or
|
||||
``"other-"`` + ``Services.search.defaultEngine.name`` if not.
|
||||
In other words, search engines without an ``.identifier``
|
||||
are prefixed with ``other-``.
|
||||
|
||||
org.mozilla.sync.sync
|
||||
---------------------
|
||||
|
||||
@ -1639,13 +1669,22 @@ lastActive
|
||||
ID of the final Telemetry Experiment that is active on a given day, if any.
|
||||
|
||||
|
||||
Version 2
|
||||
^^^^^^^^^
|
||||
|
||||
Adds an additional optional property:
|
||||
|
||||
lastActiveBranch
|
||||
If the experiment uses branches, the branch identifier string.
|
||||
|
||||
Example
|
||||
^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
"org.mozilla.experiments.info": {
|
||||
"_v": 1,
|
||||
"lastActive": "some.experiment.id"
|
||||
"_v": 2,
|
||||
"lastActive": "some.experiment.id",
|
||||
"lastActiveBranch": "control"
|
||||
}
|
||||
|
||||
|
@ -55,10 +55,15 @@ const LAST_NUMERIC_FIELD = {type: Metrics.Storage.FIELD_LAST_NUMERIC};
|
||||
const LAST_TEXT_FIELD = {type: Metrics.Storage.FIELD_LAST_TEXT};
|
||||
const DAILY_DISCRETE_NUMERIC_FIELD = {type: Metrics.Storage.FIELD_DAILY_DISCRETE_NUMERIC};
|
||||
const DAILY_LAST_NUMERIC_FIELD = {type: Metrics.Storage.FIELD_DAILY_LAST_NUMERIC};
|
||||
const DAILY_LAST_TEXT_FIELD = {type: Metrics.Storage.FIELD_DAILY_LAST_TEXT};
|
||||
const DAILY_COUNTER_FIELD = {type: Metrics.Storage.FIELD_DAILY_COUNTER};
|
||||
|
||||
const TELEMETRY_PREF = "toolkit.telemetry.enabled";
|
||||
|
||||
function isTelemetryEnabled(prefs) {
|
||||
return prefs.get(TELEMETRY_PREF, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents basic application state.
|
||||
*
|
||||
@ -353,7 +358,7 @@ AppInfoProvider.prototype = Object.freeze({
|
||||
},
|
||||
|
||||
_recordIsTelemetryEnabled: function (m) {
|
||||
let enabled = TELEMETRY_PREF && this._prefs.get(TELEMETRY_PREF, false);
|
||||
let enabled = isTelemetryEnabled(this._prefs);
|
||||
this._log.debug("Recording telemetry enabled (" + TELEMETRY_PREF + "): " + enabled);
|
||||
yield m.setDailyLastNumeric("isTelemetryEnabled", enabled ? 1 : 0);
|
||||
},
|
||||
@ -1282,8 +1287,25 @@ SearchCountMeasurement3.prototype = Object.freeze({
|
||||
},
|
||||
});
|
||||
|
||||
function SearchEnginesMeasurement1() {
|
||||
Metrics.Measurement.call(this);
|
||||
}
|
||||
|
||||
SearchEnginesMeasurement1.prototype = Object.freeze({
|
||||
__proto__: Metrics.Measurement.prototype,
|
||||
|
||||
name: "engines",
|
||||
version: 1,
|
||||
|
||||
fields: {
|
||||
default: DAILY_LAST_TEXT_FIELD,
|
||||
},
|
||||
});
|
||||
|
||||
this.SearchesProvider = function () {
|
||||
Metrics.Provider.call(this);
|
||||
|
||||
this._prefs = new Preferences({defaultBranch: null});
|
||||
};
|
||||
|
||||
this.SearchesProvider.prototype = Object.freeze({
|
||||
@ -1294,6 +1316,7 @@ this.SearchesProvider.prototype = Object.freeze({
|
||||
SearchCountMeasurement1,
|
||||
SearchCountMeasurement2,
|
||||
SearchCountMeasurement3,
|
||||
SearchEnginesMeasurement1,
|
||||
],
|
||||
|
||||
/**
|
||||
@ -1308,6 +1331,36 @@ this.SearchesProvider.prototype = Object.freeze({
|
||||
return deferred.promise;
|
||||
},
|
||||
|
||||
collectDailyData: function () {
|
||||
return this.storage.enqueueTransaction(function getDaily() {
|
||||
// We currently only record this if Telemetry is enabled.
|
||||
if (!isTelemetryEnabled(this._prefs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let m = this.getMeasurement(SearchEnginesMeasurement1.prototype.name,
|
||||
SearchEnginesMeasurement1.prototype.version);
|
||||
|
||||
let engine;
|
||||
try {
|
||||
engine = Services.search.defaultEngine;
|
||||
} catch (e) {}
|
||||
let name;
|
||||
|
||||
if (!engine) {
|
||||
name = "NONE";
|
||||
} else if (engine.identifier) {
|
||||
name = engine.identifier;
|
||||
} else if (engine.name) {
|
||||
name = "other-" + engine.name;
|
||||
} else {
|
||||
name = "UNDEFINED";
|
||||
}
|
||||
|
||||
yield m.setDailyLastText("default", name);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
* Record that a search occurred.
|
||||
*
|
||||
|
@ -6,6 +6,7 @@
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Metrics.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
let bsp = Cu.import("resource://gre/modules/services/healthreport/providers.jsm");
|
||||
|
||||
const DEFAULT_ENGINES = [
|
||||
@ -41,7 +42,7 @@ add_test(function test_constructor() {
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
add_task(function test_record() {
|
||||
add_task(function* test_record() {
|
||||
let storage = yield Metrics.Storage("record");
|
||||
let provider = new MockSearchesProvider();
|
||||
|
||||
@ -104,7 +105,7 @@ add_task(function test_record() {
|
||||
yield storage.close();
|
||||
});
|
||||
|
||||
add_task(function test_includes_other_fields() {
|
||||
add_task(function* test_includes_other_fields() {
|
||||
let storage = yield Metrics.Storage("includes_other_fields");
|
||||
let provider = new MockSearchesProvider();
|
||||
|
||||
@ -134,3 +135,50 @@ add_task(function test_includes_other_fields() {
|
||||
|
||||
yield storage.close();
|
||||
});
|
||||
|
||||
add_task(function* test_default_search_engine() {
|
||||
let storage = yield Metrics.Storage("default_search_engine");
|
||||
let provider = new SearchesProvider();
|
||||
yield provider.init(storage);
|
||||
|
||||
let m = provider.getMeasurement("engines", 1);
|
||||
|
||||
// Ensure no collection if Telemetry not enabled.
|
||||
Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
|
||||
|
||||
let now = new Date();
|
||||
yield provider.collectDailyData();
|
||||
|
||||
let data = yield m.getValues();
|
||||
Assert.equal(data.days.hasDay(now), false);
|
||||
|
||||
// Now enable telemetry and ensure we populate.
|
||||
Services.prefs.setBoolPref("toolkit.telemetry.enabled", true);
|
||||
|
||||
yield provider.collectDailyData();
|
||||
data = yield m.getValues();
|
||||
Assert.ok(data.days.hasDay(now));
|
||||
|
||||
let day = data.days.getDay(now);
|
||||
Assert.equal(day.size, 1);
|
||||
Assert.ok(day.has("default"));
|
||||
|
||||
// test environment doesn't have a default engine.
|
||||
Assert.equal(day.get("default"), "NONE");
|
||||
|
||||
Services.search.addEngineWithDetails("testdefault",
|
||||
"http://localhost/icon.png",
|
||||
null,
|
||||
"test description",
|
||||
"GET",
|
||||
"http://localhost/search/%s");
|
||||
let engine1 = Services.search.getEngineByName("testdefault");
|
||||
Assert.ok(engine1);
|
||||
Services.search.defaultEngine = engine1;
|
||||
|
||||
yield provider.collectDailyData();
|
||||
data = yield m.getValues();
|
||||
Assert.equal(data.days.getDay(now).get("default"), "other-testdefault");
|
||||
|
||||
yield storage.close();
|
||||
});
|
||||
|
@ -9,9 +9,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# Bug 1028035: Linking xul-gtest.dll takes too long, so we disable GTest on
|
||||
# Windows PGO builds.
|
||||
# Bug 1029469: fix_stack_using_bpsyms.py doesn't know how to deal with the
|
||||
# second xul.pdb file that linking xul-gtest.dll creates.
|
||||
ifeq (WINNT,$(OS_ARCH))
|
||||
ifeq (1_WINNT,$(MOZ_PGO)_$(OS_ARCH))
|
||||
SKIP_GTEST_DURING_MAKE_CHECK ?= 1
|
||||
endif
|
||||
|
||||
|
@ -535,9 +535,11 @@ let Impl = {
|
||||
try {
|
||||
let scope = {};
|
||||
Cu.import("resource:///modules/experiments/Experiments.jsm", scope);
|
||||
let activeExperiment = scope.Experiments.instance().getActiveExperimentID();
|
||||
let experiments = scope.Experiments.instance()
|
||||
let activeExperiment = experiments.getActiveExperimentID();
|
||||
if (activeExperiment) {
|
||||
ret.activeExperiment = activeExperiment;
|
||||
ret.activeExperimentBranch = experiments.getActiveExperimentBranch();
|
||||
}
|
||||
} catch(e) {
|
||||
// If this is not Firefox, the import will fail.
|
||||
|
5
toolkit/library/StaticXULComponents.ld
Normal file
5
toolkit/library/StaticXULComponents.ld
Normal file
@ -0,0 +1,5 @@
|
||||
SECTIONS {
|
||||
.data.rel.ro : {
|
||||
*(.kPStaticModules)
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
#include "mozilla/Module.h"
|
||||
#include "mozilla/NullPtr.h"
|
||||
|
||||
/* Ensure end_kPStaticModules is at the end of the .kPStaticModules section
|
||||
* on Windows. Somehow, placing the object last is not enough with PGO/LTCG. */
|
||||
#ifdef _MSC_VER
|
||||
/* Sections on Windows are in two parts, separated with $. When linking,
|
||||
* sections with the same first part are all grouped, and ordered
|
||||
* alphabetically with the second part as sort key. */
|
||||
# pragma section(".kPStaticModules$Z", read)
|
||||
# undef NSMODULE_SECTION
|
||||
# define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$Z"), dllexport)
|
||||
#endif
|
||||
NSMODULE_DEFN(end_kPStaticModules) = nullptr;
|
11
toolkit/library/StaticXULComponentsEnd/moz.build
Normal file
11
toolkit/library/StaticXULComponentsEnd/moz.build
Normal file
@ -0,0 +1,11 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
SOURCES += [
|
||||
'StaticXULComponentsEnd.cpp',
|
||||
]
|
||||
|
||||
LIBRARY_NAME = 'StaticXULComponentsEnd'
|
||||
|
||||
DEFINES['MOZILLA_INTERNAL_API'] = True
|
4
toolkit/library/StaticXULComponentsStart.cpp
Normal file
4
toolkit/library/StaticXULComponentsStart.cpp
Normal file
@ -0,0 +1,4 @@
|
||||
#include "mozilla/Module.h"
|
||||
#include "mozilla/NullPtr.h"
|
||||
|
||||
NSMODULE_DEFN(start_kPStaticModules) = nullptr;
|
@ -24,4 +24,6 @@ endif
|
||||
$(DIST)/bin/dependentlibs.list.gtest: $(DIST)/bin/dependentlibs.list
|
||||
sed -e 's|$(SHARED_LIBRARY)|gtest/$(SHARED_LIBRARY)|' $< > $@
|
||||
|
||||
LINK_PDBFILE = xul-gtest.pdb
|
||||
|
||||
endif
|
||||
|
@ -246,3 +246,28 @@ OS_LIBS += $(LIBICONV)
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32)
|
||||
endif
|
||||
|
||||
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,StaticXULComponentsEnd,$(DEPTH)/toolkit/library/StaticXULComponentsEnd)
|
||||
|
||||
# BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
|
||||
# exists. Using an implicit linker script to make it fold that section in
|
||||
# .data.rel.ro makes it create multiple PT_LOADs. That implicit linker
|
||||
# script however makes gold misbehave, first because it doesn't like that
|
||||
# the linker script is given after crtbegin.o, and even past that, replaces
|
||||
# the default section rules with those from the script instead of
|
||||
# supplementing them. Which leads to a lib with a huge load of sections.
|
||||
ifdef LD_IS_BFD
|
||||
EXTRA_DSO_LDOPTS += $(topsrcdir)/toolkit/library/StaticXULComponents.ld
|
||||
endif
|
||||
|
||||
ifeq (WINNT,$(OS_TARGET))
|
||||
get_first_and_last = dumpbin -exports $1 | grep _NSModule@@ | sort -k 3 | sed -n 's/^.*?\([^@]*\)@@.*$$/\1/;1p;$$p'
|
||||
else
|
||||
get_first_and_last = $(TOOLCHAIN_PREFIX)nm -g $1 | grep _NSModule$$ | sort | sed -n 's/^.* _*\([^ ]*\)$$/\1/;1p;$$p'
|
||||
endif
|
||||
|
||||
LOCAL_CHECKS = test "$$($(get_first_and_last) | xargs echo)" != "start_kPStaticModules_NSModule end_kPStaticModules_NSModule" && echo "NSModules are not ordered appropriately" && exit 1 || exit 0
|
||||
|
||||
ifeq (Linux,$(OS_ARCH))
|
||||
LOCAL_CHECKS += ; test "$$($(TOOLCHAIN_PREFIX)readelf -l $1 | awk '$1 == "LOAD" { t += 1 } END { print t }')" -le 1 && echo "Only one PT_LOAD segment" && exit 1 || exit 0
|
||||
endif
|
||||
|
@ -7,43 +7,18 @@
|
||||
LIBRARY_NAME = 'xul'
|
||||
|
||||
SOURCES += [
|
||||
'nsStaticXULComponents.cpp',
|
||||
'StaticXULComponentsStart.cpp',
|
||||
]
|
||||
|
||||
# This, combined with the fact the file is first, makes the start pointer
|
||||
# it contains first in Windows PGO builds.
|
||||
SOURCES['StaticXULComponentsStart.cpp'].no_pgo = True
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
SOURCES += [
|
||||
'nsDllMain.cpp',
|
||||
]
|
||||
|
||||
# component libraries
|
||||
additional_defines = (
|
||||
'MOZ_AUTH_EXTENSION',
|
||||
'MOZ_GIO_COMPONENT',
|
||||
'MOZ_JSDEBUGGER',
|
||||
'MOZ_PERMISSIONS',
|
||||
'MOZ_PREF_EXTENSIONS',
|
||||
'MOZ_SPELLCHECK',
|
||||
'MOZ_UNIVERSALCHARDET',
|
||||
'MOZ_ZIPWRITER',
|
||||
)
|
||||
|
||||
for var in additional_defines:
|
||||
if CONFIG[var]:
|
||||
DEFINES[var] = True
|
||||
|
||||
if CONFIG['MOZ_DEBUG'] and CONFIG['ENABLE_TESTS']:
|
||||
DEFINES['ENABLE_LAYOUTDEBUG'] = True
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('android', 'gonk', 'qt',
|
||||
'cocoa', 'windows') and \
|
||||
CONFIG['MOZ_XUL']:
|
||||
DEFINES['MOZ_FILEVIEW'] = True
|
||||
|
||||
# Platform-specific icon channel stuff - supported mostly-everywhere
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'mac', 'cocoa',
|
||||
'gtk2', 'gtk3', 'qt', 'android'):
|
||||
DEFINES['ICON_DECODER'] = True
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/config',
|
||||
# need widget/windows for resource.h (included from widget.rc)
|
||||
@ -57,4 +32,4 @@ if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
DIRS += ['build', 'gtest']
|
||||
DIRS += ['StaticXULComponentsEnd', 'build', 'gtest']
|
||||
|
@ -1,276 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/Module.h"
|
||||
#include "nsXPCOM.h"
|
||||
#include "nsMemory.h"
|
||||
|
||||
#ifdef MOZ_AUTH_EXTENSION
|
||||
#define AUTH_MODULE MODULE(nsAuthModule)
|
||||
#else
|
||||
#define AUTH_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_PERMISSIONS
|
||||
#define PERMISSIONS_MODULES \
|
||||
MODULE(nsCookieModule) \
|
||||
MODULE(nsPermissionsModule)
|
||||
#else
|
||||
#define PERMISSIONS_MODULES
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_UNIVERSALCHARDET
|
||||
#define UNIVERSALCHARDET_MODULE MODULE(nsUniversalCharDetModule)
|
||||
#else
|
||||
#define UNIVERSALCHARDET_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
# define WIDGET_MODULES MODULE(nsWidgetModule)
|
||||
#elif defined(XP_MACOSX)
|
||||
# define WIDGET_MODULES MODULE(nsWidgetMacModule)
|
||||
#elif defined(MOZ_WIDGET_GTK)
|
||||
# define WIDGET_MODULES MODULE(nsWidgetGtk2Module)
|
||||
#elif defined(MOZ_WIDGET_QT)
|
||||
# define WIDGET_MODULES MODULE(nsWidgetQtModule)
|
||||
#elif defined(MOZ_WIDGET_ANDROID)
|
||||
# define WIDGET_MODULES MODULE(nsWidgetAndroidModule)
|
||||
#elif defined(MOZ_WIDGET_GONK)
|
||||
# define WIDGET_MODULES MODULE(nsWidgetGonkModule)
|
||||
#else
|
||||
# error Unknown widget module.
|
||||
#endif
|
||||
|
||||
#ifndef MOZ_B2G
|
||||
#define CONTENT_PROCESS_WIDGET_MODULES MODULE(nsContentProcessWidgetModule)
|
||||
#else
|
||||
#define CONTENT_PROCESS_WIDGET_MODULES
|
||||
#endif
|
||||
|
||||
#ifdef ICON_DECODER
|
||||
#define ICON_MODULE MODULE(nsIconDecoderModule)
|
||||
#else
|
||||
#define ICON_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_ENABLE_XREMOTE
|
||||
#define XREMOTE_MODULES MODULE(RemoteServiceModule)
|
||||
#else
|
||||
#define XREMOTE_MODULES
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_PREF_EXTENSIONS
|
||||
#define SYSTEMPREF_MODULES MODULE(nsAutoConfigModule)
|
||||
#else
|
||||
#define SYSTEMPREF_MODULES
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_LAYOUTDEBUG
|
||||
#define LAYOUT_DEBUG_MODULE MODULE(nsLayoutDebugModule)
|
||||
#else
|
||||
#define LAYOUT_DEBUG_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_JSDEBUGGER
|
||||
#define JSDEBUGGER_MODULES \
|
||||
MODULE(JavaScript_Debugger)
|
||||
#else
|
||||
#define JSDEBUGGER_MODULES
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_FILEVIEW) && defined(MOZ_XUL)
|
||||
#define FILEVIEW_MODULE MODULE(nsFileViewModule)
|
||||
#else
|
||||
#define FILEVIEW_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_ZIPWRITER
|
||||
#define ZIPWRITER_MODULE MODULE(ZipWriterModule)
|
||||
#else
|
||||
#define ZIPWRITER_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_PLACES
|
||||
#define PLACES_MODULES \
|
||||
MODULE(nsPlacesModule)
|
||||
#else
|
||||
#define PLACES_MODULES
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#define XULENABLED_MODULES \
|
||||
MODULE(tkAutoCompleteModule) \
|
||||
MODULE(satchel) \
|
||||
MODULE(PKI)
|
||||
#else
|
||||
#define XULENABLED_MODULES
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_SPELLCHECK
|
||||
#define SPELLCHECK_MODULE MODULE(mozSpellCheckerModule)
|
||||
#else
|
||||
#define SPELLCHECK_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
#define UNIXPROXY_MODULE MODULE(nsUnixProxyModule)
|
||||
#endif
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
#define UNIXPROXY_MODULE MODULE(nsUnixProxyModule)
|
||||
#endif
|
||||
#endif
|
||||
#ifndef UNIXPROXY_MODULE
|
||||
#define UNIXPROXY_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#define OSXPROXY_MODULE MODULE(nsOSXProxyModule)
|
||||
#else
|
||||
#define OSXPROXY_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(XP_WIN)
|
||||
#define WINDOWSPROXY_MODULE MODULE(nsWindowsProxyModule)
|
||||
#else
|
||||
#define WINDOWSPROXY_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
#define ANDROIDPROXY_MODULE MODULE(nsAndroidProxyModule)
|
||||
#else
|
||||
#define ANDROIDPROXY_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(BUILD_CTYPES)
|
||||
#define JSCTYPES_MODULE MODULE(jsctypes)
|
||||
#else
|
||||
#define JSCTYPES_MODULE
|
||||
#endif
|
||||
|
||||
#ifndef MOZ_APP_COMPONENT_MODULES
|
||||
#if defined(MOZ_APP_COMPONENT_INCLUDE)
|
||||
#include MOZ_APP_COMPONENT_INCLUDE
|
||||
#define MOZ_APP_COMPONENT_MODULES APP_COMPONENT_MODULES
|
||||
#else
|
||||
#define MOZ_APP_COMPONENT_MODULES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_ENABLE_PROFILER_SPS)
|
||||
#define PROFILER_MODULE MODULE(nsProfilerModule)
|
||||
#else
|
||||
#define PROFILER_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WEBRTC)
|
||||
#define PEERCONNECTION_MODULE MODULE(peerconnection)
|
||||
#else
|
||||
#define PEERCONNECTION_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_GIO_COMPONENT)
|
||||
#define GIO_MODULE MODULE(nsGIOModule)
|
||||
#else
|
||||
#define GIO_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_SYNTH_PICO)
|
||||
#define SYNTH_PICO_MODULE MODULE(synthpico)
|
||||
#else
|
||||
#define SYNTH_PICO_MODULE
|
||||
#endif
|
||||
|
||||
#define XUL_MODULES \
|
||||
MODULE(nsUConvModule) \
|
||||
MODULE(nsI18nModule) \
|
||||
MODULE(nsChardetModule) \
|
||||
UNIVERSALCHARDET_MODULE \
|
||||
MODULE(necko) \
|
||||
PERMISSIONS_MODULES \
|
||||
AUTH_MODULE \
|
||||
MODULE(nsJarModule) \
|
||||
ZIPWRITER_MODULE \
|
||||
MODULE(StartupCacheModule) \
|
||||
MODULE(nsPrefModule) \
|
||||
MODULE(nsRDFModule) \
|
||||
MODULE(nsWindowDataSourceModule) \
|
||||
MODULE(nsParserModule) \
|
||||
MODULE(nsImageLib2Module) \
|
||||
MODULE(nsMediaSnifferModule) \
|
||||
MODULE(nsGfxModule) \
|
||||
PROFILER_MODULE \
|
||||
WIDGET_MODULES \
|
||||
CONTENT_PROCESS_WIDGET_MODULES \
|
||||
ICON_MODULE \
|
||||
MODULE(nsPluginModule) \
|
||||
MODULE(nsLayoutModule) \
|
||||
MODULE(docshell_provider) \
|
||||
MODULE(embedcomponents) \
|
||||
MODULE(Browser_Embedding_Module) \
|
||||
MODULE(appshell) \
|
||||
MODULE(nsTransactionManagerModule) \
|
||||
MODULE(nsComposerModule) \
|
||||
MODULE(application) \
|
||||
MODULE(Apprunner) \
|
||||
MODULE(CommandLineModule) \
|
||||
FILEVIEW_MODULE \
|
||||
MODULE(mozStorageModule) \
|
||||
PLACES_MODULES \
|
||||
XULENABLED_MODULES \
|
||||
MODULE(nsToolkitCompsModule) \
|
||||
XREMOTE_MODULES \
|
||||
JSDEBUGGER_MODULES \
|
||||
MODULE(BOOT) \
|
||||
MODULE(NSS) \
|
||||
SYSTEMPREF_MODULES \
|
||||
SPELLCHECK_MODULE \
|
||||
LAYOUT_DEBUG_MODULE \
|
||||
UNIXPROXY_MODULE \
|
||||
OSXPROXY_MODULE \
|
||||
WINDOWSPROXY_MODULE \
|
||||
ANDROIDPROXY_MODULE \
|
||||
JSCTYPES_MODULE \
|
||||
MODULE(jsreflect) \
|
||||
MODULE(jsperf) \
|
||||
MODULE(identity) \
|
||||
MODULE(nsServicesCryptoModule) \
|
||||
MOZ_APP_COMPONENT_MODULES \
|
||||
MODULE(nsTelemetryModule) \
|
||||
MODULE(jsinspector) \
|
||||
MODULE(jsdebugger) \
|
||||
PEERCONNECTION_MODULE \
|
||||
GIO_MODULE \
|
||||
SYNTH_PICO_MODULE \
|
||||
MODULE(DiskSpaceWatcherModule) \
|
||||
/* end of list */
|
||||
|
||||
#define MODULE(_name) \
|
||||
NSMODULE_DECL(_name);
|
||||
|
||||
XUL_MODULES
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
MODULE(WifiCertServiceModule)
|
||||
MODULE(WifiProxyServiceModule)
|
||||
MODULE(NetworkWorkerModule)
|
||||
#endif
|
||||
|
||||
#undef MODULE
|
||||
|
||||
#define MODULE(_name) \
|
||||
&NSMODULE_NAME(_name),
|
||||
|
||||
extern const mozilla::Module *const *const kPStaticModules[] = {
|
||||
XUL_MODULES
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
MODULE(WifiCertServiceModule)
|
||||
MODULE(WifiProxyServiceModule)
|
||||
MODULE(NetworkWorkerModule)
|
||||
#endif
|
||||
nullptr
|
||||
};
|
||||
|
||||
#undef MODULE
|
@ -13,8 +13,13 @@
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
||||
template<class E> struct already_AddRefed;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace dom {
|
||||
class Touch;
|
||||
}
|
||||
|
||||
enum InputType
|
||||
{
|
||||
@ -108,14 +113,14 @@ public:
|
||||
mRotationAngle(aRotationAngle),
|
||||
mForce(aForce)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
SingleTouchData()
|
||||
{
|
||||
}
|
||||
|
||||
already_AddRefed<dom::Touch> ToNewDOMTouch();
|
||||
|
||||
// A unique number assigned to each SingleTouchData within a MultiTouchInput so
|
||||
// that they can be easily distinguished when handling a touch start/move/end.
|
||||
int32_t mIdentifier;
|
||||
@ -165,14 +170,20 @@ public:
|
||||
: InputData(MULTITOUCH_INPUT, aTime, aTimeStamp, aModifiers),
|
||||
mType(aType)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
MultiTouchInput()
|
||||
{
|
||||
}
|
||||
|
||||
MultiTouchInput(const MultiTouchInput& aOther)
|
||||
: InputData(MULTITOUCH_INPUT, aOther.mTime,
|
||||
aOther.mTimeStamp, aOther.modifiers)
|
||||
, mType(aOther.mType)
|
||||
{
|
||||
mTouches.AppendElements(aOther.mTouches);
|
||||
}
|
||||
|
||||
MultiTouchInput(const WidgetTouchEvent& aTouchEvent);
|
||||
|
||||
// This conversion from WidgetMouseEvent to MultiTouchInput is needed because
|
||||
|
@ -15,6 +15,18 @@ namespace mozilla {
|
||||
|
||||
using namespace dom;
|
||||
|
||||
already_AddRefed<Touch> SingleTouchData::ToNewDOMTouch()
|
||||
{
|
||||
NS_ABORT_IF_FALSE(NS_IsMainThread(),
|
||||
"Can only create dom::Touch instances on main thread");
|
||||
nsRefPtr<Touch> touch = new Touch(mIdentifier,
|
||||
nsIntPoint(mScreenPoint.x, mScreenPoint.y),
|
||||
nsIntPoint(mRadius.width, mRadius.height),
|
||||
mRotationAngle,
|
||||
mForce);
|
||||
return touch.forget();
|
||||
}
|
||||
|
||||
MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent)
|
||||
: InputData(MULTITOUCH_INPUT, aTouchEvent.time, aTouchEvent.timeStamp,
|
||||
aTouchEvent.modifiers)
|
||||
|
@ -118,8 +118,21 @@ struct Module
|
||||
|
||||
#if defined(MOZILLA_INTERNAL_API)
|
||||
# define NSMODULE_NAME(_name) _name##_NSModule
|
||||
# define NSMODULE_DECL(_name) extern mozilla::Module const *const NSMODULE_NAME(_name)
|
||||
# define NSMODULE_DEFN(_name) NSMODULE_DECL(_name)
|
||||
# if defined(_MSC_VER)
|
||||
# pragma section(".kPStaticModules$M", read)
|
||||
# pragma comment(linker, "/merge:.kPStaticModules=.rdata")
|
||||
# define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$M"), dllexport)
|
||||
# elif defined(__GNUC__)
|
||||
# if defined(__ELF__)
|
||||
# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("protected")))
|
||||
# elif defined(__MACH__)
|
||||
# define NSMODULE_SECTION __attribute__((section("__DATA, .kPStaticModules"), visibility("default")))
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(NSMODULE_SECTION)
|
||||
# error Do not know how to define sections.
|
||||
# endif
|
||||
# define NSMODULE_DEFN(_name) extern NSMODULE_SECTION mozilla::Module const *const NSMODULE_NAME(_name)
|
||||
#else
|
||||
# define NSMODULE_NAME(_name) NSModule
|
||||
# define NSMODULE_DEFN(_name) extern "C" NS_EXPORT mozilla::Module const *const NSModule
|
||||
|
@ -81,10 +81,6 @@ using namespace mozilla;
|
||||
|
||||
PRLogModuleInfo* nsComponentManagerLog = nullptr;
|
||||
|
||||
// defined in nsStaticXULComponents.cpp to contain all the components in
|
||||
// libxul.
|
||||
extern mozilla::Module const *const *const kPStaticModules[];
|
||||
|
||||
#if 0 || defined (DEBUG_timeless)
|
||||
#define SHOW_DENIED_ON_SHUTDOWN
|
||||
#define SHOW_CI_ON_EXISTING_SERVICE
|
||||
@ -278,6 +274,15 @@ nsComponentManagerImpl::nsComponentManagerImpl()
|
||||
|
||||
nsTArray<const mozilla::Module*>* nsComponentManagerImpl::sStaticModules;
|
||||
|
||||
NSMODULE_DEFN(start_kPStaticModules);
|
||||
NSMODULE_DEFN(end_kPStaticModules);
|
||||
|
||||
/* The content between start_kPStaticModules and end_kPStaticModules is gathered
|
||||
* by the linker from various objects containing symbols in a specific section.
|
||||
* ASAN considers (rightfully) the use of this content as a global buffer
|
||||
* overflow. But this is a deliberate and well-considered choice, with no proper
|
||||
* way to make ASAN happy. */
|
||||
MOZ_ASAN_BLACKLIST
|
||||
/* static */ void
|
||||
nsComponentManagerImpl::InitializeStaticModules()
|
||||
{
|
||||
@ -285,9 +290,10 @@ nsComponentManagerImpl::InitializeStaticModules()
|
||||
return;
|
||||
|
||||
sStaticModules = new nsTArray<const mozilla::Module*>;
|
||||
for (const mozilla::Module *const *const *staticModules = kPStaticModules;
|
||||
*staticModules; ++staticModules)
|
||||
sStaticModules->AppendElement(**staticModules);
|
||||
for (const mozilla::Module *const *staticModules = &NSMODULE_NAME(start_kPStaticModules) + 1;
|
||||
staticModules < &NSMODULE_NAME(end_kPStaticModules); ++staticModules)
|
||||
if (*staticModules) // ASAN adds padding
|
||||
sStaticModules->AppendElement(*staticModules);
|
||||
}
|
||||
|
||||
nsTArray<nsComponentManagerImpl::ComponentLocation>*
|
||||
|
Loading…
Reference in New Issue
Block a user