mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
merge fx-team to mozilla-central a=merge
This commit is contained in:
commit
002646b7c6
@ -522,6 +522,7 @@ menuitem:not([type]):not(.menuitem-tooltip):not(.menuitem-iconic-tooltip) {
|
||||
list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png");
|
||||
}
|
||||
|
||||
#menu_unsortedBookmarks,
|
||||
#BMB_unsortedBookmarks,
|
||||
#panelMenu_unsortedBookmarks {
|
||||
list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png");
|
||||
|
@ -560,6 +560,7 @@ toolbarpaletteitem[place="palette"] > #personal-bookmarks > #bookmarks-toolbar-p
|
||||
list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png");
|
||||
}
|
||||
|
||||
#menu_unsortedBookmarks,
|
||||
#BMB_unsortedBookmarks,
|
||||
#panelMenu_unsortedBookmarks {
|
||||
list-style-image: url("chrome://browser/skin/places/unfiledBookmarks.png");
|
||||
|
@ -2354,6 +2354,7 @@ notification[value="translation"] {
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
#menu_unsortedBookmarks,
|
||||
#BMB_unsortedBookmarks,
|
||||
#panelMenu_unsortedBookmarks {
|
||||
list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png");
|
||||
|
@ -29,13 +29,13 @@ let initDevices = Task.async(function* (dispatch) {
|
||||
}
|
||||
|
||||
let newDevice = Object.assign({}, device, {
|
||||
displayed: deviceList.includes(device.name) ?
|
||||
displayed: deviceList.has(device.name) ?
|
||||
true :
|
||||
!!device.featured,
|
||||
});
|
||||
|
||||
if (newDevice.displayed) {
|
||||
deviceList.push(newDevice.name);
|
||||
deviceList.add(newDevice.name);
|
||||
}
|
||||
|
||||
dispatch(addDevice(newDevice, type));
|
||||
@ -46,18 +46,18 @@ let initDevices = Task.async(function* (dispatch) {
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns an array containing the user preference of displayed devices.
|
||||
* Returns a set containing the user preference of displayed devices.
|
||||
*
|
||||
* @return {Array} containing the device names that are to be displayed in the
|
||||
* @return {Set} containing the device names that are to be displayed in the
|
||||
* device catalog.
|
||||
*/
|
||||
function loadDeviceList() {
|
||||
let deviceList = [];
|
||||
let deviceList = new Set();
|
||||
|
||||
if (Services.prefs.prefHasUserValue(DISPLAYED_DEVICES_PREF)) {
|
||||
try {
|
||||
deviceList = JSON.parse(Services.prefs.getCharPref(
|
||||
DISPLAYED_DEVICES_PREF));
|
||||
let savedList = Services.prefs.getCharPref(DISPLAYED_DEVICES_PREF);
|
||||
deviceList = new Set(JSON.parse(savedList));
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@ -69,11 +69,12 @@ function loadDeviceList() {
|
||||
/**
|
||||
* Update the displayed device list preference with the given device list.
|
||||
*
|
||||
* @param {Array} devices
|
||||
* Array of device names that are displayed in the device catalog.
|
||||
* @param {Set} devices
|
||||
* Set of device names that are displayed in the device catalog.
|
||||
*/
|
||||
function updateDeviceList(devices) {
|
||||
Services.prefs.setCharPref(DISPLAYED_DEVICES_PREF, JSON.stringify(devices));
|
||||
let listToSave = JSON.stringify(Array.from(devices));
|
||||
Services.prefs.setCharPref(DISPLAYED_DEVICES_PREF, listToSave);
|
||||
}
|
||||
|
||||
exports.initDevices = initDevices;
|
||||
|
@ -31,8 +31,8 @@ addRDMTask(TEST_URL, function* ({ ui }) {
|
||||
|
||||
info("Check that the device list remains unchanged after exitting.");
|
||||
let deviceListAfter = loadDeviceList();
|
||||
is(deviceListBefore.length, deviceListAfter.length,
|
||||
is(deviceListBefore.size, deviceListAfter.size,
|
||||
"Got expected number of displayed devices.");
|
||||
ok(!deviceListAfter.includes(value),
|
||||
ok(!deviceListAfter.has(value),
|
||||
value + " was not added to displayed device list.");
|
||||
});
|
||||
|
@ -23,11 +23,11 @@ addRDMTask(TEST_URL, function* ({ ui }) {
|
||||
.filter(cb => cb.checked);
|
||||
let deviceList = loadDeviceList();
|
||||
|
||||
is(deviceList.length, checkedCbs.length,
|
||||
is(deviceList.size, checkedCbs.length,
|
||||
"Got expected number of displayed devices.");
|
||||
|
||||
for (let cb of checkedCbs) {
|
||||
ok(deviceList.includes(cb.value), cb.value + " is correctly checked.");
|
||||
ok(deviceList.has(cb.value), cb.value + " is correctly checked.");
|
||||
}
|
||||
|
||||
info("Check the first unchecked device and submit new device list.");
|
||||
@ -42,11 +42,11 @@ addRDMTask(TEST_URL, function* ({ ui }) {
|
||||
|
||||
info("Checking new device is added to the displayed device list.");
|
||||
deviceList = loadDeviceList();
|
||||
ok(deviceList.includes(value), value + " added to displayed device list.");
|
||||
ok(deviceList.has(value), value + " added to displayed device list.");
|
||||
|
||||
info("Checking new device is added to the device selector.");
|
||||
let options = [...select.options];
|
||||
is(options.length - 2, deviceList.length,
|
||||
is(options.length - 2, deviceList.size,
|
||||
"Got expected number of devices in device selector.");
|
||||
ok(options.filter(o => o.value === value)[0],
|
||||
value + " added to the device selector.");
|
||||
|
@ -3253,8 +3253,8 @@ Widgets.ObjectRenderers.add({
|
||||
let target = this.message.output.toolboxTarget;
|
||||
this.toolbox = gDevTools.getToolbox(target);
|
||||
if (!this.toolbox) {
|
||||
throw new Error("The object cannot be linked to the inspector without a " +
|
||||
"toolbox");
|
||||
// In cases like the browser console, there is no toolbox.
|
||||
return;
|
||||
}
|
||||
|
||||
// Checking that the inspector supports the node
|
||||
|
@ -57,7 +57,8 @@ function test() {
|
||||
|
||||
let msg = [...result.matched][0];
|
||||
ok(msg, "message element found");
|
||||
let locationNode = msg.querySelector(".message > .message-location > .frame-link");
|
||||
let locationNode = msg
|
||||
.querySelector(".message > .message-location > .frame-link");
|
||||
ok(locationNode, "message location element found");
|
||||
|
||||
let url = locationNode.getAttribute("data-url");
|
||||
@ -67,9 +68,9 @@ function test() {
|
||||
let viewSource = browserconsole.viewSource;
|
||||
let URL = null;
|
||||
let clickPromise = promise.defer();
|
||||
browserconsole.viewSourceInDebugger = (aURL) => {
|
||||
info("browserconsole.viewSourceInDebugger() was invoked: " + aURL);
|
||||
URL = aURL;
|
||||
browserconsole.viewSourceInDebugger = (sourceURL) => {
|
||||
info("browserconsole.viewSourceInDebugger() was invoked: " + sourceURL);
|
||||
URL = sourceURL;
|
||||
clickPromise.resolve(null);
|
||||
};
|
||||
|
||||
@ -82,7 +83,8 @@ function test() {
|
||||
|
||||
info("view-source url: " + URL);
|
||||
ok(URL, "we have some source URL after the click");
|
||||
isnot(URL.indexOf("toolbox.js"), -1, "we have the expected view source URL");
|
||||
isnot(URL.indexOf("toolbox.js"), -1,
|
||||
"we have the expected view source URL");
|
||||
is(URL.indexOf("->"), -1, "no -> in the URL given to view-source");
|
||||
|
||||
browserconsole.viewSourceInDebugger = viewSource;
|
||||
|
@ -35,14 +35,6 @@ function performTest(request, console) {
|
||||
ok(!contentType, "we do not have the Content-Type header");
|
||||
isnot(contentLength, 60, "Content-Length != 60");
|
||||
|
||||
if (contentType || contentLength == 60) {
|
||||
console.debug("lastFinishedRequest", lastFinishedRequest,
|
||||
"request", lastFinishedRequest.request,
|
||||
"response", lastFinishedRequest.response,
|
||||
"updates", lastFinishedRequest.updates,
|
||||
"response headers", headers);
|
||||
}
|
||||
|
||||
executeSoon(deferred.resolve);
|
||||
});
|
||||
|
||||
@ -72,11 +64,11 @@ add_task(function* () {
|
||||
let gotLastRequest = waitForRequest();
|
||||
|
||||
let loaded = loadBrowser(browser);
|
||||
content.location = TEST_URI;
|
||||
BrowserTestUtils.loadURI(browser, TEST_URI);
|
||||
yield loaded;
|
||||
|
||||
let reloaded = loadBrowser(browser);
|
||||
content.location.reload();
|
||||
ContentTask.spawn(browser, null, "() => content.location.reload()");
|
||||
yield reloaded;
|
||||
|
||||
yield gotLastRequest;
|
||||
|
@ -319,7 +319,7 @@ public class BrowserApp extends GeckoApp
|
||||
@NonNull
|
||||
private SearchEngineManager mSearchEngineManager; // Contains reference to Context - DO NOT LEAK!
|
||||
|
||||
private TelemetryDispatcher mTelemetryDispatcher;
|
||||
private TelemetryDispatcher mTelemetryDispatcher; // lazy.
|
||||
private final SessionMeasurements mSessionMeasurements = new SessionMeasurements();
|
||||
|
||||
private boolean mHasResumed;
|
||||
@ -703,7 +703,6 @@ public class BrowserApp extends GeckoApp
|
||||
distribution.addOnDistributionReadyCallback(new DistributionStoreCallback(this, profile.getName()));
|
||||
|
||||
mSearchEngineManager = new SearchEngineManager(this, distribution);
|
||||
mTelemetryDispatcher = new TelemetryDispatcher(profile.getDir().getAbsolutePath());
|
||||
|
||||
// Init suggested sites engine in BrowserDB.
|
||||
final SuggestedSites suggestedSites = new SuggestedSites(appContext, distribution);
|
||||
@ -2440,7 +2439,7 @@ public class BrowserApp extends GeckoApp
|
||||
// We could include the engine identifier as an extra but we'll
|
||||
// just capture that with core ping telemetry (bug 1253319).
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.SEARCH, where);
|
||||
SearchCountMeasurements.incrementSearch(prefs, engineIdentifier, where.name());
|
||||
SearchCountMeasurements.incrementSearch(prefs, engineIdentifier, where.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3920,7 +3919,11 @@ public class BrowserApp extends GeckoApp
|
||||
@Override
|
||||
public int getLayout() { return R.layout.gecko_app; }
|
||||
|
||||
@WorkerThread // via constructor
|
||||
public TelemetryDispatcher getTelemetryDispatcher() {
|
||||
if (mTelemetryDispatcher == null) {
|
||||
mTelemetryDispatcher = new TelemetryDispatcher(getProfile().getDir().getAbsolutePath());
|
||||
}
|
||||
return mTelemetryDispatcher;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
package org.mozilla.gecko.telemetry;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.WorkerThread;
|
||||
import android.util.Log;
|
||||
import org.mozilla.gecko.telemetry.pingbuilders.TelemetryCorePingBuilder;
|
||||
import org.mozilla.gecko.telemetry.schedulers.TelemetryUploadScheduler;
|
||||
@ -56,6 +57,7 @@ public class TelemetryDispatcher {
|
||||
|
||||
private final TelemetryUploadAllPingsImmediatelyScheduler uploadAllPingsImmediatelyScheduler;
|
||||
|
||||
@WorkerThread // via TelemetryJSONFilePingStore
|
||||
public TelemetryDispatcher(final String profilePath) {
|
||||
final String storePath = profilePath + File.separator + STORE_CONTAINER_DIR_NAME;
|
||||
|
||||
|
@ -9,6 +9,7 @@ package org.mozilla.gecko.telemetry.stores;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.support.annotation.WorkerThread;
|
||||
import android.util.Log;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@ -74,6 +75,7 @@ public class TelemetryJSONFilePingStore implements TelemetryPingStore {
|
||||
private final FilenameFilter uuidFilenameFilter;
|
||||
private final FileLastModifiedComparator fileLastModifiedComparator = new FileLastModifiedComparator();
|
||||
|
||||
@WorkerThread // Writes to disk
|
||||
public TelemetryJSONFilePingStore(final File storeDir) {
|
||||
this.storeDir = storeDir;
|
||||
this.storeDir.mkdirs();
|
||||
|
@ -176,8 +176,8 @@ const EXPIRATION_QUERIES = {
|
||||
// Note: due to the REPLACE option, this should be executed before
|
||||
// QUERY_FIND_VISITS_TO_EXPIRE, that has a more complete result.
|
||||
QUERY_FIND_EXOTIC_VISITS_TO_EXPIRE: {
|
||||
sql: `INSERT INTO expiration_notify (v_id, url, guid, visit_date)
|
||||
SELECT v.id, h.url, h.guid, v.visit_date
|
||||
sql: `INSERT INTO expiration_notify (v_id, url, guid, visit_date, reason)
|
||||
SELECT v.id, h.url, h.guid, v.visit_date, "exotic"
|
||||
FROM moz_historyvisits v
|
||||
JOIN moz_places h ON h.id = v.place_id
|
||||
WHERE visit_date < strftime('%s','now','localtime','start of day','-60 days','utc') * 1000000
|
||||
@ -391,7 +391,8 @@ const EXPIRATION_QUERIES = {
|
||||
MAX(IFNULL(MIN(p_id, 1), MIN(v_id, 0))) AS whole_entry,
|
||||
MAX(expected_results) AS expected_results,
|
||||
(SELECT MAX(visit_date) FROM expiration_notify
|
||||
WHERE url = n.url AND p_id ISNULL) AS most_recent_expired_visit
|
||||
WHERE reason = "expired" AND url = n.url AND p_id ISNULL
|
||||
) AS most_recent_expired_visit
|
||||
FROM expiration_notify n
|
||||
GROUP BY url`,
|
||||
actions: ACTION.TIMED | ACTION.TIMED_OVERLIMIT | ACTION.SHUTDOWN_DIRTY |
|
||||
@ -473,6 +474,7 @@ function nsPlacesExpiration()
|
||||
, guid TEXT NOT NULL
|
||||
, visit_date INTEGER
|
||||
, expected_results INTEGER NOT NULL DEFAULT 0
|
||||
, reason TEXT NOT NULL DEFAULT "expired"
|
||||
)`);
|
||||
stmt.executeAsync();
|
||||
stmt.finalize();
|
||||
@ -688,13 +690,12 @@ nsPlacesExpiration.prototype = {
|
||||
let observers = PlacesUtils.history.getObservers();
|
||||
|
||||
if (mostRecentExpiredVisit) {
|
||||
try {
|
||||
let days = parseInt((Date.now() - (mostRecentExpiredVisit / 1000)) / MSECS_PER_DAY);
|
||||
Services.telemetry
|
||||
.getHistogramById("PLACES_MOST_RECENT_EXPIRED_VISIT_DAYS")
|
||||
.add(days);
|
||||
} catch (ex) {
|
||||
Components.utils.reportError("Unable to report telemetry.");
|
||||
let days = parseInt((Date.now() - (mostRecentExpiredVisit / 1000)) / MSECS_PER_DAY);
|
||||
if (!this._mostRecentExpiredVisitDays) {
|
||||
this._mostRecentExpiredVisitDays = days;
|
||||
}
|
||||
else if (days < this._mostRecentExpiredVisitDays) {
|
||||
this._mostRecentExpiredVisitDays = days;
|
||||
}
|
||||
}
|
||||
|
||||
@ -718,6 +719,19 @@ nsPlacesExpiration.prototype = {
|
||||
handleCompletion: function PEX_handleCompletion(aReason)
|
||||
{
|
||||
if (aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED) {
|
||||
|
||||
if (this._mostRecentExpiredVisitDays) {
|
||||
try {
|
||||
Services.telemetry
|
||||
.getHistogramById("PLACES_MOST_RECENT_EXPIRED_VISIT_DAYS")
|
||||
.add(this._mostRecentExpiredVisitDays);
|
||||
} catch (ex) {
|
||||
Components.utils.reportError("Unable to report telemetry.");
|
||||
} finally {
|
||||
delete this._mostRecentExpiredVisitDays;
|
||||
}
|
||||
}
|
||||
|
||||
if ("_expectedResultsCount" in this) {
|
||||
// Adapt the aggressivity of steps based on the status of history.
|
||||
// A dirty history will return all the entries we are expecting bringing
|
||||
|
@ -47,7 +47,7 @@ Structure::
|
||||
// device when the ping was created
|
||||
"searches": <object>, // Optional, object of search use counts in the
|
||||
// format: { "engine.source": <pos integer> }
|
||||
// e.g.: { "yahoo.searchbar": 3, "other.searchbar": 1 }
|
||||
// e.g.: { "yahoo.suggestion": 3, "other.listitem": 1 }
|
||||
"experiments": [<string>, …], // Optional, array of identifiers
|
||||
// for the active experiments
|
||||
}
|
||||
@ -113,6 +113,20 @@ The reason we don't just return the package install time even if the date could
|
||||
not be persisted to disk is to ensure the value doesn't change once we start
|
||||
sending it: we only want to send consistent values.
|
||||
|
||||
searches
|
||||
~~~~~~~~
|
||||
In the case a search engine is added by a user, the engine identifier "other" is used, e.g. "other.<source>".
|
||||
|
||||
Sources in Android are based on the existing UI telemetry values and are as
|
||||
follows:
|
||||
|
||||
* actionbar: the user types in the url bar and hits enter to use the default
|
||||
search engine
|
||||
* listitem: the user selects a search engine from the list of secondary search
|
||||
engines at the bottom of the screen
|
||||
* suggestion: the user clicks on a search suggestion or, in the case that
|
||||
suggestions are disabled, the row corresponding with the main engine
|
||||
|
||||
Other parameters
|
||||
----------------
|
||||
|
||||
|
@ -1428,8 +1428,9 @@
|
||||
return;
|
||||
|
||||
var tree = this.parentNode.parentNode;
|
||||
var column = tree.columns.getColumnFor(this);
|
||||
tree.view.cycleHeader(column);
|
||||
if (tree.columns) {
|
||||
tree.view.cycleHeader(tree.columns.getColumnFor(this));
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
|
Loading…
Reference in New Issue
Block a user