зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1597697 - Stop sending AS heartbeat ping to Tiles data pipeline. r=thecount
This turns off the telemetry to Tiles in m-c. Activity Stream related telemetry to Tiles will be handled separately. Differential Revision: https://phabricator.services.mozilla.com/D53875 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
273aab2e2a
Коммит
6914a98c54
|
@ -1554,8 +1554,6 @@ pref("toolkit.telemetry.bhrPing.enabled", true);
|
|||
// Ping Centre Telemetry settings.
|
||||
pref("browser.ping-centre.telemetry", true);
|
||||
pref("browser.ping-centre.log", false);
|
||||
pref("browser.ping-centre.staging.endpoint", "https://onyx_tiles.stage.mozaws.net/v3/links/ping-centre");
|
||||
pref("browser.ping-centre.production.endpoint", "https://tiles.services.mozilla.com/v3/links/ping-centre");
|
||||
|
||||
// Enable GMP support in the addon manager.
|
||||
pref("media.gmp-provider.enabled", true);
|
||||
|
|
|
@ -502,12 +502,6 @@ let LEGACY_ACTORS = {
|
|||
TelemetryTimestamps.add("blankWindowShown");
|
||||
})();
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
aboutNewTabService: [
|
||||
"@mozilla.org/browser/aboutnewtab-service;1",
|
||||
"nsIAboutNewTabService",
|
||||
],
|
||||
});
|
||||
XPCOMUtils.defineLazyGetter(
|
||||
this,
|
||||
"WeaveService",
|
||||
|
@ -548,7 +542,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
PageThumbs: "resource://gre/modules/PageThumbs.jsm",
|
||||
PdfJs: "resource://pdf.js/PdfJs.jsm",
|
||||
PermissionUI: "resource:///modules/PermissionUI.jsm",
|
||||
PingCentre: "resource:///modules/PingCentre.jsm",
|
||||
PlacesBackups: "resource://gre/modules/PlacesBackups.jsm",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
|
||||
PluralForm: "resource://gre/modules/PluralForm.jsm",
|
||||
|
@ -825,65 +818,6 @@ BrowserGlue.prototype = {
|
|||
Weave.Service.scheduler.delayedAutoConnect(delay);
|
||||
},
|
||||
|
||||
/**
|
||||
* Lazily initialize PingCentre
|
||||
*/
|
||||
get pingCentre() {
|
||||
const MAIN_TOPIC_ID = "main";
|
||||
Object.defineProperty(this, "pingCentre", {
|
||||
value: new PingCentre({ topic: MAIN_TOPIC_ID }),
|
||||
});
|
||||
return this.pingCentre;
|
||||
},
|
||||
|
||||
_sendMainPingCentrePing() {
|
||||
let newTabSetting;
|
||||
let homePageSetting;
|
||||
|
||||
// Check whether or not about:home and about:newtab have been overridden at this point.
|
||||
// Different settings are encoded as follows:
|
||||
// * Value 0: default
|
||||
// * Value 1: about:blank
|
||||
// * Value 2: web extension
|
||||
// * Value 3: other custom URL(s)
|
||||
// Settings for about:newtab and about:home are combined in a bitwise manner.
|
||||
|
||||
// Note that a user could use about:blank and web extension at the same time
|
||||
// to overwrite the about:newtab, but the web extension takes priority, so the
|
||||
// ordering matters in the following check.
|
||||
if (
|
||||
Services.prefs.getBoolPref("browser.newtabpage.enabled") &&
|
||||
!aboutNewTabService.overridden
|
||||
) {
|
||||
newTabSetting = 0;
|
||||
} else if (aboutNewTabService.newTabURL.startsWith("moz-extension://")) {
|
||||
newTabSetting = 2;
|
||||
} else if (!Services.prefs.getBoolPref("browser.newtabpage.enabled")) {
|
||||
newTabSetting = 1;
|
||||
} else {
|
||||
newTabSetting = 3;
|
||||
}
|
||||
|
||||
const homePageURL = HomePage.get();
|
||||
if (homePageURL === "about:home") {
|
||||
homePageSetting = 0;
|
||||
} else if (homePageURL === "about:blank") {
|
||||
homePageSetting = 1;
|
||||
} else if (homePageURL.startsWith("moz-extension://")) {
|
||||
homePageSetting = 2;
|
||||
} else {
|
||||
homePageSetting = 3;
|
||||
}
|
||||
|
||||
const payload = {
|
||||
event: "AS_ENABLED",
|
||||
value: newTabSetting | (homePageSetting << 2),
|
||||
};
|
||||
const ACTIVITY_STREAM_ID = "activity-stream";
|
||||
const options = { filter: ACTIVITY_STREAM_ID };
|
||||
this.pingCentre.sendPing(payload, options);
|
||||
},
|
||||
|
||||
// nsIObserver implementation
|
||||
observe: async function BG_observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
|
@ -1080,7 +1014,6 @@ BrowserGlue.prototype = {
|
|||
break;
|
||||
case "shield-init-complete":
|
||||
this._shieldInitComplete = true;
|
||||
this._sendMainPingCentrePing();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -1964,11 +1897,6 @@ BrowserGlue.prototype = {
|
|||
|
||||
BrowserUsageTelemetry.uninit();
|
||||
SearchTelemetry.uninit();
|
||||
// Only uninit PingCentre if the getter has initialized it
|
||||
if (Object.prototype.hasOwnProperty.call(this, "pingCentre")) {
|
||||
this.pingCentre.uninit();
|
||||
}
|
||||
|
||||
PageThumbs.uninit();
|
||||
NewTabUtils.uninit();
|
||||
AboutPrivateBrowsingHandler.uninit();
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
const { PingCentre } = ChromeUtils.import("resource:///modules/PingCentre.jsm");
|
||||
|
||||
const TOPIC_SHIELD_INIT_COMPLETE = "shield-init-complete";
|
||||
const SEND_PING_MOCK = sinon.stub(PingCentre.prototype, "sendPing");
|
||||
|
||||
let gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"].getService(
|
||||
Ci.nsIObserver
|
||||
);
|
||||
|
||||
add_task(async function() {
|
||||
// Simulate ping centre sendPing() trigger.
|
||||
gBrowserGlue.observe(null, TOPIC_SHIELD_INIT_COMPLETE, null);
|
||||
|
||||
const SEND_PING_CALL_ARGS = {
|
||||
event: "AS_ENABLED",
|
||||
value: 0,
|
||||
};
|
||||
const SEND_PING_FILTER = { filter: "activity-stream" };
|
||||
|
||||
Assert.ok(
|
||||
SEND_PING_MOCK.called,
|
||||
"gBrowserGlue.pingCentre.sendPing() is called"
|
||||
);
|
||||
Assert.ok(
|
||||
SEND_PING_MOCK.calledWithExactly(SEND_PING_CALL_ARGS, SEND_PING_FILTER),
|
||||
"sendPing() is called with the correct param"
|
||||
);
|
||||
});
|
|
@ -9,4 +9,3 @@ support-files =
|
|||
[test_distribution.js]
|
||||
[test_distribution_cachedexistence.js]
|
||||
[test_browserGlue_migration_social_cleanup.js]
|
||||
[test_browserGlue_pingcentre.js]
|
||||
|
|
|
@ -16,8 +16,6 @@ user_pref("browser.contentHandlers.types.5.uri", "http://127.0.0.1/rss?url=%s");
|
|||
user_pref("browser.link.open_newwindow", 2);
|
||||
user_pref("browser.newtabpage.activity-stream.default.sites", "");
|
||||
user_pref("browser.newtabpage.activity-stream.telemetry", false);
|
||||
user_pref("browser.ping-centre.production.endpoint", "https://127.0.0.1/pingcentre/dummy/");
|
||||
user_pref("browser.ping-centre.staging.endpoint", "https://127.0.0.1/pingcentre/dummy/");
|
||||
user_pref("browser.reader.detectedFirstArticle", true);
|
||||
user_pref("browser.safebrowsing.blockedURIs.enabled", false);
|
||||
user_pref("browser.safebrowsing.downloads.enabled", false);
|
||||
|
|
|
@ -4,9 +4,6 @@
|
|||
user_pref("app.normandy.api_url", "https://localhost/selfsupport-dummy/");
|
||||
user_pref("app.update.staging.enabled", false);
|
||||
user_pref("app.update.url.android", "");
|
||||
user_pref("browser.ping-centre.production.endpoint", "https://localhost");
|
||||
// Make sure Ping Centre doesn't hit the network.
|
||||
user_pref("browser.ping-centre.staging.endpoint", "https://localhost");
|
||||
user_pref("browser.safebrowsing.blockedURIs.enabled", false);
|
||||
user_pref("browser.safebrowsing.downloads.enabled", false);
|
||||
user_pref("browser.safebrowsing.downloads.remote.url", "http://127.0.0.1/safebrowsing-dummy/gethash");
|
||||
|
|
|
@ -33,9 +33,6 @@ user_pref("browser.contentHandlers.types.5.uri", "http://test1.example.org/rss?u
|
|||
user_pref("browser.download.panel.shown", true);
|
||||
user_pref("browser.newtabpage.activity-stream.default.sites", "");
|
||||
user_pref("browser.newtabpage.activity-stream.telemetry", false);
|
||||
// Make sure PingCentre doesn't hit the network.
|
||||
user_pref("browser.ping-centre.production.endpoint", "");
|
||||
user_pref("browser.ping-centre.staging.endpoint", "");
|
||||
// Point the url-classifier to the local testing server for fast failures
|
||||
user_pref("browser.safebrowsing.downloads.remote.url", "http://{server}/safebrowsing-dummy/update");
|
||||
user_pref("browser.safebrowsing.provider.google.gethashURL", "http://{server}/safebrowsing-dummy/gethash");
|
||||
|
|
Загрузка…
Ссылка в новой задаче