This commit is contained in:
Ryan VanderMeulen 2014-08-08 21:46:08 -04:00
Родитель eb744ade14 4558cd489f
Коммит b46d789d71
17 изменённых файлов: 98 добавлений и 499 удалений

Просмотреть файл

@ -15,6 +15,14 @@
<div id="main"></div>
<script src="fake-mozLoop.js"></script>
<script src="fake-l10n.js"></script>
<script>
window.OTProperties = {
cdnURL: '../content/shared/libs/'
};
window.OTProperties.assetURL = window.OTProperties.cdnURL + 'sdk-content/';
window.OTProperties.configURL = window.OTProperties.assetURL + 'js/dynamic_config.min.js';
window.OTProperties.cssURL = window.OTProperties.assetURL + 'css/ot.css';
</script>
<script src="../content/shared/libs/sdk.js"></script>
<script src="../content/shared/libs/react-0.11.1.js"></script>
<script src="../content/shared/libs/jquery-2.1.0.js"></script>

Просмотреть файл

@ -36,7 +36,7 @@
* about:telemetry.
*
* You can view telemetry stats for large groups of Firefox users at
* telemetry.mozilla.org.
* metrics.mozilla.com.
*/
const TOOLS_OPENED_PREF = "devtools.telemetry.tools.opened.version";
@ -170,11 +170,6 @@ Telemetry.prototype = {
userHistogram: "DEVTOOLS_DEVELOPERTOOLBAR_OPENED_PER_USER_FLAG",
timerHistogram: "DEVTOOLS_DEVELOPERTOOLBAR_TIME_ACTIVE_SECONDS"
},
webide: {
histogram: "DEVTOOLS_WEBIDE_OPENED_BOOLEAN",
userHistogram: "DEVTOOLS_WEBIDE_OPENED_PER_USER_FLAG",
timerHistogram: "DEVTOOLS_WEBIDE_TIME_ACTIVE_SECONDS"
},
custom: {
histogram: "DEVTOOLS_CUSTOM_OPENED_BOOLEAN",
userHistogram: "DEVTOOLS_CUSTOM_OPENED_PER_USER_FLAG",
@ -199,7 +194,7 @@ Telemetry.prototype = {
this.logOncePerBrowserVersion(charts.userHistogram, true);
}
if (charts.timerHistogram) {
this.startTimer(charts.timerHistogram);
this._timers.set(charts.timerHistogram, new Date());
}
},
@ -210,31 +205,12 @@ Telemetry.prototype = {
return;
}
this.stopTimer(charts.timerHistogram);
},
let startTime = this._timers.get(charts.timerHistogram);
/**
* Record the start time for a timing-based histogram entry.
*
* @param String histogramId
* Histogram in which the data is to be stored.
*/
startTimer: function(histogramId) {
this._timers.set(histogramId, new Date());
},
/**
* Stop the timer and log elasped time for a timing-based histogram entry.
*
* @param String histogramId
* Histogram in which the data is to be stored.
*/
stopTimer: function(histogramId) {
let startTime = this._timers.get(histogramId);
if (startTime) {
let time = (new Date() - startTime) / 1000;
this.log(histogramId, time);
this._timers.delete(histogramId);
this.log(charts.timerHistogram, time);
this._timers.delete(charts.timerHistogram);
}
},
@ -282,8 +258,11 @@ Telemetry.prototype = {
},
destroy: function() {
for (let histogramId of this._timers.keys()) {
this.stopTimer(histogramId);
for (let [histogram, time] of this._timers) {
time = (new Date() - time) / 1000;
this.log(histogram, time);
this._timers.delete(histogram);
}
}
};

Просмотреть файл

@ -89,7 +89,7 @@ function CheckLockState() {
// ADB check
if (AppManager.selectedRuntime instanceof USBRuntime) {
let device = Devices.getByName(AppManager.selectedRuntime.id);
if (device && device.summonRoot) {
if (device.summonRoot) {
device.isRoot().then(isRoot => {
if (isRoot) {
adbCheckResult.textContent = sYes;

Просмотреть файл

@ -21,7 +21,6 @@ const ProjectEditor = require("projecteditor/projecteditor");
const {Devices} = Cu.import("resource://gre/modules/devtools/Devices.jsm");
const {GetAvailableAddons} = require("devtools/webide/addons");
const {GetTemplatesJSON, GetAddonsJSON} = require("devtools/webide/remote-resources");
const Telemetry = require("devtools/shared/telemetry");
const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/webide.properties");
@ -48,9 +47,6 @@ window.addEventListener("unload", function onUnload() {
let UI = {
init: function() {
this._telemetry = new Telemetry();
this._telemetry.toolOpened("webide");
AppManager.init();
this.onMessage = this.onMessage.bind(this);
@ -102,8 +98,6 @@ let UI = {
AppManager.off("app-manager-update", this.appManagerUpdate);
AppManager.uninit();
window.removeEventListener("message", this.onMessage);
this.updateConnectionTelemetry();
this._telemetry.toolClosed("webide");
},
onfocus: function() {
@ -127,7 +121,6 @@ let UI = {
case "connection":
this.updateRuntimeButton();
this.updateCommands();
this.updateConnectionTelemetry();
break;
case "project":
this.updateTitle();
@ -225,13 +218,12 @@ let UI = {
},
busyWithProgressUntil: function(promise, operationDescription) {
let busy = this.busyUntil(promise, operationDescription);
this.busyUntil(promise, operationDescription);
let win = document.querySelector("window");
let progress = document.querySelector("#action-busy-determined");
progress.mode = "undetermined";
win.classList.add("busy-determined");
win.classList.remove("busy-undetermined");
return busy;
},
busyUntil: function(promise, operationDescription) {
@ -341,7 +333,6 @@ let UI = {
connectToRuntime: function(runtime) {
let name = runtime.getName();
let promise = AppManager.connectToRuntime(runtime);
promise.then(() => this.initConnectionTelemetry());
return this.busyUntil(promise, "connecting to runtime");
},
@ -355,47 +346,6 @@ let UI = {
}
},
_actionsToLog: new Set(),
/**
* For each new connection, track whether play and debug were ever used. Only
* one value is collected for each button, even if they are used multiple
* times during a connection.
*/
initConnectionTelemetry: function() {
this._actionsToLog.add("play");
this._actionsToLog.add("debug");
},
/**
* Action occurred. Log that it happened, and remove it from the loggable
* set.
*/
onAction: function(action) {
if (!this._actionsToLog.has(action)) {
return;
}
this.logActionState(action, true);
this._actionsToLog.delete(action);
},
/**
* Connection status changed or we are shutting down. Record any loggable
* actions as having not occurred.
*/
updateConnectionTelemetry: function() {
for (let action of this._actionsToLog.values()) {
this.logActionState(action, false);
}
this._actionsToLog.clear();
},
logActionState: function(action, state) {
let histogramId = "DEVTOOLS_WEBIDE_CONNECTION_" +
action.toUpperCase() + "_USED";
this._telemetry.log(histogramId, state);
},
/********** PROJECTS **********/
// Panel & button
@ -710,7 +660,8 @@ let UI = {
splitter.setAttribute("hidden", "true");
document.querySelector("#action-button-debug").removeAttribute("active");
},
};
}
let Cmds = {
quit: function() {
@ -958,25 +909,15 @@ let Cmds = {
},
play: function() {
let busy;
switch(AppManager.selectedProject.type) {
case "packaged":
busy = UI.busyWithProgressUntil(AppManager.installAndRunProject(),
"installing and running app");
break;
return UI.busyWithProgressUntil(AppManager.installAndRunProject(), "installing and running app");
case "hosted":
busy = UI.busyUntil(AppManager.installAndRunProject(),
"installing and running app");
break;
return UI.busyUntil(AppManager.installAndRunProject(), "installing and running app");
case "runtimeApp":
busy = UI.busyUntil(AppManager.runRuntimeApp(), "running app");
break;
return UI.busyUntil(AppManager.runRuntimeApp(), "running app");
}
if (!busy) {
return promise.reject();
}
UI.onAction("play");
return busy;
return promise.reject();
},
stop: function() {
@ -984,7 +925,6 @@ let Cmds = {
},
toggleToolbox: function() {
UI.onAction("debug");
if (UI.toolboxIframe) {
UI.closeToolbox();
return promise.resolve();
@ -1021,4 +961,4 @@ let Cmds = {
showPrefs: function() {
UI.selectDeckPanel("prefs");
},
};
}

Просмотреть файл

@ -25,7 +25,6 @@ const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
const {USBRuntime, WiFiRuntime, SimulatorRuntime,
gLocalRuntime, gRemoteRuntime} = require("devtools/webide/runtimes");
const discovery = require("devtools/toolkit/discovery/discovery");
const Telemetry = require("devtools/shared/telemetry");
const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/webide.properties");
@ -67,8 +66,6 @@ exports.AppManager = AppManager = {
this.observe = this.observe.bind(this);
Services.prefs.addObserver(WIFI_SCANNING_PREF, this, false);
this._telemetry = new Telemetry();
},
uninit: function() {
@ -348,25 +345,6 @@ exports.AppManager = AppManager = {
}
}, deferred.reject);
// Record connection result in telemetry
let logResult = result => {
this._telemetry.log("DEVTOOLS_WEBIDE_CONNECTION_RESULT", result);
if (runtime.type) {
this._telemetry.log("DEVTOOLS_WEBIDE_" + runtime.type +
"_CONNECTION_RESULT", result);
}
};
deferred.promise.then(() => logResult(true), () => logResult(false));
// If successful, record connection time in telemetry
deferred.promise.then(() => {
const timerId = "DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS";
this._telemetry.startTimer(timerId);
this.connection.once(Connection.Events.STATUS_CHANGED, () => {
this._telemetry.stopTimer(timerId);
});
});
return deferred.promise;
},

Просмотреть файл

@ -13,21 +13,11 @@ const promise = require("promise");
const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/webide.properties");
// These type strings are used for logging events to Telemetry
let RuntimeTypes = {
usb: "USB",
wifi: "WIFI",
simulator: "SIMULATOR",
remote: "REMOTE",
local: "LOCAL"
};
function USBRuntime(id) {
this.id = id;
}
USBRuntime.prototype = {
type: RuntimeTypes.usb,
connect: function(connection) {
let device = Devices.getByName(this.id);
if (!device) {
@ -69,7 +59,6 @@ function WiFiRuntime(deviceName) {
}
WiFiRuntime.prototype = {
type: RuntimeTypes.wifi,
connect: function(connection) {
let service = discovery.getRemoteService("devtools", this.deviceName);
if (!service) {
@ -93,7 +82,6 @@ function SimulatorRuntime(version) {
}
SimulatorRuntime.prototype = {
type: RuntimeTypes.simulator,
connect: function(connection) {
let port = ConnectionManager.getFreeTCPPort();
let simulator = Simulator.getByVersion(this.version);
@ -116,7 +104,6 @@ SimulatorRuntime.prototype = {
}
let gLocalRuntime = {
type: RuntimeTypes.local,
connect: function(connection) {
if (!DebuggerServer.initialized) {
DebuggerServer.init();
@ -133,7 +120,6 @@ let gLocalRuntime = {
}
let gRemoteRuntime = {
type: RuntimeTypes.remote,
connect: function(connection) {
let win = Services.wm.getMostRecentWindow("devtools:webide");
if (!win) {

Просмотреть файл

@ -31,4 +31,3 @@ support-files =
[test_manifestUpdate.html]
[test_addons.html]
[test_deviceinfo.html]
[test_telemetry.html]

Просмотреть файл

@ -81,9 +81,8 @@ function removeAllProjects() {
return Task.spawn(function* () {
yield AppProjects.load();
let projects = AppProjects.store.object.projects;
// AppProjects.remove mutates the projects array in-place
while (projects.length > 0) {
yield AppProjects.remove(projects[0].location);
for (let i = 0; i < projects.length; i++) {
yield AppProjects.remove(projects[i].location);
}
});
}
@ -97,14 +96,6 @@ function nextTick() {
return deferred.promise;
}
function waitForTime(time) {
let deferred = promise.defer();
setTimeout(() => {
deferred.resolve();
}, time);
return deferred.promise;
}
function documentIsLoaded(doc) {
let deferred = promise.defer();
if (doc.readyState == "complete") {

Просмотреть файл

@ -1,242 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<title></title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
<script type="application/javascript;version=1.8" src="head.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<script type="application/javascript;version=1.8">
const Telemetry = require("devtools/shared/telemetry");
const { USBRuntime, WiFiRuntime, SimulatorRuntime, gRemoteRuntime,
gLocalRuntime } = require("devtools/webide/runtimes");
// Because we need to gather stats for the period of time that a tool has
// been opened we make use of setTimeout() to create tool active times.
const TOOL_DELAY = 200;
function patchTelemetry() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
Telemetry.prototype.log = function(histogramId, value) {
if (histogramId) {
if (!this.telemetryInfo[histogramId]) {
this.telemetryInfo[histogramId] = [];
}
this.telemetryInfo[histogramId].push(value);
}
}
}
function resetTelemetry() {
Telemetry.prototype.log = Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
}
function cycleWebIDE() {
return Task.spawn(function*() {
let win = yield openWebIDE();
// Wait a bit, so we're open for a non-zero time
yield waitForTime(TOOL_DELAY);
yield closeWebIDE(win);
});
}
function addFakeRuntimes(win) {
// We use the real runtimes here (and switch out some functionality)
// so we can ensure that logging happens as it would in real use.
let usb = new USBRuntime("fakeUSB");
// Use local pipe instead
usb.connect = function(connection) {
ok(connection, win.AppManager.connection, "connection is valid");
connection.host = null; // force connectPipe
connection.connect();
return promise.resolve();
};
win.AppManager.runtimeList.usb.push(usb);
let wifi = new WiFiRuntime("fakeWiFi");
// Use local pipe instead
wifi.connect = function(connection) {
ok(connection, win.AppManager.connection, "connection is valid");
connection.host = null; // force connectPipe
connection.connect();
return promise.resolve();
};
win.AppManager.runtimeList.wifi.push(wifi);
let sim = new SimulatorRuntime("fakeSimulator");
// Use local pipe instead
sim.connect = function(connection) {
ok(connection, win.AppManager.connection, "connection is valid");
connection.host = null; // force connectPipe
connection.connect();
return promise.resolve();
};
sim.getName = function() {
return this.version;
};
win.AppManager.runtimeList.simulator.push(sim);
let remote = gRemoteRuntime;
// Use local pipe instead
remote.connect = function(connection) {
ok(connection, win.AppManager.connection, "connection is valid");
connection.host = null; // force connectPipe
connection.connect();
return promise.resolve();
};
let local = gLocalRuntime;
win.AppManager.runtimeList.custom = [gRemoteRuntime, gLocalRuntime];
win.AppManager.update("runtimelist");
}
function addTestApp(win) {
return Task.spawn(function*() {
let packagedAppLocation = getTestFilePath("app");
yield win.Cmds.importPackagedApp(packagedAppLocation);
});
}
function startConnection(win, type, index) {
let panelNode = win.document.querySelector("#runtime-panel");
let items = panelNode.querySelectorAll(".runtime-panel-item-" + type);
if (index === undefined) {
is(items.length, 1, "Found one runtime button");
}
let deferred = promise.defer();
win.AppManager.connection.once(
win.Connection.Events.CONNECTED,
() => deferred.resolve());
items[index || 0].click();
return deferred.promise;
}
function waitUntilConnected(win) {
return Task.spawn(function*() {
ok(win.document.querySelector("window").className, "busy", "UI is busy");
yield win.UI._busyPromise;
is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
});
}
function connectToRuntime(win, type, index) {
return Task.spawn(function*() {
yield startConnection(win, type, index);
yield waitUntilConnected(win);
});
}
function checkResults() {
let result = Telemetry.prototype.telemetryInfo;
for (let [histId, value] of Iterator(result)) {
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
ok(value.length === 1 && !!value[0],
"Per user value " + histId + " has a single value of true");
} else if (histId.endsWith("OPENED_BOOLEAN")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return !!element;
});
ok(okay, "All " + histId + " entries are true");
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " entries have time > 0");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTION_RESULT") {
ok(value.length === 5, histId + " has 5 connection results");
let okay = value.every(function(element) {
return !!element;
});
ok(okay, "All " + histId + " connections succeeded");
} else if (histId.endsWith("CONNECTION_RESULT")) {
ok(value.length === 1 && !!value[0],
histId + " has 1 successful connection");
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS") {
ok(value.length === 5, histId + " has 5 connection results");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " connections have time > 0");
} else if (histId.endsWith("USED")) {
info(value.length);
ok(value.length === 5, histId + " has 5 connection actions");
let okay = value.every(function(element) {
return !element;
});
ok(okay, "All " + histId + " actions were skipped");
} else {
ok(false, "Unexpected " + histId + " was logged");
}
}
}
window.onload = function() {
SimpleTest.waitForExplicitFinish();
Task.spawn(function* () {
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
DebuggerServer.init(function () { return true; });
DebuggerServer.addBrowserActors();
patchTelemetry();
// Cycle once, so we can test for multiple opens
yield cycleWebIDE();
let win = yield openWebIDE();
// Wait a bit, so we're open for a non-zero time
yield waitForTime(TOOL_DELAY);
addFakeRuntimes(win);
yield addTestApp(win);
// Each one should log a connection result and non-zero connection
// time
yield connectToRuntime(win, "usb");
yield waitForTime(TOOL_DELAY);
yield connectToRuntime(win, "wifi");
yield waitForTime(TOOL_DELAY);
yield connectToRuntime(win, "simulator");
yield waitForTime(TOOL_DELAY);
yield connectToRuntime(win, "custom", 0 /* remote */);
yield waitForTime(TOOL_DELAY);
yield connectToRuntime(win, "custom", 1 /* local */);
yield waitForTime(TOOL_DELAY);
yield closeWebIDE(win);
checkResults();
resetTelemetry();
DebuggerServer.destroy();
SimpleTest.finish();
});
}
</script>
</body>
</html>

Просмотреть файл

@ -23,7 +23,7 @@ browser.jar:
* skin/classic/browser/browser.css
* skin/classic/browser/browser-lightweightTheme.css
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/content-contextmenu.svg
* skin/classic/browser/content-contextmenu.svg
* skin/classic/browser/engineManager.css
skin/classic/browser/fullscreen-darknoise.png
skin/classic/browser/Geolocation-16.png

Просмотреть файл

@ -23,7 +23,7 @@ browser.jar:
* skin/classic/browser/browser.css (browser.css)
* skin/classic/browser/browser-lightweightTheme.css
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/content-contextmenu.svg
* skin/classic/browser/content-contextmenu.svg
* skin/classic/browser/engineManager.css (engineManager.css)
skin/classic/browser/fullscreen-darknoise.png
skin/classic/browser/Geolocation-16.png

Просмотреть файл

@ -25,7 +25,7 @@ browser.jar:
* skin/classic/browser/browser.css
* skin/classic/browser/browser-lightweightTheme.css
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/content-contextmenu.svg
* skin/classic/browser/content-contextmenu.svg
* skin/classic/browser/engineManager.css
skin/classic/browser/fullscreen-darknoise.png
skin/classic/browser/Geolocation-16.png
@ -444,7 +444,7 @@ browser.jar:
* skin/classic/aero/browser/browser.css (browser-aero.css)
* skin/classic/aero/browser/browser-lightweightTheme.css
skin/classic/aero/browser/click-to-play-warning-stripes.png
skin/classic/aero/browser/content-contextmenu.svg
* skin/classic/aero/browser/content-contextmenu.svg
* skin/classic/aero/browser/engineManager.css
skin/classic/aero/browser/fullscreen-darknoise.png
skin/classic/aero/browser/Geolocation-16.png

Просмотреть файл

@ -701,3 +701,11 @@ if CONFIG['MOZ_CRASHREPORTER']:
if CONFIG['MOZ_ANDROID_MLS_STUMBLER']:
main.included_projects += ['../FennecStumbler']
main.referenced_projects += ['../FennecStumbler']
if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']:
searchactivity = add_android_eclipse_library_project('FennecResourcesSearch')
searchactivity.package_name = 'org.mozilla.fennec.resources.search'
searchactivity.res = SRCDIR + '/../search/res'
searchactivity.included_projects += ['../' + resources.name]
main.included_projects += ['../' + searchactivity.name]

Просмотреть файл

@ -17,6 +17,9 @@
package org.mozilla.gecko.sqlite;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
@ -24,29 +27,26 @@ import android.database.AbstractCursor;
import android.database.CursorIndexOutOfBoundsException;
import android.util.Log;
import java.nio.ByteBuffer;
import java.util.ArrayList;
/*
* Android's AbstractCursor throws on getBlob()
* and MatrixCursor forgot to override it. This was fixed
* at some point but old devices are still SOL.
* Oh, and everything in MatrixCursor is private instead of
* protected, so we need to entirely duplicate it here,
* instad of just being able to add the missing method.
*/
/**
* A mutable cursor implementation backed by an array of {@code Object}s. Use
* {@link #newRow()} to add rows. Automatically expands internal capacity
* as needed.
*
* This class provides one missing feature from Android's MatrixCursor:
* the implementation of getBlob that was inadvertently omitted from API 9 (and
* perhaps later; it's present in 14).
*
* MatrixCursor is all private, so we entirely duplicate it here.
*/
public class MatrixBlobCursor extends AbstractCursor {
private static final String LOGTAG = "GeckoMatrixCursor";
private final String[] columnNames;
private Object[] data;
private int rowCount;
private final int columnCount;
private static final String LOGTAG = "MatrixBlobCursor";
private int rowCount;
/* inner-access */ Object[] data;
/**
* Constructs a new cursor with the given initial capacity.
@ -143,17 +143,18 @@ public class MatrixBlobCursor extends AbstractCursor {
*/
@WrapElementForJNI
public void addRow(Iterable<?> columnValues) {
int start = rowCount * columnCount;
int end = start + columnCount;
ensureCapacity(end);
final int start = rowCount * columnCount;
if (columnValues instanceof ArrayList<?>) {
addRow((ArrayList<?>) columnValues, start);
return;
}
final int end = start + columnCount;
int current = start;
Object[] localData = data;
ensureCapacity(end);
final Object[] localData = data;
for (Object columnValue : columnValues) {
if (current == end) {
// TODO: null out row?
@ -176,39 +177,47 @@ public class MatrixBlobCursor extends AbstractCursor {
/** Optimization for {@link ArrayList}. */
@WrapElementForJNI
private void addRow(ArrayList<?> columnValues, int start) {
int size = columnValues.size();
final int size = columnValues.size();
if (size != columnCount) {
throw new IllegalArgumentException("columnNames.length = "
+ columnCount + ", columnValues.size() = " + size);
}
rowCount++;
Object[] localData = data;
final int end = start + columnCount;
ensureCapacity(end);
// Take a reference just in case someone calls ensureCapacity
// and `data` gets replaced by a new array!
final Object[] localData = data;
for (int i = 0; i < size; i++) {
localData[start + i] = columnValues.get(i);
}
rowCount++;
}
/** Ensures that this cursor has enough capacity. */
private void ensureCapacity(int size) {
if (size > data.length) {
Object[] oldData = this.data;
int newSize = data.length * 2;
if (newSize < size) {
newSize = size;
}
this.data = new Object[newSize];
System.arraycopy(oldData, 0, this.data, 0, oldData.length);
/**
* Ensures that this cursor has enough capacity. If it needs to allocate
* a new array, the existing capacity will be at least doubled.
*/
private void ensureCapacity(final int size) {
if (size <= data.length) {
return;
}
final Object[] oldData = this.data;
this.data = new Object[Math.max(size, data.length * 2)];
System.arraycopy(oldData, 0, this.data, 0, oldData.length);
}
/**
* Builds a row, starting from the left-most column and adding one column
* value at a time. Follows the same ordering as the column names specified
* at cursor construction time.
*
* Not thread-safe.
*/
public class RowBuilder {
private int index;
private final int endIndex;
@ -224,10 +233,9 @@ public class MatrixBlobCursor extends AbstractCursor {
* values
* @return this builder to support chaining
*/
public RowBuilder add(Object columnValue) {
public RowBuilder add(final Object columnValue) {
if (index == endIndex) {
throw new CursorIndexOutOfBoundsException(
"No more columns left.");
throw new CursorIndexOutOfBoundsException("No more columns left.");
}
data[index++] = columnValue;
@ -235,6 +243,9 @@ public class MatrixBlobCursor extends AbstractCursor {
}
}
/**
* Not thread safe.
*/
public void set(int column, Object value) {
if (column < 0 || column >= columnCount) {
throw new CursorIndexOutOfBoundsException("Requested column: "
@ -269,7 +280,7 @@ public class MatrixBlobCursor extends AbstractCursor {
@Override
public short getShort(int column) {
Object value = get(column);
final Object value = get(column);
if (value == null) return 0;
if (value instanceof Number) return ((Number) value).shortValue();
return Short.parseShort(value.toString());
@ -314,10 +325,11 @@ public class MatrixBlobCursor extends AbstractCursor {
if (value instanceof byte[]) {
return (byte[]) value;
}
if (value instanceof ByteBuffer) {
ByteBuffer data = (ByteBuffer)value;
byte[] byteArray = new byte[data.remaining()];
data.get(byteArray);
final ByteBuffer bytes = (ByteBuffer) value;
byte[] byteArray = new byte[bytes.remaining()];
bytes.get(byteArray);
return byteArray;
}
throw new UnsupportedOperationException("BLOB Object not of known type");
@ -332,7 +344,7 @@ public class MatrixBlobCursor extends AbstractCursor {
protected void finalize() {
if (AppConstants.DEBUG_BUILD) {
if (!isClosed()) {
Log.e(LOGTAG, "Cursor finalized without being closed");
Log.e(LOGTAG, "Cursor finalized without being closed", new RuntimeException("stack"));
}
}

Просмотреть файл

@ -72,6 +72,10 @@ HelperAppLauncherDialog.prototype = {
// file to another application.
let file = url.QueryInterface(Ci.nsIFileURL).file;
// Normalize the nsILocalFile in-place. This will ensure that paths
// can be correctly compared via `contains`, below.
file.normalize();
// TODO: pref blacklist?
let appRoot = FileUtils.getFile("XREExeF", []);

Просмотреть файл

@ -756,7 +756,7 @@ class B2GOptions(MochitestOptions):
defaults["testPath"] = ""
defaults["extensionsToExclude"] = ["specialpowers"]
# See dependencies of bug 1038943.
defaults["leakThreshold"] = 4991
defaults["leakThreshold"] = 4727
self.set_defaults(**defaults)
def verifyRemoteOptions(self, options):

Просмотреть файл

@ -5877,11 +5877,6 @@
"kind": "boolean",
"description": "How many times has the devtool's Developer Toolbar been opened via the toolbox button?"
},
"DEVTOOLS_WEBIDE_OPENED_BOOLEAN": {
"expires_in_version": "never",
"kind": "boolean",
"description": "How many times has the DevTools WebIDE been opened?"
},
"DEVTOOLS_CUSTOM_OPENED_BOOLEAN": {
"expires_in_version": "never",
"kind": "boolean",
@ -5997,11 +5992,6 @@
"kind": "flag",
"description": "How many users have opened the devtool's Developer Toolbar been opened via the toolbox button?"
},
"DEVTOOLS_WEBIDE_OPENED_PER_USER_FLAG": {
"expires_in_version": "never",
"kind": "flag",
"description": "How many users have opened the DevTools WebIDE?"
},
"DEVTOOLS_CUSTOM_OPENED_PER_USER_FLAG": {
"expires_in_version": "never",
"kind": "flag",
@ -6161,13 +6151,6 @@
"n_buckets": 100,
"description": "How long has the developer toolbar been active (seconds)"
},
"DEVTOOLS_WEBIDE_TIME_ACTIVE_SECONDS": {
"expires_in_version": "never",
"kind": "exponential",
"high": "10000000",
"n_buckets": 100,
"description": "How long has WebIDE been active (seconds)"
},
"DEVTOOLS_CUSTOM_TIME_ACTIVE_SECONDS": {
"expires_in_version": "never",
"kind": "exponential",
@ -6175,53 +6158,6 @@
"n_buckets": 100,
"description": "How long has a custom developer tool been active (seconds)"
},
"DEVTOOLS_WEBIDE_CONNECTION_RESULT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Did WebIDE runtime connection succeed?"
},
"DEVTOOLS_WEBIDE_USB_CONNECTION_RESULT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Did WebIDE USB runtime connection succeed?"
},
"DEVTOOLS_WEBIDE_WIFI_CONNECTION_RESULT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Did WebIDE WiFi runtime connection succeed?"
},
"DEVTOOLS_WEBIDE_SIMULATOR_CONNECTION_RESULT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Did WebIDE simulator runtime connection succeed?"
},
"DEVTOOLS_WEBIDE_REMOTE_CONNECTION_RESULT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Did WebIDE remote runtime connection succeed?"
},
"DEVTOOLS_WEBIDE_LOCAL_CONNECTION_RESULT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Did WebIDE local runtime connection succeed?"
},
"DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS": {
"expires_in_version": "never",
"kind": "exponential",
"high": "10000000",
"n_buckets": 100,
"description": "How long was WebIDE connected to a runtime (seconds)?"
},
"DEVTOOLS_WEBIDE_CONNECTION_PLAY_USED": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Was WebIDE's play button used during this runtime connection?"
},
"DEVTOOLS_WEBIDE_CONNECTION_DEBUG_USED": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Was WebIDE's debug button used during this runtime connection?"
},
"BROWSER_IS_USER_DEFAULT": {
"expires_in_version": "never",
"kind": "boolean",