mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-27 06:10:27 +00:00
00ce1ce6fd
- Bug 1175347 - Add a JSAPI test for exposing availability of locales derived from the default locale. r=itsatest, rs=till over IRL (0bba85db1) - Bug 1175347 - Fix a test that assumes too much in compacting builds. r=intermittent-orange in a CLOSED TREE (b2992b31c) - Bug 1171180 - Remove trunc from jsmath; r=jorendorff (0e8913338) - Bug 1176864 - Truncate modulo operator for int32 r=h4writer, r=nbp (5de9c5340) - Bug 1166790 - Remove old Statistics formatting code; r=sfink (6abc54dab) - Bug 1171612 - Use C++11 features to make Statistics module nicer; r=sfink (d0cfef988) - Bug 1132208 - "Remove dead code from framerate actor now in GraphsWorker.js". r=jsantell (4bfaf2773) - Bug 1146237 - FramerateActor should use docShell.now() rather than performance.now so that page refreshes do not break it. r=vp (a0d3fbd28) - Bug 1134079 - Supply audio node definitions directly from the client if the webaudio actor server does not support it (like on older versions of FxOS). r=vp (95f728d47) - Bug 1172183 - Pull out the implementation of FramerateActor so that it can be consumed by other actors. r=vp (1c3f0d82a) - Bug 1172182 - Pull out memory utility logic out of the MemoryActor so other actors can consume it. r=vp (851d1cce3) - Bug 1172182 part 2: correctly link to the memory module via timeline actor. r=vp (3714663db) - Bug 1172184 - Pull out logic from TimelineActor into a standalone module that can be consumed by other actors. (031127dc0) - partial of Bug 1159506 - Make GC events use TimeStamp. r=terrence (99fa0378f) - Bug 1035973 - Add DebuggerObject.getOwnPropertySymbols; r=fitzgen (fd10482d5) - Bug 1174712 - Tolerate singleton objects with uncacheable prototypes in Ion caches, r=jandem. (7c3ce4fdc) - add limits for numeric_limits (67b09aa7f) - Bug 811911 - Use UTF-8 output for TwoByte chars in Error objects; r=jandem (2fd3cf6cd) - Fix the test for bug 1173787 to work even when the filename contains a ':' (e.g. on Windows) so we can reopen the CLOSED TREE (b42aa3b92) - Bug 1100498 - Report function names for addon exceptions. r=billm (dfa69d830) - Bug 1170840 - Add testbed allocator for new regalloc features, and use for a change to hot/cold code bundle splitting, r=sunfish. (95c484a37) - Bug 1174542 - Remove unnecessary AutoWritabeJitCode from initTraceLogger. r=luke (a427e979c) - Bug 1173529: IonMonkey - Also iterate phis when removing guards, r=nbp (055a5dcd7) - Bug 1114079 - Fix overrecursion check in nsGlobalWindow::SetNewDocument to not report a JS exception. r=bz (7c0ba0677) - Bug 1172513 part 1. Fix shell's Evaluate to actually throw when it detects save/load bytecode mismatches. r=waldo (5f5ccc094) - Bug 1172513 part 2. When XDR-encoding a function, don't incode temporary flags. r=waldo (404fa1939) - Bug 1171430 - Do not poison the nursery's chunk kind marker; r=terrence (248667fc9) - Bug 1171430 - Don't shift the poison value by non-byte values; r=jonco (320ba4ba0) - Bug 1173908 - Fix an MSVC warning about negating an unsigned integer; r=nbp (3244fd56c) - Bug 1172545 - Recover from OOM if Ion compilation is skipped due to not being able to allocate a 'this' object, r=jandem. (918025215)
232 lines
7.2 KiB
JavaScript
232 lines
7.2 KiB
JavaScript
/* 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/. */
|
|
|
|
/**
|
|
* A collection of `AudioNodeModel`s used throughout the editor
|
|
* to keep track of audio nodes within the audio context.
|
|
*/
|
|
let gAudioNodes = new AudioNodesCollection();
|
|
|
|
/**
|
|
* Initializes the web audio editor views
|
|
*/
|
|
function startupWebAudioEditor() {
|
|
return all([
|
|
WebAudioEditorController.initialize(),
|
|
ContextView.initialize(),
|
|
InspectorView.initialize(),
|
|
PropertiesView.initialize(),
|
|
AutomationView.initialize()
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Destroys the web audio editor controller and views.
|
|
*/
|
|
function shutdownWebAudioEditor() {
|
|
return all([
|
|
WebAudioEditorController.destroy(),
|
|
ContextView.destroy(),
|
|
InspectorView.destroy(),
|
|
PropertiesView.destroy(),
|
|
AutomationView.destroy()
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Functions handling target-related lifetime events.
|
|
*/
|
|
let WebAudioEditorController = {
|
|
/**
|
|
* Listen for events emitted by the current tab target.
|
|
*/
|
|
initialize: Task.async(function* () {
|
|
this._onTabNavigated = this._onTabNavigated.bind(this);
|
|
this._onThemeChange = this._onThemeChange.bind(this);
|
|
|
|
gTarget.on("will-navigate", this._onTabNavigated);
|
|
gTarget.on("navigate", this._onTabNavigated);
|
|
gFront.on("start-context", this._onStartContext);
|
|
gFront.on("create-node", this._onCreateNode);
|
|
gFront.on("connect-node", this._onConnectNode);
|
|
gFront.on("connect-param", this._onConnectParam);
|
|
gFront.on("disconnect-node", this._onDisconnectNode);
|
|
gFront.on("change-param", this._onChangeParam);
|
|
gFront.on("destroy-node", this._onDestroyNode);
|
|
|
|
// Hook into theme change so we can change
|
|
// the graph's marker styling, since we can't do this
|
|
// with CSS
|
|
gDevTools.on("pref-changed", this._onThemeChange);
|
|
|
|
// Store the AudioNode definitions from the WebAudioFront, if the method exists.
|
|
// If not, get the JSON directly. Using the actor method is preferable so the client
|
|
// knows exactly what methods are supported on the server.
|
|
let actorHasDefinition = yield gTarget.actorHasMethod("webaudio", "getDefinition");
|
|
if (actorHasDefinition) {
|
|
AUDIO_NODE_DEFINITION = yield gFront.getDefinition();
|
|
} else {
|
|
AUDIO_NODE_DEFINITION = require("devtools/server/actors/utils/audionodes.json");
|
|
}
|
|
}),
|
|
|
|
/**
|
|
* Remove events emitted by the current tab target.
|
|
*/
|
|
destroy: function() {
|
|
gTarget.off("will-navigate", this._onTabNavigated);
|
|
gTarget.off("navigate", this._onTabNavigated);
|
|
gFront.off("start-context", this._onStartContext);
|
|
gFront.off("create-node", this._onCreateNode);
|
|
gFront.off("connect-node", this._onConnectNode);
|
|
gFront.off("connect-param", this._onConnectParam);
|
|
gFront.off("disconnect-node", this._onDisconnectNode);
|
|
gFront.off("change-param", this._onChangeParam);
|
|
gFront.off("destroy-node", this._onDestroyNode);
|
|
gDevTools.off("pref-changed", this._onThemeChange);
|
|
},
|
|
|
|
/**
|
|
* Called when page is reloaded to show the reload notice and waiting
|
|
* for an audio context notice.
|
|
*/
|
|
reset: function () {
|
|
$("#content").hidden = true;
|
|
ContextView.resetUI();
|
|
InspectorView.resetUI();
|
|
PropertiesView.resetUI();
|
|
},
|
|
|
|
// Since node events (create, disconnect, connect) are all async,
|
|
// we have to make sure to wait that the node has finished creating
|
|
// before performing an operation on it.
|
|
getNode: function* (nodeActor) {
|
|
let id = nodeActor.actorID;
|
|
let node = gAudioNodes.get(id);
|
|
|
|
if (!node) {
|
|
let { resolve, promise } = defer();
|
|
gAudioNodes.on("add", function createNodeListener (createdNode) {
|
|
if (createdNode.id === id) {
|
|
gAudioNodes.off("add", createNodeListener);
|
|
resolve(createdNode);
|
|
}
|
|
});
|
|
node = yield promise;
|
|
}
|
|
return node;
|
|
},
|
|
|
|
/**
|
|
* Fired when the devtools theme changes (light, dark, etc.)
|
|
* so that the graph can update marker styling, as that
|
|
* cannot currently be done with CSS.
|
|
*/
|
|
_onThemeChange: function (event, data) {
|
|
window.emit(EVENTS.THEME_CHANGE, data.newValue);
|
|
},
|
|
|
|
/**
|
|
* Called for each location change in the debugged tab.
|
|
*/
|
|
_onTabNavigated: Task.async(function* (event, {isFrameSwitching}) {
|
|
switch (event) {
|
|
case "will-navigate": {
|
|
// Make sure the backend is prepared to handle audio contexts.
|
|
if (!isFrameSwitching) {
|
|
yield gFront.setup({ reload: false });
|
|
}
|
|
|
|
// Clear out current UI.
|
|
this.reset();
|
|
|
|
// When switching to an iframe, ensure displaying the reload button.
|
|
// As the document has already been loaded without being hooked.
|
|
if (isFrameSwitching) {
|
|
$("#reload-notice").hidden = false;
|
|
$("#waiting-notice").hidden = true;
|
|
} else {
|
|
// Otherwise, we are loading a new top level document,
|
|
// so we don't need to reload anymore and should receive
|
|
// new node events.
|
|
$("#reload-notice").hidden = true;
|
|
$("#waiting-notice").hidden = false;
|
|
}
|
|
|
|
// Clear out stored audio nodes
|
|
gAudioNodes.reset();
|
|
|
|
window.emit(EVENTS.UI_RESET);
|
|
break;
|
|
}
|
|
case "navigate": {
|
|
// TODO Case of bfcache, needs investigating
|
|
// bug 994250
|
|
break;
|
|
}
|
|
}
|
|
}),
|
|
|
|
/**
|
|
* Called after the first audio node is created in an audio context,
|
|
* signaling that the audio context is being used.
|
|
*/
|
|
_onStartContext: function() {
|
|
$("#reload-notice").hidden = true;
|
|
$("#waiting-notice").hidden = true;
|
|
$("#content").hidden = false;
|
|
window.emit(EVENTS.START_CONTEXT);
|
|
},
|
|
|
|
/**
|
|
* Called when a new node is created. Creates an `AudioNodeView` instance
|
|
* for tracking throughout the editor.
|
|
*/
|
|
_onCreateNode: Task.async(function* (nodeActor) {
|
|
yield gAudioNodes.add(nodeActor);
|
|
}),
|
|
|
|
/**
|
|
* Called on `destroy-node` when an AudioNode is GC'd. Removes
|
|
* from the AudioNode array and fires an event indicating the removal.
|
|
*/
|
|
_onDestroyNode: function (nodeActor) {
|
|
gAudioNodes.remove(gAudioNodes.get(nodeActor.actorID));
|
|
},
|
|
|
|
/**
|
|
* Called when a node is connected to another node.
|
|
*/
|
|
_onConnectNode: Task.async(function* ({ source: sourceActor, dest: destActor }) {
|
|
let source = yield WebAudioEditorController.getNode(sourceActor);
|
|
let dest = yield WebAudioEditorController.getNode(destActor);
|
|
source.connect(dest);
|
|
}),
|
|
|
|
/**
|
|
* Called when a node is conneceted to another node's AudioParam.
|
|
*/
|
|
_onConnectParam: Task.async(function* ({ source: sourceActor, dest: destActor, param }) {
|
|
let source = yield WebAudioEditorController.getNode(sourceActor);
|
|
let dest = yield WebAudioEditorController.getNode(destActor);
|
|
source.connect(dest, param);
|
|
}),
|
|
|
|
/**
|
|
* Called when a node is disconnected.
|
|
*/
|
|
_onDisconnectNode: Task.async(function* (nodeActor) {
|
|
let node = yield WebAudioEditorController.getNode(nodeActor);
|
|
node.disconnect();
|
|
}),
|
|
|
|
/**
|
|
* Called when a node param is changed.
|
|
*/
|
|
_onChangeParam: Task.async(function* ({ actor, param, value }) {
|
|
let node = yield WebAudioEditorController.getNode(actor);
|
|
window.emit(EVENTS.CHANGE_PARAM, node, param, value);
|
|
})
|
|
};
|