This commit is contained in:
Nick Alexander 2013-10-24 09:35:02 -07:00
Родитель 84fd08f70a 0e4e01758c
Коммит 8920f74077
713 изменённых файлов: 13462 добавлений и 7623 удалений

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

@ -18,4 +18,4 @@
# Modifying this file will now automatically clobber the buildbot machines \o/
#
Bug 918207 needed a clobber on every platform because we can't have nice things
Bug 899574 needed a clobber on every platform because we can't have nice things

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

@ -16,9 +16,6 @@ CPP_SOURCES += [
'ApplicationAccessibleWrap.cpp',
'AtkSocketAccessible.cpp',
'DocAccessibleWrap.cpp',
'Platform.cpp',
'RootAccessibleWrap.cpp',
'UtilInterface.cpp',
'nsMaiHyperlink.cpp',
'nsMaiInterfaceAction.cpp',
'nsMaiInterfaceComponent.cpp',
@ -31,6 +28,9 @@ CPP_SOURCES += [
'nsMaiInterfaceTable.cpp',
'nsMaiInterfaceText.cpp',
'nsMaiInterfaceValue.cpp',
'Platform.cpp',
'RootAccessibleWrap.cpp',
'UtilInterface.cpp',
]
LIBRARY_NAME = 'accessibility_toolkit_s'

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

@ -10,8 +10,8 @@ MODULE = 'accessibility'
EXPORTS += [
'AccEvent.h',
'nsAccessNode.h',
'nsAccessibilityService.h',
'nsAccessNode.h',
]
EXPORTS.mozilla.a11y += [

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

@ -13,9 +13,9 @@ EXPORTS.mozilla.a11y += [
]
CPP_SOURCES += [
'ARIAGridAccessible.cpp',
'Accessible.cpp',
'ApplicationAccessible.cpp',
'ARIAGridAccessible.cpp',
'BaseAccessibles.cpp',
'DocAccessible.cpp',
'FormControlAccessible.cpp',

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

@ -21,13 +21,13 @@ CMMSRCS += [
'AccessibleWrap.mm',
'DocAccessibleWrap.mm',
'MacUtils.mm',
'Platform.mm',
'RootAccessibleWrap.mm',
'mozAccessible.mm',
'mozActionElements.mm',
'mozDocAccessible.mm',
'mozHTMLAccessible.mm',
'mozTextAccessible.mm',
'Platform.mm',
'RootAccessibleWrap.mm',
]
LIBXUL_LIBRARY = True

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

@ -20,18 +20,18 @@ CPP_SOURCES += [
'AccessibleWrap.cpp',
'ApplicationAccessibleWrap.cpp',
'ARIAGridAccessibleWrap.cpp',
'Compatibility.cpp',
'DocAccessibleWrap.cpp',
'EnumVariant.cpp',
'HTMLTableAccessibleWrap.cpp',
'HTMLWin32ObjectAccessible.cpp',
'HyperTextAccessibleWrap.cpp',
'ImageAccessibleWrap.cpp',
'IUnknownImpl.cpp',
'nsWinUtils.cpp',
'Compatibility.cpp',
'EnumVariant.cpp',
'Platform.cpp',
'ServiceProvider.cpp',
'RootAccessibleWrap.cpp',
'ServiceProvider.cpp',
'TextLeafAccessibleWrap.cpp',
]

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

@ -516,8 +516,8 @@ sdnAccessible::get_language(BSTR __RPC_FAR* aLanguage)
return CO_E_OBJNOTCONNECTED;
nsAutoString language;
if (mNode->IsElement())
nsCoreUtils::GetLanguageFor(mNode->AsElement(), nullptr, language);
if (mNode->IsContent())
nsCoreUtils::GetLanguageFor(mNode->AsContent(), nullptr, language);
if (language.IsEmpty()) { // Nothing found, so use document's language
mNode->OwnerDoc()->GetHeaderData(nsGkAtoms::headerContentLanguage,
language);

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

@ -11,6 +11,7 @@ Cu.import('resource://gre/modules/AlarmService.jsm');
Cu.import('resource://gre/modules/ActivitiesService.jsm');
Cu.import('resource://gre/modules/PermissionPromptHelper.jsm');
Cu.import('resource://gre/modules/ObjectWrapper.jsm');
Cu.import('resource://gre/modules/NotificationDB.jsm');
Cu.import('resource://gre/modules/accessibility/AccessFu.jsm');
Cu.import('resource://gre/modules/Payment.jsm');
Cu.import("resource://gre/modules/AppsUtils.jsm");

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

@ -1,4 +1,4 @@
{
"revision": "a57a913f1dd723afa191124f27b8d9fc4b0cb1c0",
"revision": "20e3f42ccb6073c6d9bc9741de3a19a939a8a7d8",
"repo_path": "/integration/gaia-central"
}

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

@ -352,6 +352,8 @@
@BINPATH@/components/ContactManager.manifest
@BINPATH@/components/PhoneNumberService.js
@BINPATH@/components/PhoneNumberService.manifest
@BINPATH@/components/NotificationStorage.js
@BINPATH@/components/NotificationStorage.manifest
@BINPATH@/components/PermissionSettings.js
@BINPATH@/components/PermissionSettings.manifest
@BINPATH@/components/PermissionPromptService.js
@ -543,9 +545,6 @@
@BINPATH@/components/TCPSocketParentIntermediary.js
@BINPATH@/components/TCPSocket.manifest
@BINPATH@/components/AppProtocolHandler.js
@BINPATH@/components/AppProtocolHandler.manifest
@BINPATH@/components/Payment.js
@BINPATH@/components/PaymentFlowInfo.js
@BINPATH@/components/PaymentRequestInfo.js

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

@ -365,12 +365,6 @@ pref("browser.download.manager.quitBehavior", 0);
pref("browser.download.manager.scanWhenDone", true);
pref("browser.download.manager.resumeOnWakeDelay", 10000);
// Enables the asynchronous Downloads API in the Downloads Panel.
pref("browser.download.useJSTransfer", true);
// This allows disabling the Downloads Panel in favor of the old interface.
pref("browser.download.useToolkitUI", false);
// This allows disabling the animated notifications shown by
// the Downloads Indicator when a download starts or completes.
pref("browser.download.animateNotifications", true);

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

@ -7,6 +7,7 @@ let Ci = Components.interfaces;
let Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/NotificationDB.jsm");
Cu.import("resource:///modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",

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

@ -235,15 +235,12 @@ this.DownloadsCommon = {
},
/**
* Indicates whether we should show the full Download Manager window interface
* instead of the simplified panel interface. The behavior of downloads
* across browsing session is consistent with the selected interface.
* Indicates that we should show the simplified panel interface instead of the
* full Download Manager window interface. The code associated with the
* Download Manager window interface will be removed in bug 899110.
*/
get useToolkitUI()
{
try {
return Services.prefs.getBoolPref("browser.download.useToolkitUI");
} catch (ex) { }
return false;
},
@ -570,17 +567,12 @@ XPCOMUtils.defineLazyGetter(DownloadsCommon, "isWinVistaOrHigher", function () {
});
/**
* Returns true if we should hook the panel to the JavaScript API for downloads
* instead of the nsIDownloadManager back-end. In order for the logic to work
* properly, this value never changes during the execution of the application,
* even if the underlying preference value has changed. A restart is required
* for the change to take effect.
* Returns true to indicate that we should hook the panel to the JavaScript API
* for downloads instead of the nsIDownloadManager back-end. The code
* associated with nsIDownloadManager will be removed in bug 899110.
*/
XPCOMUtils.defineLazyGetter(DownloadsCommon, "useJSTransfer", function () {
try {
return Services.prefs.getBoolPref("browser.download.useJSTransfer");
} catch (ex) { }
return false;
return true;
});
////////////////////////////////////////////////////////////////////////////////

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

@ -93,29 +93,13 @@ DownloadsStartup.prototype = {
.registerFactory(kDownloadsUICid, "",
kDownloadsUIContractId, null);
// If the integration preference is enabled, override Toolkit's
// nsITransfer implementation with the one from the JavaScript API for
// downloads. This should be used only by developers while testing new
// code that uses the JavaScript API, and will eventually be removed
// when nsIDownloadManager will not be available anymore (bug 851471).
let useJSTransfer = false;
try {
// For performance reasons, we don't want to load the DownloadsCommon
// module during startup, so we read the preference value directly.
useJSTransfer =
Services.prefs.getBoolPref("browser.download.useJSTransfer");
} catch (ex) { }
if (useJSTransfer) {
Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
.registerFactory(kTransferCid, "",
kTransferContractId, null);
} else {
// The other notifications are handled internally by the JavaScript
// API for downloads, no need to observe when that API is enabled.
for (let topic of kObservedTopics) {
Services.obs.addObserver(this, topic, true);
}
}
// Override Toolkit's nsITransfer implementation with the one from the
// JavaScript API for downloads. This will eventually be removed when
// nsIDownloadManager will not be available anymore (bug 851471). The
// old code in this module will be removed in bug 899110.
Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
.registerFactory(kTransferCid, "",
kTransferContractId, null);
break;
case "sessionstore-windows-restored":

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

@ -1420,9 +1420,6 @@ BrowserGlue.prototype = {
}
this._setPersist(toolbarResource, currentsetResource, currentset);
}
Services.prefs.clearUserPref("browser.download.useToolkitUI");
Services.prefs.clearUserPref("browser.library.useNewDownloadsView");
}
#ifdef XP_WIN

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

@ -350,6 +350,10 @@ let SessionStoreInternal = {
// See bug 516755.
_disabledForMultiProcess: false,
// Promise that is resolved when we're ready to initialize
// and restore the session.
_promiseReadyForInitialization: null,
/**
* A promise fulfilled once initialization is complete.
*/
@ -870,13 +874,33 @@ let SessionStoreInternal = {
return;
}
// The very first window that is opened creates a promise that is then
// re-used by all subsequent windows. The promise will be used to tell
// when we're ready for initialization.
if (!this._promiseReadyForInitialization) {
let deferred = Promise.defer();
// Wait for the given window's delayed startup to be finished.
Services.obs.addObserver(function obs(subject, topic) {
if (aWindow == subject) {
Services.obs.removeObserver(obs, topic);
deferred.resolve();
}
}, "browser-delayed-startup-finished", false);
// We are ready for initialization as soon as the session file has been
// read from disk and the initial window's delayed startup has finished.
this._promiseReadyForInitialization =
Promise.all([deferred.promise, gSessionStartup.onceInitialized]);
}
// We can't call this.onLoad since initialization
// hasn't completed, so we'll wait until it is done.
// Even if additional windows are opened and wait
// for initialization as well, the first opened
// window should execute first, and this.onLoad
// will be called with the initialState.
gSessionStartup.onceInitialized.then(() => {
this._promiseReadyForInitialization.then(() => {
if (aWindow.closed) {
return;
}

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

@ -13,6 +13,7 @@ EXTRA_COMPONENTS += [
JS_MODULES_PATH = 'modules/sessionstore'
EXTRA_JS_MODULES = [
'_SessionFile.jsm',
'DocShellCapabilities.jsm',
'DocumentUtils.jsm',
'Messenger.jsm',
@ -27,7 +28,6 @@ EXTRA_JS_MODULES = [
'TabStateCache.jsm',
'TextAndScrollData.jsm',
'XPathGenerator.jsm',
'_SessionFile.jsm',
]
EXTRA_PP_JS_MODULES += [

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

@ -61,3 +61,5 @@ fi
MOZ_WEBGL_CONFORMANT=1
# Enable navigator.mozPay
MOZ_PAY=1
MOZ_JSDOWNLOADS=1

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

@ -1156,8 +1156,13 @@ SourceScripts.prototype = {
_onBlackBoxChange: function (aEvent, { url, isBlackBoxed }) {
const item = DebuggerView.Sources.getItemByValue(url);
if (item) {
DebuggerView.Sources.callMethod("checkItem", item.target, !isBlackBoxed);
if (isBlackBoxed) {
item.target.classList.add("black-boxed");
} else {
item.target.classList.remove("black-boxed");
}
}
DebuggerView.Sources.updateToolbarButtonsState();
DebuggerView.maybeShowBlackBoxMessage();
},

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

@ -19,7 +19,7 @@ function SourcesView() {
this._onSourceSelect = this._onSourceSelect.bind(this);
this._onSourceClick = this._onSourceClick.bind(this);
this._onBreakpointRemoved = this._onBreakpointRemoved.bind(this);
this._onSourceCheck = this._onSourceCheck.bind(this);
this.toggleBlackBoxing = this.toggleBlackBoxing.bind(this);
this._onStopBlackBoxing = this._onStopBlackBoxing.bind(this);
this._onBreakpointClick = this._onBreakpointClick.bind(this);
this._onBreakpointCheckboxClick = this._onBreakpointCheckboxClick.bind(this);
@ -28,7 +28,7 @@ function SourcesView() {
this._onConditionalPopupHiding = this._onConditionalPopupHiding.bind(this);
this._onConditionalTextboxInput = this._onConditionalTextboxInput.bind(this);
this._onConditionalTextboxKeyPress = this._onConditionalTextboxKeyPress.bind(this);
this._updatePrettyPrintButtonState = this._updatePrettyPrintButtonState.bind(this);
this.updateToolbarButtonsState = this.updateToolbarButtonsState.bind(this);
}
SourcesView.prototype = Heritage.extend(WidgetMethods, {
@ -39,7 +39,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
dumpn("Initializing the SourcesView");
this.widget = new SideMenuWidget(document.getElementById("sources"), {
showItemCheckboxes: true,
showArrows: true
});
@ -51,6 +50,7 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
this._cmPopup = document.getElementById("sourceEditorContextMenu");
this._cbPanel = document.getElementById("conditional-breakpoint-panel");
this._cbTextbox = document.getElementById("conditional-breakpoint-panel-textbox");
this._blackBoxButton = document.getElementById("black-box");
this._stopBlackBoxButton = document.getElementById("black-boxed-message-button");
this._prettyPrintButton = document.getElementById("pretty-print");
@ -62,7 +62,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
window.on(EVENTS.EDITOR_UNLOADED, this._onEditorUnload, false);
this.widget.addEventListener("select", this._onSourceSelect, false);
this.widget.addEventListener("click", this._onSourceClick, false);
this.widget.addEventListener("check", this._onSourceCheck, false);
this._stopBlackBoxButton.addEventListener("click", this._onStopBlackBoxing, false);
this._cbPanel.addEventListener("popupshowing", this._onConditionalPopupShowing, false);
this._cbPanel.addEventListener("popupshown", this._onConditionalPopupShown, false);
@ -86,7 +85,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
window.off(EVENTS.EDITOR_UNLOADED, this._onEditorUnload, false);
this.widget.removeEventListener("select", this._onSourceSelect, false);
this.widget.removeEventListener("click", this._onSourceClick, false);
this.widget.removeEventListener("check", this._onSourceCheck, false);
this._stopBlackBoxButton.removeEventListener("click", this._onStopBlackBoxing, false);
this._cbPanel.removeEventListener("popupshowing", this._onConditionalPopupShowing, false);
this._cbPanel.removeEventListener("popupshowing", this._onConditionalPopupShown, false);
@ -702,22 +700,23 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
document.title = L10N.getFormatStr("DebuggerWindowScriptTitle", script);
DebuggerView.maybeShowBlackBoxMessage();
this._updatePrettyPrintButtonState();
this.updateToolbarButtonsState();
},
/**
* Enable or disable the pretty print button depending on whether the selected
* source is black boxed or not and check or uncheck it depending on if the
* selected source is already pretty printed or not.
* Update the checked/unchecked and enabled/disabled states of the buttons in
* the sources toolbar based on the currently selected source's state.
*/
_updatePrettyPrintButtonState: function() {
updateToolbarButtonsState: function() {
const { source } = this.selectedItem.attachment;
const sourceClient = gThreadClient.source(source);
if (sourceClient.isBlackBoxed) {
this._prettyPrintButton.setAttribute("disabled", true);
this._blackBoxButton.setAttribute("checked", true);
} else {
this._prettyPrintButton.removeAttribute("disabled");
this._blackBoxButton.removeAttribute("checked");
}
if (sourceClient.isPrettyPrinted) {
@ -736,26 +735,30 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
},
/**
* The check listener for the sources container.
* Toggle the black boxed state of the selected source.
*/
_onSourceCheck: function({ detail: { checked }, target }) {
const shouldBlackBox = !checked;
toggleBlackBoxing: function() {
const { source } = this.selectedItem.attachment;
const sourceClient = gThreadClient.source(source);
const shouldBlackBox = !sourceClient.isBlackBoxed;
// Be optimistic that the (un-)black boxing will succeed and enable/disable
// the pretty print button immediately. Then, once we actually get the
// results from the server, make sure that it is in the correct state again
// by calling `_updatePrettyPrintButtonState`.
// Be optimistic that the (un-)black boxing will succeed, so enable/disable
// the pretty print button and check/uncheck the black box button
// immediately. Then, once we actually get the results from the server, make
// sure that it is in the correct state again by calling
// `updateToolbarButtonsState`.
if (shouldBlackBox) {
this._prettyPrintButton.setAttribute("disabled", true);
this._blackBoxButton.setAttribute("checked", true);
} else {
this._prettyPrintButton.removeAttribute("disabled");
this._blackBoxButton.removeAttribute("checked");
}
const { source } = this.getItemForElement(target).attachment;
DebuggerController.SourceScripts.blackBox(source, shouldBlackBox)
.then(this._updatePrettyPrintButtonState,
this._updatePrettyPrintButtonState);
.then(this.updateToolbarButtonsState,
this.updateToolbarButtonsState);
},
/**
@ -763,7 +766,9 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
*/
_onStopBlackBoxing: function() {
let sourceForm = this.selectedItem.attachment.source;
DebuggerController.SourceScripts.blackBox(sourceForm, false);
DebuggerController.SourceScripts.blackBox(sourceForm, false)
.then(this.updateToolbarButtonsState,
this.updateToolbarButtonsState);
},
/**

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

@ -32,6 +32,8 @@
<commandset id="debuggerCommands">
<command id="prettyPrintCommand"
oncommand="DebuggerView.Sources.togglePrettyPrint()"/>
<command id="blackBoxCommand"
oncommand="DebuggerView.Sources.toggleBlackBoxing()"/>
<command id="unBlackBoxButton"
oncommand="DebuggerView.Sources._onStopBlackBoxing()"/>
<command id="nextSourceCommand"
@ -320,12 +322,18 @@
<vbox id="sources-pane">
<vbox id="sources" flex="1"/>
<toolbar id="sources-toolbar" class="devtools-toolbar">
<toolbarbutton id="pretty-print"
label="{}"
tooltiptext="&debuggerUI.sources.prettyPrint;"
class="devtools-toolbarbutton devtools-monospace"
command="prettyPrintCommand"
hidden="true"/>
<hbox id="sources-controls">
<toolbarbutton id="black-box"
tooltiptext="&debuggerUI.sources.blackBoxTooltip;"
command="blackBoxCommand"
class="devtools-toolbarbutton"/>
<toolbarbutton id="pretty-print"
label="{}"
tooltiptext="&debuggerUI.sources.prettyPrint;"
class="devtools-toolbarbutton devtools-monospace"
command="prettyPrintCommand"
hidden="true"/>
</hbox>
</toolbar>
</vbox>
<splitter id="sources-and-editor-splitter"

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

@ -65,7 +65,6 @@ support-files =
[browser_dbg_blackboxing-04.js]
[browser_dbg_blackboxing-05.js]
[browser_dbg_blackboxing-06.js]
[browser_dbg_blackboxing-07.js]
[browser_dbg_file-reload.js]
[browser_dbg_breadcrumbs-access.js]
[browser_dbg_break-on-dom-01.js]

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

@ -27,24 +27,19 @@ function test() {
}
function testBlackBoxSource() {
const checkbox = gDebugger.document.querySelector(".side-menu-widget-item-checkbox");
ok(checkbox, "Should get the checkbox for black boxing the source.");
ok(checkbox.checked, "Should not be black boxed by default.");
const bbButton = getBlackBoxButton(gPanel);
ok(!bbButton.checked, "Should not be black boxed by default");
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(aSource => {
return toggleBlackBoxing(gPanel).then(aSource => {
ok(aSource.isBlackBoxed, "The source should be black boxed now.");
ok(!checkbox.checked, "The checkbox should no longer be checked.");
ok(bbButton.checked, "The checkbox should no longer be checked.");
});
checkbox.click();
return finished;
}
function testBlackBoxReload() {
return reloadActiveTab(gPanel, gDebugger.EVENTS.SOURCE_SHOWN).then(() => {
const checkbox = gDebugger.document.querySelector(".side-menu-widget-item-checkbox");
ok(checkbox, "Should get the checkbox for black boxing the source.");
ok(!checkbox.checked, "Should still be black boxed.");
const bbButton = getBlackBoxButton(gPanel);
ok(bbButton.checked, "Should still be black boxed.");
});
}

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

@ -31,12 +31,9 @@ function test() {
}
function testBlackBoxSource() {
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(aSource => {
return toggleBlackBoxing(gPanel).then(aSource => {
ok(aSource.isBlackBoxed, "The source should be black boxed now.");
});
getBlackBoxCheckbox(BLACKBOXME_URL).click();
return finished;
}
function testBlackBoxStack() {
@ -53,12 +50,6 @@ function testBlackBoxStack() {
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;

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

@ -40,7 +40,7 @@ function testBlackBoxStack() {
}
function testBlackBoxSource() {
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(aSource => {
return toggleBlackBoxing(gPanel, BLACKBOXME_URL).then(aSource => {
ok(aSource.isBlackBoxed, "The source should be black boxed now.");
is(gFrames.itemCount, 3,
@ -48,15 +48,6 @@ function testBlackBoxSource() {
is(gDebugger.document.querySelectorAll(".dbg-stackframe-black-boxed").length, 1,
"And one of them should be the combined black boxed frames.");
});
getBlackBoxCheckbox(BLACKBOXME_URL).click();
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {

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

@ -32,9 +32,9 @@ function test() {
function blackBoxSources() {
let finished = waitForThreadEvents(gPanel, "blackboxchange", 3);
getBlackBoxCheckbox(EXAMPLE_URL + "code_blackboxing_one.js").click();
getBlackBoxCheckbox(EXAMPLE_URL + "code_blackboxing_two.js").click();
getBlackBoxCheckbox(EXAMPLE_URL + "code_blackboxing_three.js").click();
toggleBlackBoxing(gPanel, EXAMPLE_URL + "code_blackboxing_one.js");
toggleBlackBoxing(gPanel, EXAMPLE_URL + "code_blackboxing_two.js");
toggleBlackBoxing(gPanel, EXAMPLE_URL + "code_blackboxing_three.js");
return finished;
}
@ -52,12 +52,6 @@ function testBlackBoxStack() {
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;

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

@ -21,7 +21,7 @@ function test() {
waitForSourceShown(gPanel, ".coffee")
.then(testSourceEditorShown)
.then(blackBoxSource)
.then(toggleBlackBoxing.bind(null, gPanel))
.then(testBlackBoxMessageShown)
.then(clickStopBlackBoxingButton)
.then(testSourceEditorShownAgain)
@ -37,12 +37,6 @@ function testSourceEditorShown() {
"The first item in the deck should be selected (the source editor).");
}
function blackBoxSource() {
let finished = waitForThreadEvents(gPanel, "blackboxchange");
getAnyBlackBoxCheckbox().click();
return finished;
}
function testBlackBoxMessageShown() {
is(gDeck.selectedIndex, "1",
"The second item in the deck should be selected (the black box message).");
@ -59,11 +53,6 @@ function testSourceEditorShownAgain() {
"The first item in the deck should be selected again (the source editor).");
}
function getAnyBlackBoxCheckbox() {
return gDebugger.document.querySelector(
".side-menu-widget-item .side-menu-widget-item-checkbox");
}
function getEditorBlackboxMessageButton() {
return gDebugger.document.getElementById("black-boxed-message-button");
}

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

@ -2,7 +2,8 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that clicking the black box checkbox doesn't select that source.
* Test that clicking the black box checkbox when paused doesn't re-select the
* currently paused frame's source.
*/
const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
@ -18,35 +19,35 @@ function test() {
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
waitForSourceShown(gPanel, ".js")
waitForSourceAndCaretAndScopes(gPanel, ".html", 21)
.then(testBlackBox)
.then(() => closeDebuggerAndFinish(gPanel))
.then(() => resumeDebuggerThenCloseAndFinish(gPanel))
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.runTest();
});
}
function testBlackBox() {
const selectedUrl = gSources.selectedValue;
const checkbox = getDifferentBlackBoxCheckbox(selectedUrl);
ok(checkbox, "We should be able to grab a different checkbox.");
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(() => {
is(selectedUrl, gSources.selectedValue,
"The same source should still be selected.");
let finished = waitForSourceShown(gPanel, "blackboxme.js").then(() => {
const newSelectedUrl = gSources.selectedValue;
isnot(selectedUrl, newSelectedUrl,
"Should not have the same url selected.");
return toggleBlackBoxing(gPanel).then(() => {
is(gSources.selectedValue, newSelectedUrl,
"The selected source did not change.");
});
});
checkbox.click();
gSources.selectedIndex = 0;
return finished;
}
function getDifferentBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item:not([tooltiptext=\"" + aUrl + "\"]) " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;

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

@ -1,66 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that clicking the black box checkbox when paused doesn't re-select the
* currently paused frame's source.
*/
const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
waitForSourceAndCaretAndScopes(gPanel, ".html", 21)
.then(testBlackBox)
.then(() => resumeDebuggerThenCloseAndFinish(gPanel))
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.runTest();
});
}
function testBlackBox() {
const selectedUrl = gSources.selectedValue;
let finished = waitForSourceShown(gPanel, "blackboxme.js").then(() => {
const newSelectedUrl = gSources.selectedValue;
isnot(selectedUrl, newSelectedUrl,
"Should not have the same url selected.");
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(() => {
is(gSources.selectedValue, newSelectedUrl,
"The selected source did not change.");
});
getBlackBoxCheckbox(newSelectedUrl).click()
return finished;
});
gSources.selectedIndex = 0;
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSources = null;
});

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

@ -46,69 +46,95 @@ function waitForDebuggerSources() {
}
function testBlackBoxSource() {
return cmd("dbg blackbox " + BLACKBOXME_URL).then(() => {
const checkbox = getBlackBoxCheckbox(BLACKBOXME_URL);
ok(!checkbox.checked,
"Should be able to black box a specific source.");
return Task.spawn(function* () {
yield cmd("dbg blackbox " + BLACKBOXME_URL);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(bbButton.checked,
"Should be able to black box a specific source.");
});
}
function testUnBlackBoxSource() {
return cmd("dbg unblackbox " + BLACKBOXME_URL).then(() => {
const checkbox = getBlackBoxCheckbox(BLACKBOXME_URL);
ok(checkbox.checked,
"Should be able to stop black boxing a specific source.");
return Task.spawn(function* () {
yield cmd("dbg unblackbox " + BLACKBOXME_URL);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(!bbButton.checked,
"Should be able to stop black boxing a specific source.");
});
}
function testBlackBoxGlob() {
return cmd("dbg blackbox --glob *blackboxing_t*.js", 2,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]).then(() => {
ok(getBlackBoxCheckbox(BLACKBOXME_URL).checked,
"blackboxme should not be black boxed because it doesn't match the glob.");
ok(getBlackBoxCheckbox(BLACKBOXONE_URL).checked,
"blackbox_one should not be black boxed because it doesn't match the glob.");
return Task.spawn(function* () {
yield cmd("dbg blackbox --glob *blackboxing_t*.js", 2,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]);
ok(!getBlackBoxCheckbox(BLACKBOXTWO_URL).checked,
"blackbox_two should be black boxed because it matches the glob.");
ok(!getBlackBoxCheckbox(BLACKBOXTHREE_URL).checked,
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(!bbButton.checked,
"blackboxme should not be black boxed because it doesn't match the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXONE_URL);
ok(!bbButton.checked,
"blackbox_one should not be black boxed because it doesn't match the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTWO_URL);
ok(bbButton.checked,
"blackbox_two should be black boxed because it matches the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTHREE_URL);
ok(bbButton.checked,
"blackbox_three should be black boxed because it matches the glob.");
});
}
function testUnBlackBoxGlob() {
return cmd("dbg unblackbox --glob *blackboxing_t*.js", 2).then(() => {
ok(getBlackBoxCheckbox(BLACKBOXTWO_URL).checked,
"blackbox_two should be un-black boxed because it matches the glob.");
ok(getBlackBoxCheckbox(BLACKBOXTHREE_URL).checked,
return Task.spawn(function* () {
yield cmd("dbg unblackbox --glob *blackboxing_t*.js", 2);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTWO_URL);
ok(!bbButton.checked,
"blackbox_two should be un-black boxed because it matches the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTHREE_URL);
ok(!bbButton.checked,
"blackbox_three should be un-black boxed because it matches the glob.");
});
}
function testBlackBoxInvert() {
return cmd("dbg blackbox --invert --glob *blackboxing_t*.js", 3,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]).then(() => {
ok(!getBlackBoxCheckbox(BLACKBOXME_URL).checked,
return Task.spawn(function* () {
yield cmd("dbg blackbox --invert --glob *blackboxing_t*.js", 3,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(bbButton.checked,
"blackboxme should be black boxed because it doesn't match the glob.");
ok(!getBlackBoxCheckbox(BLACKBOXONE_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXONE_URL);
ok(bbButton.checked,
"blackbox_one should be black boxed because it doesn't match the glob.");
ok(!getBlackBoxCheckbox(TEST_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, TEST_URL);
ok(bbButton.checked,
"TEST_URL should be black boxed because it doesn't match the glob.");
ok(getBlackBoxCheckbox(BLACKBOXTWO_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTWO_URL);
ok(!bbButton.checked,
"blackbox_two should not be black boxed because it matches the glob.");
ok(getBlackBoxCheckbox(BLACKBOXTHREE_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTHREE_URL);
ok(!bbButton.checked,
"blackbox_three should not be black boxed because it matches the glob.");
});
}
function testUnBlackBoxInvert() {
return cmd("dbg unblackbox --invert --glob *blackboxing_t*.js", 3).then(() => {
ok(getBlackBoxCheckbox(BLACKBOXME_URL).checked,
return Task.spawn(function* () {
yield cmd("dbg unblackbox --invert --glob *blackboxing_t*.js", 3);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(!bbButton.checked,
"blackboxme should be un-black boxed because it does not match the glob.");
ok(getBlackBoxCheckbox(BLACKBOXONE_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXONE_URL);
ok(!bbButton.checked,
"blackbox_one should be un-black boxed because it does not match the glob.");
ok(getBlackBoxCheckbox(TEST_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, TEST_URL);
ok(!bbButton.checked,
"TEST_URL should be un-black boxed because it doesn't match the glob.");
});
}
@ -126,9 +152,3 @@ function cmd(aTyped, aEventRepeat = 1, aOutput = "") {
helpers.audit(gOptions, [{ setup: aTyped, output: aOutput, exec: {} }])
]);
}
function getBlackBoxCheckbox(url) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + url + "\"] " +
".side-menu-widget-item-checkbox");
}

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

@ -22,8 +22,7 @@ function test() {
waitForSourceShown(gPanel, "code_ugly.js")
.then(testSourceIsUgly)
.then(blackBoxSource)
.then(waitForThreadEvents.bind(null, gPanel, "blackboxchange"))
.then(toggleBlackBoxing.bind(null, gPanel))
.then(clickPrettyPrintButton)
.then(testSourceIsStillUgly)
.then(() => closeDebuggerAndFinish(gPanel))
@ -38,12 +37,6 @@ function testSourceIsUgly() {
"The source shouldn't be pretty printed yet.");
}
function blackBoxSource() {
const checkbox = gDebugger.document.querySelector(
".selected .side-menu-widget-item-checkbox");
checkbox.click();
}
function clickPrettyPrintButton() {
gDebugger.document.getElementById("pretty-print").click();
}

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

@ -523,3 +523,29 @@ function resumeDebuggerThenCloseAndFinish(aPanel, aFlags = {}) {
thread.resume(() => closeDebuggerAndFinish(aPanel, aFlags).then(deferred.resolve));
return deferred.promise;
}
function getBlackBoxButton(aPanel) {
return aPanel.panelWin.document.getElementById("black-box");
}
function toggleBlackBoxing(aPanel, aSource = null) {
function clickBlackBoxButton() {
getBlackBoxButton(aPanel).click();
}
const blackBoxChanged = waitForThreadEvents(aPanel, "blackboxchange");
if (aSource) {
aPanel.panelWin.DebuggerView.Sources.selectedValue = aSource;
ensureSourceIs(aPanel, aSource, true).then(clickBlackBoxButton);
} else {
clickBlackBoxButton();
}
return blackBoxChanged;
}
function selectSourceAndGetBlackBoxButton(aPanel, aSource) {
aPanel.panelWin.DebuggerView.Sources.selectedValue = aSource;
return ensureSourceIs(aPanel, aSource, true)
.then(getBlackBoxButton.bind(null, aPanel));
}

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

@ -54,7 +54,14 @@ function submit() {
Services.prefs.setIntPref("devtools.debugger.remote-port", port);
// Initiate the connection
let transport = debuggerSocketConnect(host, port);
let transport;
try {
transport = debuggerSocketConnect(host, port);
} catch(e) {
// Bug 921850: catch rare exception from debuggerSocketConnect
showError("unexpected");
return;
}
gClient = new DebuggerClient(transport);
let delay = Services.prefs.getIntPref("devtools.debugger.remote-timeout");
gConnectionTimeout = setTimeout(handleConnectionTimeout, delay);

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

@ -18,8 +18,9 @@ To confirm the functionality run mochitests for the following components:
The sourceeditor component contains imported CodeMirror tests [3]. Some
tests were commented out because we don't use that functionality within
Firefox (for example Ruby editing mode). Other than that, we don't have
any Mozilla-specific patches applied to CodeMirror itself.
Firefox (for example Ruby editing mode). The search addon (search.js)
was slightly modified to make search UI localizable. Other than that,
we don't have any Mozilla-specific patches applied to CodeMirror itself.
# Addons

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

@ -45,12 +45,16 @@
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query;
}
var queryDialog =
'Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>';
var queryDialog;
function doSearch(cm, rev) {
if (!queryDialog) {
queryDialog = cm.l10n('findCmd.promptMessage') +
' <input type="text" style="width: 10em"/>';
}
var state = getSearchState(cm);
if (state.query) return findNext(cm, rev);
dialog(cm, queryDialog, "Search for:", function(query) {
dialog(cm, queryDialog, cm.l10n('findCmd.promptMessage'), function(query) {
cm.operation(function() {
if (!query || state.query) return;
state.query = parseQuery(query);

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

@ -207,6 +207,10 @@ Editor.prototype = {
cm.on("gutterClick", (cm, line) => this.emit("gutterClick", line));
cm.on("cursorActivity", (cm) => this.emit("cursorActivity"));
win.CodeMirror.defineExtension("l10n", (name) => {
return L10N.GetStringFromName(name);
});
doc.defaultView.controllers.insertControllerAt(0, controller(this, doc.defaultView));
this.container = env;

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

@ -94,6 +94,9 @@ support-files =
test_bug_770099_violation.html
test_bug_770099_violation.html^headers^
testscript.js
test-bug_923281_console_log_filter.html
test-bug_923281_test1.js
test-bug_923281_test2.js
[browser_bug664688_sandbox_update_after_navigation.js]
[browser_bug_638949_copy_link_location.js]
@ -231,3 +234,4 @@ support-files =
[browser_webconsole_property_provider.js]
[browser_webconsole_scratchpad_panel_link.js]
[browser_webconsole_view_source.js]
[browser_webconsole_log_file_filter.js]

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

@ -0,0 +1,80 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the text filter box works to filter based on filenames
// where the logs were generated.
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug_923281_console_log_filter.html";
let hud;
function test() {
addTab(TEST_URI);
browser.addEventListener("load", function onLoad() {
browser.removeEventListener("load", onLoad, true);
openConsole(null, consoleOpened);
}, true);
}
function consoleOpened(aHud) {
hud = aHud;
let console = content.console;
console.log("sentinel log");
waitForMessages({
webconsole: hud,
messages: [{
text: "sentinel log",
category: CATEGORY_WEBDEV,
severity: SEVERITY_LOG
}],
}).then(testLiveFilteringOnSearchStrings);
}
function testLiveFilteringOnSearchStrings() {
is(hud.outputNode.children.length, 4, "number of messages");
setStringFilter("random");
is(countMessageNodes(), 1, "the log nodes not containing string " +
"\"random\" are hidden");
setStringFilter("test2.js");
is(countMessageNodes(), 2, "show only log nodes containing string " +
"\"test2.js\" or log nodes created from files with filename " +
"containing \"test2.js\" as substring.");
setStringFilter("test1");
is(countMessageNodes(), 2, "show only log nodes containing string " +
"\"test1\" or log nodes created from files with filename " +
"containing \"test1\" as substring.");
setStringFilter("");
is(countMessageNodes(), 4, "show all log nodes on setting filter string " +
"as \"\".");
finishTest();
}
function countMessageNodes() {
let outputNode = hud.outputNode;
let messageNodes = outputNode.querySelectorAll(".message");
content.console.log(messageNodes.length);
let displayedMessageNodes = 0;
let view = hud.iframeWindow;
for (let i = 0; i < messageNodes.length; i++) {
let computedStyle = view.getComputedStyle(messageNodes[i], null);
if (computedStyle.display !== "none") {
displayedMessageNodes++;
}
}
return displayedMessageNodes;
}
function setStringFilter(aValue)
{
hud.ui.filterBox.value = aValue;
hud.ui.adjustVisibilityOnSearchStringChange();
}

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

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf-8">
<title>Console test</title>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="text/javascript" src="test-bug_923281_test1.js"></script>
<script type="text/javascript" src="test-bug_923281_test2.js"></script>
</head>
<body></body>
</html>

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

@ -0,0 +1,5 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
console.log("Sample log.");
console.log("This log should be filtered when filtered for test2.js.");

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

@ -0,0 +1,4 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
console.log("This is a random text.");

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

@ -873,7 +873,7 @@ WebConsoleFrame.prototype = {
let node = nodes[i];
// hide nodes that match the strings
let text = node.clipboardText;
let text = node.textContent;
// if the text matches the words in aSearchString...
if (this.stringMatchesFilters(text, searchString)) {

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

@ -41,6 +41,9 @@ Cu.import('resource://gre/modules/NetUtil.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'PrivateBrowsingUtils',
'resource://gre/modules/PrivateBrowsingUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'ShumwayTelemetry',
'resource://shumway/ShumwayTelemetry.jsm');
let appInfo = Cc['@mozilla.org/xre/app-info;1'].getService(Ci.nsIXULAppInfo);
let Svc = {};
XPCOMUtils.defineLazyServiceGetter(Svc, 'mime',
@ -196,6 +199,12 @@ function ChromeActions(url, window, document) {
this.externalComInitialized = false;
this.allowScriptAccess = false;
this.crossdomainRequestsCache = Object.create(null);
this.telemetry = {
startTime: Date.now(),
features: [],
errors: [],
pageIndex: 0
};
}
ChromeActions.prototype = {
@ -235,29 +244,36 @@ ChromeActions.prototype = {
}
// allows downloading from the same origin
var urlPrefix = /^(https?):\/\/([A-Za-z0-9\-_\.\[\]]+)/i.exec(url);
var basePrefix = /^(https?):\/\/([A-Za-z0-9\-_\.\[\]]+)/i.exec(this.url);
if (basePrefix && urlPrefix && basePrefix[0] === urlPrefix[0]) {
var parsedUrl, parsedBaseUrl;
try {
parsedUrl = NetUtil.newURI(url);
} catch (ex) { /* skipping invalid urls */ }
try {
parsedBaseUrl = NetUtil.newURI(this.url);
} catch (ex) { /* skipping invalid urls */ }
if (parsedUrl && parsedBaseUrl &&
parsedUrl.prePath === parsedBaseUrl.prePath) {
return callback({success: true});
}
// additionally using internal whitelist
var whitelist = getStringPref('shumway.whitelist', '');
if (whitelist && urlPrefix) {
if (whitelist && parsedUrl) {
var whitelisted = whitelist.split(',').some(function (i) {
return domainMatches(urlPrefix[2], i);
return domainMatches(parsedUrl.host, i);
});
if (whitelisted) {
return callback({success: true});
}
}
if (!checkPolicyFile || !urlPrefix || !basePrefix) {
if (!checkPolicyFile || !parsedUrl || !parsedBaseUrl) {
return callback({success: false});
}
// we can request crossdomain.xml
fetchPolicyFile(urlPrefix[0] + '/crossdomain.xml', this.crossdomainRequestsCache,
fetchPolicyFile(parsedUrl.prePath + '/crossdomain.xml', this.crossdomainRequestsCache,
function (policy, error) {
if (!policy || policy.siteControl === 'none') {
@ -266,8 +282,8 @@ ChromeActions.prototype = {
// TODO assuming master-only, there are also 'by-content-type', 'all', etc.
var allowed = policy.allowAccessFrom.some(function (i) {
return domainMatches(basePrefix[2], i.domain) &&
(!i.secure || basePrefix[1].toLowerCase() === 'https');
return domainMatches(parsedBaseUrl.host, i.domain) &&
(!i.secure || parsedBaseUrl.scheme.toLowerCase() === 'https');
});
return callback({success: allowed});
}.bind(this));
@ -334,12 +350,14 @@ ChromeActions.prototype = {
}
});
},
fallback: function() {
fallback: function(automatic) {
var obj = this.window.frameElement;
var doc = obj.ownerDocument;
var e = doc.createEvent("CustomEvent");
e.initCustomEvent("MozPlayPlugin", true, true, null);
obj.dispatchEvent(e);
ShumwayTelemetry.onFallback(!automatic);
},
setClipboard: function (data) {
if (typeof data !== 'string' ||
@ -365,6 +383,45 @@ ChromeActions.prototype = {
ActivationQueue.activateNext();
}
},
reportTelemetry: function (data) {
var topic = data.topic;
switch (topic) {
case 'firstFrame':
var time = Date.now() - this.telemetry.startTime;
ShumwayTelemetry.onFirstFrame(time);
break;
case 'parseInfo':
ShumwayTelemetry.onParseInfo({
parseTime: +data.parseTime,
size: +data.bytesTotal,
swfVersion: data.swfVersion|0,
frameRate: +data.frameRate,
width: data.width|0,
height: data.height|0,
bannerType: data.bannerType|0,
isAvm2: !!data.isAvm2
});
break;
case 'feature':
var featureType = data.feature|0;
var MIN_FEATURE_TYPE = 0, MAX_FEATURE_TYPE = 999;
if (featureType >= MIN_FEATURE_TYPE && featureType <= MAX_FEATURE_TYPE &&
!this.telemetry.features[featureType]) {
this.telemetry.features[featureType] = true; // record only one feature per SWF
ShumwayTelemetry.onFeature(featureType);
}
break;
case 'error':
var errorType = data.error|0;
var MIN_ERROR_TYPE = 0, MAX_ERROR_TYPE = 2;
if (errorType >= MIN_ERROR_TYPE && errorType <= MAX_ERROR_TYPE &&
!this.telemetry.errors[errorType]) {
this.telemetry.errors[errorType] = true; // record only one report per SWF
ShumwayTelemetry.onError(errorType);
}
break;
}
},
externalCom: function (data) {
if (!this.allowScriptAccess)
return;
@ -452,6 +509,14 @@ var ActivationQueue = {
this.activateNext();
}
},
findLastOnPage: function ActivationQueue_findLastOnPage(baseUrl) {
for (var i = this.nonActive.length - 1; i >= 0; i--) {
if (this.nonActive[i].baseUrl === baseUrl) {
return this.nonActive[i];
}
}
return null;
},
activateNext: function ActivationQueue_activateNext() {
function weightInstance(actions) {
// set of heuristics for find the most important instance to load
@ -814,10 +879,21 @@ ShumwayStreamConverterBase.prototype = {
domWindow.document,
converter.getUrlHint(originalURI));
if (!isShumwayEnabledFor(actions)) {
actions.fallback();
actions.fallback(true);
return;
}
// Report telemetry on amount of swfs on the page
if (actions.isOverlay) {
// Looking for last actions with same baseUrl
var prevPageActions = ActivationQueue.findLastOnPage(actions.baseUrl);
var pageIndex = !prevPageActions ? 1 : (prevPageActions.telemetry.pageIndex + 1);
actions.telemetry.pageIndex = pageIndex;
ShumwayTelemetry.onPageIndex(pageIndex);
} else {
ShumwayTelemetry.onPageIndex(0);
}
actions.activationCallback = function(domWindow, isSimpleMode) {
delete this.activationCallback;
activateShumwayScripts(domWindow, isSimpleMode);

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

@ -0,0 +1,73 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2013 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* jshint esnext:true */
'use strict';
this.EXPORTED_SYMBOLS = ['ShumwayTelemetry'];
const Cu = Components.utils;
Cu.import('resource://gre/modules/Services.jsm');
const BANNER_SIZES = [
"88x31", "120x60", "120x90", "120x240", "120x600", "125x125", "160x600",
"180x150", "234x60", "240x400", "250x250", "300x100", "300x250", "300x600",
"300x1050", "336x280", "468x60", "550x480", "720x100", "728x90", "970x90",
"970x250"];
function getBannerType(width, height) {
return BANNER_SIZES.indexOf(width + 'x' + height) + 1;
}
this.ShumwayTelemetry = {
onFirstFrame: function (timeToDisplay) {
var histogram = Services.telemetry.getHistogramById("SHUMWAY_TIME_TO_VIEW_MS");
histogram.add(timeToDisplay);
},
onParseInfo: function (parseInfo) {
var histogram = Services.telemetry.getHistogramById("SHUMWAY_PARSING_MS");
histogram.add(parseInfo.parseTime);
var histogram = Services.telemetry.getHistogramById("SHUMWAY_SWF_SIZE_KB");
histogram.add(parseInfo.size / 1024);
var histogram = Services.telemetry.getHistogramById("SHUMWAY_SWF_VERSION");
histogram.add(parseInfo.swfVersion);
var histogram = Services.telemetry.getHistogramById("SHUMWAY_SWF_FRAME_RATE");
histogram.add(parseInfo.frameRate);
var histogram = Services.telemetry.getHistogramById("SHUMWAY_SWF_AREA");
histogram.add(parseInfo.width * parseInfo.height);
var histogram = Services.telemetry.getHistogramById("SHUMWAY_SWF_BANNER");
histogram.add(getBannerType(parseInfo.width, parseInfo.height));
var histogram = Services.telemetry.getHistogramById("SHUMWAY_SWF_AVM2");
histogram.add(parseInfo.isAvm2);
},
onError: function (errorType) {
var histogram = Services.telemetry.getHistogramById("SHUMWAY_ERROR");
histogram.add(errorType);
},
onPageIndex: function (pageIndex) {
var histogram = Services.telemetry.getHistogramById("SHUMWAY_SWF_INDEX_ON_PAGE");
histogram.add(pageIndex);
},
onFeature: function (featureType) {
var histogram = Services.telemetry.getHistogramById("SHUMWAY_FEATURE_USED");
histogram.add(featureType);
},
onFallback: function (userAction) {
var histogram = Services.telemetry.getHistogramById("SHUMWAY_FALLBACK");
histogram.add(userAction);
}
};

Двоичный файл не отображается.

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

@ -223,6 +223,9 @@ var Promise = function PromiseClosure() {
subject.subpromisesReason = reason;
var subpromises = subject.subpromises;
if (!subpromises) {
if (!true) {
console.warn(reason);
}
return;
}
for (var i = 0; i < subpromises.length; i++) {
@ -435,6 +438,18 @@ QuadTree.prototype._subdivide = function () {
this.nodes[2] = new QuadTree(this.x, midY, halfWidth, halfHeight, level);
this.nodes[3] = new QuadTree(midX, midY, halfWidth, halfHeight, level);
};
var EXTERNAL_INTERFACE_FEATURE = 1;
var CLIPBOARD_FEATURE = 2;
var SHAREDOBJECT_FEATURE = 3;
var VIDEO_FEATURE = 4;
var SOUND_FEATURE = 5;
var NETCONNECTION_FEATURE = 6;
if (!this.performance) {
this.performance = {};
}
if (!this.performance.now) {
this.performance.now = Date.now;
}
var create = Object.create;
var defineProperty = Object.defineProperty;
var keys = Object.keys;
@ -909,9 +924,10 @@ function defineFont(tag, dictionary) {
indices
]);
}
var ascent = Math.ceil(tag.ascent / 20) || 1024;
var descent = -Math.ceil(tag.descent / 20) || 0;
var leading = Math.floor(tag.leading / 20) || 0;
var resolution = tag.resolution || 1;
var ascent = Math.ceil(tag.ascent / resolution) || 1024;
var descent = -Math.ceil(tag.descent / resolution) | 0;
var leading = tag.leading / resolution | 0;
tables['OS/2'] = '\0\x01\0\0' + toString16(tag.bold ? 700 : 400) + '\0\x05' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0\0\0\0\0\0\0\0\0' + '\0\0\0\0' + '\0\0\0\0' + '\0\0\0\0' + '\0\0\0\0' + 'ALF ' + toString16((tag.italic ? 1 : 0) | (tag.bold ? 32 : 0)) + toString16(codes[0]) + toString16(codes[codes.length - 1]) + toString16(ascent) + toString16(descent) + toString16(leading) + toString16(ascent) + toString16(-descent) + '\0\0\0\0' + '\0\0\0\0';
;
var startCount = '';
@ -942,7 +958,6 @@ function defineFont(tag, dictionary) {
;
var glyf = '\0\x01\0\0\0\0\0\0\0\0\0\0\0\x001\0';
var loca = '\0\0';
var resolution = tag.resolution || 1;
var offset = 16;
var maxPoints = 0;
var xMins = [];
@ -1067,10 +1082,9 @@ function defineFont(tag, dictionary) {
}
loca += toString16(offset / 2);
tables['glyf'] = glyf;
tables['head'] = '\0\x01\0\0\0\x01\0\0\0\0\0\0_\x0f<\xf5\0\v\x04\0\0\0\0\0' + toString32(+new Date()) + '\0\0\0\0' + toString32(+new Date()) + toString16(min.apply(null, xMins)) + toString16(min.apply(null, yMins)) + toString16(max.apply(null, xMaxs)) + toString16(max.apply(null, yMaxs)) + toString16((tag.italic ? 2 : 0) | (tag.bold ? 1 : 0)) + '\0\b' + '\0\x02' + '\0\0' + '\0\0';
tables['head'] = '\0\x01\0\0\0\x01\0\0\0\0\0\0_\x0f<\xf5\0\v\x04\0\0\0\0\0' + toString32(Date.now()) + '\0\0\0\0' + toString32(Date.now()) + toString16(min.apply(null, xMins)) + toString16(min.apply(null, yMins)) + toString16(max.apply(null, xMaxs)) + toString16(max.apply(null, yMaxs)) + toString16((tag.italic ? 2 : 0) | (tag.bold ? 1 : 0)) + '\0\b' + '\0\x02' + '\0\0' + '\0\0';
;
var advance = tag.advance;
var resolution = tag.resolution || 1;
tables['hhea'] = '\0\x01\0\0' + toString16(ascent) + toString16(descent) + toString16(leading) + toString16(advance ? max.apply(null, advance) : 1024) + '\0\0' + '\0\0' + '\x03\xb8' + '\0\x01' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + '\0\0' + toString16(glyphCount + 1);
;
var hmtx = '\0\0\0\0';
@ -1147,7 +1161,7 @@ function defineFont(tag, dictionary) {
var unitPerEm = 1024;
var metrics = {
ascent: ascent / unitPerEm,
descent: descent / unitPerEm,
descent: -descent / unitPerEm,
leading: leading / unitPerEm
};
return {
@ -1157,6 +1171,8 @@ function defineFont(tag, dictionary) {
uniqueName: psName + uniqueId,
codes: codes,
metrics: metrics,
bold: tag.bold === 1,
italic: tag.italic === 1,
data: otf
};
}
@ -1234,8 +1250,8 @@ function defineLabel(tag, dictionary) {
m.b,
m.c,
m.d,
m.tx,
m.ty
m.tx / 20,
m.ty / 20
].join(',') + ')',
'c.scale(0.05, 0.05)'
];
@ -1727,9 +1743,8 @@ var SHAPE_CURVE_TO = 3;
var SHAPE_WIDE_MOVE_TO = 4;
var SHAPE_WIDE_LINE_TO = 5;
var SHAPE_CUBIC_CURVE_TO = 6;
var SHAPE_ROUND_CORNER = 7;
var SHAPE_CIRCLE = 8;
var SHAPE_ELLIPSE = 9;
var SHAPE_CIRCLE = 7;
var SHAPE_ELLIPSE = 8;
function ShapePath(fillStyle, lineStyle, commandsCount, dataLength, isMorph) {
this.fillStyle = fillStyle;
this.lineStyle = lineStyle;
@ -1778,10 +1793,6 @@ ShapePath.prototype = {
this.commands.push(SHAPE_CIRCLE);
this.data.push(x, y, radius);
},
drawRoundCorner: function (cornerX, cornerY, curveEndX, curveEndY, radiusX, radiusY) {
this.commands.push(SHAPE_ROUND_CORNER);
this.data.push(cornerX, cornerY, curveEndX, curveEndY, radiusX, radiusY);
},
ellipse: function (x, y, radiusX, radiusY) {
this.commands.push(SHAPE_ELLIPSE);
this.data.push(x, y, radiusX, radiusY);
@ -1823,9 +1834,6 @@ ShapePath.prototype = {
case SHAPE_CUBIC_CURVE_TO:
ctx.bezierCurveTo(data[k++] / 20, data[k++] / 20, data[k++] / 20, data[k++] / 20, data[k++] / 20, data[k++] / 20);
break;
case SHAPE_ROUND_CORNER:
ctx.arcTo(data[k++] / 20, data[k++] / 20, data[k++] / 20, data[k++] / 20, data[k++] / 20, data[k++] / 20);
break;
case SHAPE_CIRCLE:
if (formOpen) {
ctx.lineTo(formOpenX, formOpenY);
@ -1888,6 +1896,7 @@ ShapePath.prototype = {
var fillStyle = this.fillStyle;
if (fillStyle) {
colorTransform.setFillStyle(ctx, fillStyle.style);
ctx.imageSmoothingEnabled = ctx.mozImageSmoothingEnabled = fillStyle.smooth;
var m = fillStyle.transform;
ctx.save();
colorTransform.setAlpha(ctx);
@ -2017,33 +2026,6 @@ ShapePath.prototype = {
}
}
break;
case SHAPE_ROUND_CORNER:
cpX = data[dataIndex++];
cpY = data[dataIndex++];
toX = data[dataIndex++];
toY = data[dataIndex++];
rX = data[dataIndex++];
rY = data[dataIndex++];
if (toY > y === fromY > y || fromX < x && toX < x) {
break;
}
if (fromX >= x && toX >= x) {
inside = !inside;
break;
}
if (toX > fromX === toY > fromY) {
cp2X = fromX;
cp2Y = toY;
} else {
cp2X = toX;
cp2Y = fromY;
}
localX = x - cp2X;
localY = y - cp2Y;
if (localX * localX / (rX * rX) + localY * localY / (rY * rY) <= 1 !== localX <= 0) {
inside = !inside;
}
break;
case SHAPE_CIRCLE:
toX = data[dataIndex++];
toY = data[dataIndex++];
@ -2206,36 +2188,6 @@ ShapePath.prototype = {
}
}
break;
case SHAPE_ROUND_CORNER:
cpX = data[dataIndex++];
cpY = data[dataIndex++];
toX = data[dataIndex++];
toY = data[dataIndex++];
rX = data[dataIndex++];
rY = data[dataIndex++];
if (maxX < fromX && maxX < toX || minX > fromX && minX > toX || maxY < fromY && maxY < toY || minY > fromY && minY > toY) {
break;
}
if (toX > fromX === toY > fromY) {
cp2X = fromX;
cp2Y = toY;
} else {
cp2X = toX;
cp2Y = fromY;
}
localX = Math.abs(x - cp2X);
localY = Math.abs(y - cp2Y);
localX -= halfWidth;
localY -= halfWidth;
if (localX * localX / (rX * rX) + localY * localY / (rY * rY) > 1) {
break;
}
localX += width;
localY += width;
if (localX * localX / (rX * rX) + localY * localY / (rY * rY) > 1) {
return true;
}
break;
case SHAPE_CIRCLE:
cpX = data[dataIndex++];
cpY = data[dataIndex++];
@ -2297,7 +2249,7 @@ ShapePath.prototype = {
var data = this.data;
var length = commands.length;
var bounds;
if (commands[0] === SHAPE_MOVE_TO || commands[0] > SHAPE_ROUND_CORNER) {
if (commands[0] === SHAPE_MOVE_TO || commands[0] > SHAPE_CUBIC_CURVE_TO) {
bounds = {
xMin: data[0],
yMin: data[1]
@ -2368,9 +2320,6 @@ ShapePath.prototype = {
}
}
break;
case SHAPE_ROUND_CORNER:
dataIndex += 6;
break;
case SHAPE_CIRCLE:
toX = data[dataIndex++];
toY = data[dataIndex++];
@ -2648,7 +2597,7 @@ function finishShapePaths(paths, dictionary) {
}
}
var inWorker = typeof window === 'undefined';
var factoryCtx = !inWorker ? document.createElement('canvas').getContext('kanvas-2d') : null;
var factoryCtx = !inWorker ? document.createElement('canvas').getContext('2d') : null;
function buildLinearGradientFactory(colorStops) {
var defaultGradient = factoryCtx.createLinearGradient(-1, 0, 1, 0);
for (var i = 0; i < colorStops.length; i++) {
@ -3494,8 +3443,23 @@ var LoaderDefinition = function () {
},
oncomplete: function (result) {
commitData(result);
var stats;
if (typeof result.swfVersion === 'number') {
var bbox = result.bbox;
stats = {
topic: 'parseInfo',
parseTime: result.parseTime,
bytesTotal: result.bytesTotal,
swfVersion: result.swfVersion,
frameRate: result.frameRate,
width: (bbox.xMax - bbox.xMin) / 20,
height: (bbox.yMax - bbox.yMin) / 20,
isAvm2: !(!result.fileAttributes.doAbc)
};
}
commitData({
command: 'complete'
command: 'complete',
stats: stats
});
}
};
@ -3610,6 +3574,10 @@ var LoaderDefinition = function () {
Promise.when(frameConstructed, this._lastPromise).then(function () {
this.contentLoaderInfo._dispatchEvent('complete');
}.bind(this));
var stats = data.stats;
if (stats) {
TelemetryService.reportTelemetry(stats);
}
this._worker && this._worker.terminate();
break;
case 'empty':
@ -4007,6 +3975,8 @@ var LoaderDefinition = function () {
props.name = symbol.name;
props.uniqueName = symbol.uniqueName;
props.charset = symbol.charset;
props.bold = symbol.bold;
props.italic = symbol.italic;
props.metrics = symbol.metrics;
this._registerFont(className, props);
break;
@ -4179,6 +4149,9 @@ var LoaderDefinition = function () {
this._setup();
},
_load: function (request, checkPolicyFile, applicationDomain, securityDomain, deblockingFilter) {
if (!isWorker && flash.net.URLRequest.class.isInstanceOf(request)) {
this._contentLoaderInfo._url = request._url;
}
if (!isWorker && WORKERS_ENABLED) {
var loader = this;
var worker = loader._worker = new Worker(SHUMWAY_ROOT + LOADER_PATH);
@ -4266,7 +4239,7 @@ var LoaderDefinition = function () {
def._load(bytes.a);
},
_unload: function _unload(halt, gc) {
notImplemented('Loader._unload');
somewhatImplemented('Loader._unload, do we even need to do anything here?');
},
_close: function _close() {
somewhatImplemented('Loader._close');
@ -4926,177 +4899,13 @@ var tagHandler = function (global) {
cxform($bytes, $stream, $31, swfVersion, tagCode);
}
if (hasFilters) {
$29.filterCount = readUi8($bytes, $stream);
var $32 = $29.filters = {};
var type = $32.type = readUi8($bytes, $stream);
switch (type) {
case 0:
if (type === 4 || type === 7) {
count = readUi8($bytes, $stream);
} else {
count = 1;
}
var $33 = $32.colors = [];
var $34 = count;
while ($34--) {
var $35 = {};
rgba($bytes, $stream, $35, swfVersion, tagCode);
$33.push($35);
}
if (type === 3) {
var $36 = $32.higlightColor = {};
rgba($bytes, $stream, $36, swfVersion, tagCode);
}
if (type === 4 || type === 7) {
var $37 = $32.ratios = [];
var $38 = count;
while ($38--) {
$37.push(readUi8($bytes, $stream));
}
}
$32.blurX = readFixed($bytes, $stream);
$32.blurY = readFixed($bytes, $stream);
if (type !== 2) {
$32.angle = readFixed($bytes, $stream);
$32.distance = readFixed($bytes, $stream);
}
$32.strength = readFixed8($bytes, $stream);
$32.innerShadow = readUb($bytes, $stream, 1);
$32.knockout = readUb($bytes, $stream, 1);
$32.compositeSource = readUb($bytes, $stream, 1);
if (type === 3) {
$32.onTop = readUb($bytes, $stream, 1);
} else {
var reserved = readUb($bytes, $stream, 1);
}
if (type === 4 || type === 7) {
$32.passes = readUb($bytes, $stream, 4);
} else {
var reserved = readUb($bytes, $stream, 4);
}
break;
case 1:
$32.blurX = readFixed($bytes, $stream);
$32.blurY = readFixed($bytes, $stream);
$32.passes = readUb($bytes, $stream, 5);
var reserved = readUb($bytes, $stream, 3);
break;
case 2:
case 3:
case 4:
if (type === 4 || type === 7) {
count = readUi8($bytes, $stream);
} else {
count = 1;
}
var $39 = $32.colors = [];
var $40 = count;
while ($40--) {
var $41 = {};
rgba($bytes, $stream, $41, swfVersion, tagCode);
$39.push($41);
}
if (type === 3) {
var $42 = $32.higlightColor = {};
rgba($bytes, $stream, $42, swfVersion, tagCode);
}
if (type === 4 || type === 7) {
var $43 = $32.ratios = [];
var $44 = count;
while ($44--) {
$43.push(readUi8($bytes, $stream));
}
}
$32.blurX = readFixed($bytes, $stream);
$32.blurY = readFixed($bytes, $stream);
if (type !== 2) {
$32.angle = readFixed($bytes, $stream);
$32.distance = readFixed($bytes, $stream);
}
$32.strength = readFixed8($bytes, $stream);
$32.innerShadow = readUb($bytes, $stream, 1);
$32.knockout = readUb($bytes, $stream, 1);
$32.compositeSource = readUb($bytes, $stream, 1);
if (type === 3) {
$32.onTop = readUb($bytes, $stream, 1);
} else {
var reserved = readUb($bytes, $stream, 1);
}
if (type === 4 || type === 7) {
$32.passes = readUb($bytes, $stream, 4);
} else {
var reserved = readUb($bytes, $stream, 4);
}
break;
case 5:
var columns = $32.columns = readUi8($bytes, $stream);
var rows = $32.rows = readUi8($bytes, $stream);
$32.divisor = readFloat($bytes, $stream);
$32.bias = readFloat($bytes, $stream);
var $45 = $32.weights = [];
var $46 = columns * rows;
while ($46--) {
$45.push(readFloat($bytes, $stream));
}
var $47 = $32.defaultColor = {};
rgba($bytes, $stream, $47, swfVersion, tagCode);
var reserved = readUb($bytes, $stream, 6);
$32.clamp = readUb($bytes, $stream, 1);
$32.preserveAlpha = readUb($bytes, $stream, 1);
break;
case 6:
var $48 = $32.matrix = [];
var $49 = 20;
while ($49--) {
$48.push(readFloat($bytes, $stream));
}
break;
case 7:
if (type === 4 || type === 7) {
count = readUi8($bytes, $stream);
} else {
count = 1;
}
var $50 = $32.colors = [];
var $51 = count;
while ($51--) {
var $52 = {};
rgba($bytes, $stream, $52, swfVersion, tagCode);
$50.push($52);
}
if (type === 3) {
var $53 = $32.higlightColor = {};
rgba($bytes, $stream, $53, swfVersion, tagCode);
}
if (type === 4 || type === 7) {
var $54 = $32.ratios = [];
var $55 = count;
while ($55--) {
$54.push(readUi8($bytes, $stream));
}
}
$32.blurX = readFixed($bytes, $stream);
$32.blurY = readFixed($bytes, $stream);
if (type !== 2) {
$32.angle = readFixed($bytes, $stream);
$32.distance = readFixed($bytes, $stream);
}
$32.strength = readFixed8($bytes, $stream);
$32.innerShadow = readUb($bytes, $stream, 1);
$32.knockout = readUb($bytes, $stream, 1);
$32.compositeSource = readUb($bytes, $stream, 1);
if (type === 3) {
$32.onTop = readUb($bytes, $stream, 1);
} else {
var reserved = readUb($bytes, $stream, 1);
}
if (type === 4 || type === 7) {
$32.passes = readUb($bytes, $stream, 4);
} else {
var reserved = readUb($bytes, $stream, 4);
}
break;
default:
var count = readUi8($bytes, $stream);
var $2 = $.filters = [];
var $3 = count;
while ($3--) {
var $4 = {};
anyFilter($bytes, $stream, $4, swfVersion, tagCode);
$2.push($4);
}
}
if (blend) {
@ -6438,7 +6247,8 @@ CompressedPipe.prototype = {
};
function BodyParser(swfVersion, length, options) {
this.swf = {
swfVersion: swfVersion
swfVersion: swfVersion,
parseTime: 0
};
this.buffer = new HeadTailBuffer(32768);
this.initialize = true;
@ -6489,7 +6299,9 @@ BodyParser.prototype = {
swf.bytesLoaded = progressInfo.bytesLoaded;
swf.bytesTotal = progressInfo.bytesTotal;
}
var readStartTime = performance.now();
readTags(swf, stream, swfVersion, options.onprogress);
swf.parseTime += performance.now() - readStartTime;
var read = stream.pos;
buffer.removeHead(read);
this.totalRead += read;

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -1 +1 @@
0.7.352
0.7.501

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

@ -159,6 +159,12 @@ window.addEventListener("message", function handlerMessage(e) {
}
}, true);
var TelemetryService = {
reportTelemetry: function (data) {
FirefoxCom.request('reportTelemetry', data, null);
}
};
var FileLoadingService = {
get baseUrl() { return movieUrl; },
nextSessionId: 1, // 0 - is reserved
@ -247,6 +253,8 @@ function frame(e) {
// marking that movie is started
document.body.classList.add("started");
TelemetryService.reportTelemetry({topic: "firstFrame"});
// skipping frame 0
initializeFrameControl = false;
return;

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

@ -509,6 +509,8 @@
@BINPATH@/components/ContactManager.manifest
@BINPATH@/components/PhoneNumberService.js
@BINPATH@/components/PhoneNumberService.manifest
@BINPATH@/components/NotificationStorage.js
@BINPATH@/components/NotificationStorage.manifest
@BINPATH@/components/AlarmsManager.js
@BINPATH@/components/AlarmsManager.manifest
@BINPATH@/components/Push.js
@ -519,9 +521,6 @@
@BINPATH@/components/TCPSocketParentIntermediary.js
@BINPATH@/components/TCPSocket.manifest
@BINPATH@/components/AppProtocolHandler.js
@BINPATH@/components/AppProtocolHandler.manifest
@BINPATH@/components/Payment.js
@BINPATH@/components/PaymentFlowInfo.js
@BINPATH@/components/PaymentRequestInfo.js

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

@ -33,8 +33,12 @@
- the button that opens up an options context menu for the debugger UI. -->
<!ENTITY debuggerUI.optsButton.tooltip "Debugger Options">
<!-- LOCALIZATION NOTE (debuggerUI.sources.blackBoxTooltip): This is the tooltip
- for the button that black boxes the selected source. -->
<!ENTITY debuggerUI.sources.blackBoxTooltip "Toggle Black Boxing">
<!-- LOCALIZATION NOTE (debuggerUI.sources.prettyPrint): This is the tooltip for the
button that pretty prints the selected source. -->
- button that pretty prints the selected source. -->
<!ENTITY debuggerUI.sources.prettyPrint "Prettify Source">
<!-- LOCALIZATION NOTE (debuggerUI.pauseExceptions): This is the label for the

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

@ -29,9 +29,9 @@ EXTRA_PP_COMPONENTS += [
'AboutRedirector.js',
'BrowserCLH.js',
'BrowserStartup.js',
'components.manifest',
'DirectoryProvider.js',
'HelperAppDialog.js',
'SessionStore.js',
'Sidebar.js',
'components.manifest',
]

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

@ -5,9 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_JS_MODULES += [
'colorUtils.jsm',
'ContentUtil.jsm',
'CrossSlide.jsm',
'View.jsm',
'colorUtils.jsm',
]

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

@ -36,15 +36,17 @@ pref("prompts.tab_modal.enabled", true);
pref("layers.offmainthreadcomposition.enabled", true);
pref("layers.async-pan-zoom.enabled", true);
pref("layers.componentalpha.enabled", false);
pref("gfx.azpc.touch_start_tolerance", "0.1"); // dpi * tolerance = pixel threshold
pref("gfx.azpc.pan_repaint_interval", "50"); // prefer 20 fps
pref("gfx.azpc.fling_repaint_interval", "50"); // prefer 20 fps
pref("gfx.axis.fling_friction", "0.002");
pref("gfx.axis.fling_stopped_threshold", "0.2");
// Prefs to control the async pan/zoom behaviour
pref("apz.touch_start_tolerance", "0.1"); // dpi * tolerance = pixel threshold
pref("apz.pan_repaint_interval", "50"); // prefer 20 fps
pref("apz.fling_repaint_interval", "50"); // prefer 20 fps
pref("apz.fling_friction", "0.002");
pref("apz.fling_stopped_threshold", "0.2");
// 0 = free, 1 = standard, 2 = sticky
pref("apzc.axis_lock_mode", 2);
pref("apzc.cross_slide.enabled", true);
pref("apz.axis_lock_mode", 2);
pref("apz.cross_slide.enabled", true);
// Enable Microsoft TSF support by default for imes.
pref("intl.enable_tsf_support", true);

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

@ -87,7 +87,7 @@ IsImmersiveProcessRunning(const wchar_t *processName)
PROCESSENTRY32W entry;
entry.dwSize = sizeof(PROCESSENTRY32W);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (Process32First(snapshot, &entry)) {
while (!exists && Process32Next(snapshot, &entry)) {

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

@ -630,7 +630,8 @@ private:
static HRESULT
PrepareActivationManager(CComPtr<IApplicationActivationManager> &activateMgr)
{
HRESULT hr = activateMgr.CoCreateInstance(CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER);
HRESULT hr = activateMgr.CoCreateInstance(CLSID_ApplicationActivationManager,
nullptr, CLSCTX_LOCAL_SERVER);
if (FAILED(hr)) {
Log(L"CoCreateInstance failed, launching on desktop.");
return E_FAIL;
@ -654,7 +655,7 @@ DelayedExecuteThread(LPVOID param)
bool &bRequestMet(*(bool*)param);
AutoSetRequestMet asrm(&bRequestMet);
CoInitialize(NULL);
CoInitialize(nullptr);
CComPtr<IApplicationActivationManager> activateMgr;
if (FAILED(PrepareActivationManager(activateMgr))) {
@ -698,7 +699,8 @@ IFACEMETHODIMP CExecuteCommandVerb::Execute()
}
if (mIsRestartMetroRequest) {
HANDLE thread = CreateThread(NULL, 0, DelayedExecuteThread, &mRequestMet, 0, NULL);
HANDLE thread = CreateThread(nullptr, 0, DelayedExecuteThread,
&mRequestMet, 0, nullptr);
CloseHandle(thread);
return S_OK;
}

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

@ -10,14 +10,14 @@ EXTRA_JS_MODULES += [
'BrowserNewTabPreloader.jsm',
'ContentClick.jsm',
'NetworkPrioritizer.jsm',
'offlineAppCache.jsm',
'openLocationLastURL.jsm',
'SharedFrame.jsm',
'SignInToWebsite.jsm',
'SitePermissions.jsm',
'Social.jsm',
'TabCrashReporter.jsm',
'UITour.jsm',
'offlineAppCache.jsm',
'openLocationLastURL.jsm',
'webappsUI.jsm',
'webrtcUI.jsm',
]

Двоичные данные
browser/themes/linux/devtools/debugger-blackbox.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1005 B

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

@ -22,56 +22,29 @@
font-weight: bold;
}
#sources .side-menu-widget-item-checkbox {
-moz-appearance: none;
opacity: 0;
transition: opacity .15s ease 0s;
#black-box {
list-style-image: url(debugger-blackbox.png);
-moz-image-region: rect(0px,16px,16px,0px);
}
/* Only show the checkbox when the source is hovered over, is selected, or if it
* is not checked. */
#sources .side-menu-widget-item:hover > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item-checkbox:not([checked]) {
opacity: 1;
transition: opacity .15s ease 0s;
#black-box[checked] {
-moz-image-region: rect(0px,32px,16px,16px);
}
#sources .side-menu-widget-item-checkbox > .checkbox-spacer-box {
-moz-appearance: none;
}
#sources .side-menu-widget-item-checkbox > .checkbox-spacer-box > .checkbox-check {
-moz-appearance: none;
background: none;
background-image: url(itemToggle.png);
background-repeat: no-repeat;
background-clip: content-box;
background-size: 32px 16px;
background-position: -16px 0;
width: 16px;
height: 16px;
border: 0;
}
#sources .side-menu-widget-item-checkbox[checked] > .checkbox-spacer-box > .checkbox-check {
background-position: 0 0;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
#sources .black-boxed {
color: #888;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
#sources .black-boxed > .dbg-breakpoint {
display: none;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
background-image: none;
box-shadow: inset -1px 0 0 #222426;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
background-image: none;
box-shadow: inset 1px 0 0 #222426;
}
@ -147,7 +120,7 @@
/* Sources and breakpoints view */
.dbg-breakpoint {
-moz-margin-start: -14px;
-moz-margin-start: 4px;
}
.dbg-breakpoint-line {
@ -402,7 +375,8 @@
list-style-image: url("chrome://browser/skin/devtools/debugger-step-out.png");
}
#debugger-controls > toolbarbutton {
#debugger-controls > toolbarbutton,
#sources-controls > toolbarbutton {
margin: 0;
box-shadow: none;
border-radius: 0;
@ -411,11 +385,13 @@
outline-offset: -3px;
}
#debugger-controls > toolbarbutton:last-of-type {
#debugger-controls > toolbarbutton:last-of-type,
#sources-controls > toolbarbutton:last-of-type {
-moz-border-end-width: 0;
}
#debugger-controls {
#debugger-controls,
#sources-controls {
box-shadow: 0 1px 0 hsla(210,16%,76%,.15) inset,
0 0 0 1px hsla(210,16%,76%,.15) inset,
0 1px 0 hsla(210,16%,76%,.15);

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

@ -195,6 +195,7 @@ browser.jar:
skin/classic/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)
skin/classic/browser/devtools/responsive-vertical-resizer.png (devtools/responsive-vertical-resizer.png)
skin/classic/browser/devtools/responsive-horizontal-resizer.png (devtools/responsive-horizontal-resizer.png)

Двоичные данные
browser/themes/osx/devtools/debugger-blackbox.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1005 B

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

@ -24,52 +24,29 @@
font-weight: bold;
}
#sources .side-menu-widget-item-checkbox {
-moz-appearance: none;
opacity: 0;
transition: opacity .15s ease-out 0s;
#black-box {
list-style-image: url(debugger-blackbox.png);
-moz-image-region: rect(0px,16px,16px,0px);
}
/* Only show the checkbox when the source is hovered over, is selected, or if it
* is not checked. */
#sources .side-menu-widget-item:hover > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item-checkbox:not([checked]) {
opacity: 1;
transition: opacity .15s ease-out 0s;
#black-box[checked] {
-moz-image-region: rect(0px,32px,16px,16px);
}
#sources .side-menu-widget-item-checkbox > .checkbox-check {
-moz-appearance: none;
background: none;
background-image: url(itemToggle.png);
background-repeat: no-repeat;
background-clip: content-box;
background-size: 32px 16px;
background-position: -16px 0;
width: 16px;
height: 16px;
border: 0;
}
#sources .side-menu-widget-item-checkbox[checked] > .checkbox-check {
background-position: 0 0;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
#sources .black-boxed {
color: #888;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
#sources .black-boxed > .dbg-breakpoint {
display: none;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
background-image: none;
box-shadow: inset -1px 0 0 #222426;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
background-image: none;
box-shadow: inset 1px 0 0 #222426;
}
@ -145,7 +122,7 @@
/* Sources and breakpoints view */
.dbg-breakpoint {
-moz-margin-start: -14px;
-moz-margin-start: 4px;
}
.dbg-breakpoint-line {
@ -400,7 +377,8 @@
list-style-image: url("chrome://browser/skin/devtools/debugger-step-out.png");
}
#debugger-controls > toolbarbutton {
#debugger-controls > toolbarbutton,
#sources-controls > toolbarbutton {
margin: 0;
box-shadow: none;
border-radius: 0;
@ -409,11 +387,13 @@
outline-offset: -3px;
}
#debugger-controls > toolbarbutton:last-of-type {
#debugger-controls > toolbarbutton:last-of-type,
#sources-controls > toolbarbutton:last-of-type {
-moz-border-end-width: 0;
}
#debugger-controls {
#debugger-controls,
#sources-controls {
box-shadow: 0 1px 0 hsla(210,16%,76%,.15) inset,
0 0 0 1px hsla(210,16%,76%,.15) inset,
0 1px 0 hsla(210,16%,76%,.15);

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

@ -287,6 +287,7 @@ browser.jar:
skin/classic/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css)
skin/classic/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css)
skin/classic/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)

Двоичные данные
browser/themes/windows/devtools/debugger-blackbox.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1005 B

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

@ -22,54 +22,29 @@
font-weight: bold;
}
#sources .side-menu-widget-item-checkbox {
-moz-appearance: none;
-moz-margin-end: -6px;
padding: 0;
opacity: 0;
transition: opacity .15s ease 0s;
#black-box {
list-style-image: url(debugger-blackbox.png);
-moz-image-region: rect(0px,16px,16px,0px);
}
/* Only show the checkbox when the source is hovered over, is selected, or if it
* is not checked. */
#sources .side-menu-widget-item:hover > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item-checkbox:not([checked]) {
opacity: 1;
transition: opacity .15s ease-out 0s;
#black-box[checked] {
-moz-image-region: rect(0px,32px,16px,16px);
}
#sources .side-menu-widget-item-checkbox > .checkbox-check {
-moz-appearance: none;
background: none;
background-image: url(itemToggle.png);
background-repeat: no-repeat;
background-clip: content-box;
background-size: 32px 16px;
background-position: -16px 0;
width: 16px;
height: 16px;
border: 0;
}
#sources .side-menu-widget-item-checkbox[checked] > .checkbox-check {
background-position: 0 0;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
#sources .black-boxed {
color: #888;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
#sources .black-boxed > .dbg-breakpoint {
display: none;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
background-image: none;
box-shadow: inset -1px 0 0 #222426;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
background-image: none;
box-shadow: inset 1px 0 0 #222426;
}
@ -145,7 +120,7 @@
/* Sources and breakpoints view */
.dbg-breakpoint {
-moz-margin-start: -14px;
-moz-margin-start: 4px;
}
.dbg-breakpoint-line {
@ -400,7 +375,8 @@
list-style-image: url("chrome://browser/skin/devtools/debugger-step-out.png");
}
#debugger-controls > toolbarbutton {
#debugger-controls > toolbarbutton,
#sources-controls > toolbarbutton {
margin: 0;
box-shadow: none;
border-radius: 0;
@ -409,11 +385,13 @@
outline-offset: -3px;
}
#debugger-controls > toolbarbutton:last-of-type {
#debugger-controls > toolbarbutton:last-of-type,
#sources-controls > toolbarbutton:last-of-type {
-moz-border-end-width: 0;
}
#debugger-controls {
#debugger-controls,
#sources-controls {
box-shadow: 0 1px 0 hsla(209,29%,72%,.15) inset,
0 0 0 1px hsla(209,29%,72%,.1) inset,
0 0 0 1px hsla(209,29%,72%,.1),

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

@ -222,6 +222,7 @@ browser.jar:
skin/classic/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)
skin/classic/browser/devtools/responsive-vertical-resizer.png (devtools/responsive-vertical-resizer.png)
skin/classic/browser/devtools/responsive-horizontal-resizer.png (devtools/responsive-horizontal-resizer.png)
@ -494,6 +495,7 @@ browser.jar:
skin/classic/aero/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/aero/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/aero/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/aero/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/aero/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)
skin/classic/aero/browser/devtools/responsive-vertical-resizer.png (devtools/responsive-vertical-resizer.png)
skin/classic/aero/browser/devtools/responsive-horizontal-resizer.png (devtools/responsive-horizontal-resizer.png)

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

@ -14,6 +14,7 @@ MOZ_THUMB_INTERWORK=toolchain-default
MOZ_FPU=toolchain-default
MOZ_FLOAT_ABI=toolchain-default
MOZ_SOFT_FLOAT=toolchain-default
MOZ_ALIGN=toolchain-default
MOZ_ARG_WITH_STRING(arch,
[ --with-arch=[[type|toolchain-default]]
@ -32,6 +33,7 @@ if test -z "$MOZ_ARCH"; then
MOZ_ARCH=armv7-a
MOZ_FPU=vfp
MOZ_FLOAT_ABI=softfp
MOZ_ALIGN=no
;;
arm-Darwin)
MOZ_ARCH=toolchain-default
@ -159,8 +161,28 @@ no)
;;
esac
case "$MOZ_ALIGN" in
no)
align_flag="-mno-unaligned-access"
;;
yes)
align_flag="-munaligned-access"
;;
*)
align_flag=""
;;
esac
if test -n "$align_flag"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $align_flag"
AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
AC_TRY_COMPILE([],[],,align_flag="")
CFLAGS="$_SAVE_CFLAGS"
fi
dnl Use echo to avoid accumulating space characters
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
if test -n "$all_flags"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$all_flags"

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

@ -40,7 +40,7 @@ typedef struct ASFinderInfo
static void append_file(FILE* output, const char* input_name)
{
FILE* input = fopen(input_name, "rb");
EXIT_IF_FALSE(input != NULL);
EXIT_IF_FALSE(input != nullptr);
while (1) {
char buffer[4096];
@ -87,7 +87,7 @@ int main(int argc, char** argv)
}
FILE* output = fopen(argv[2], "wb");
if (output == NULL) {
if (output == nullptr) {
printf("%s: can't open file `%s'\n", argv[0], argv[2]);
exit(5);
}
@ -177,7 +177,7 @@ int main(int argc, char** argv)
memset(&cat_info, 0, sizeof(cat_info));
EXIT_IF_FALSE(FSGetCatalogInfo(&fsref,
kFSCatInfoGettableInfo,
&cat_info, NULL, NULL, NULL) == 0);
&cat_info, nullptr, nullptr, nullptr) == 0);
ASFinderInfo finder_info;
memcpy(&finder_info.ioFlFndrInfo, &cat_info.finderInfo,

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

@ -826,8 +826,8 @@ CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(topsrcdir)/config/createprecomple
# MDDEPDIR is the subdirectory where dependency files are stored
MDDEPDIR := .deps
EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/expandlibs_exec.py $(if $@,--depend $(MDDEPDIR)/$(dir $@)/$(@F).pp --target $@)
EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/expandlibs_gen.py $(if $@,--depend $(MDDEPDIR)/$(dir $@)/$(@F).pp)
EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/expandlibs_exec.py $(if $@,--depend $(MDDEPDIR)/$@.pp --target $@)
EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/expandlibs_gen.py $(if $@,--depend $(MDDEPDIR)/$@.pp)
EXPAND_AR = $(EXPAND_LIBS_EXEC) --extract -- $(AR)
EXPAND_CC = $(EXPAND_LIBS_EXEC) --uselist -- $(CC)
EXPAND_CCC = $(EXPAND_LIBS_EXEC) --uselist -- $(CCC)

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

@ -209,11 +209,22 @@ endif
endif
endif
binaries libs:: $(TARGETS) $(BINARIES_PP)
# Aggregate all dependency files relevant to a binaries build except in
# the mozilla top-level directory.
ifneq (_.,$(recurse_targets)_$(DEPTH))
@$(if $(or $(recurse_targets),$^),$(call py_action,link_deps,-o binaries --group-all $(if $(want_abspaths),--abspaths )--topsrcdir $(topsrcdir) --topobjdir $(DEPTH) --dist $(DIST) $(BINARIES_PP) $(wildcard $(addsuffix .pp,$(addprefix $(MDDEPDIR)/,$(notdir $(sort $(filter-out $(BINARIES_PP),$^) $(OBJ_TARGETS)))))) $(recurse_targets)))
ALL_DEP_FILES := \
$(BINARIES_PP) \
$(addsuffix .pp,$(addprefix $(MDDEPDIR)/,$(sort \
$(TARGETS) \
$(filter-out $(SOBJS) $(ASOBJS) $(EXCLUDED_OBJS),$(OBJ_TARGETS)) \
))) \
$(recurse_targets) \
$(NULL)
endif
binaries libs:: $(TARGETS) $(BINARIES_PP)
ifneq (_.,$(recurse_targets)_$(DEPTH))
@$(if $(or $(recurse_targets),$^),$(call py_action,link_deps,-o binaries --group-all $(if $(want_abspaths),--abspaths )--topsrcdir $(topsrcdir) --topobjdir $(DEPTH) --dist $(DIST) $(ALL_DEP_FILES)))
endif
endif # ifdef MOZ_PSEUDO_DERECURSE

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

@ -299,6 +299,7 @@ endif
# Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
ifdef MOZ_PROFILE_GENERATE
EXCLUDED_OBJS := $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.$(OBJ_SUFFIX))
SIMPLE_PROGRAMS :=
endif
@ -816,7 +817,7 @@ endif
$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f "$(srcdir)/$@.manifest"; then \
@ -833,9 +834,9 @@ ifdef MSMANIFEST_TOOL
endif # MSVC with manifest tool
else
ifeq ($(HOST_CPP_PROG_LINK),1)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) -- $(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif # HOST_CPP_PROG_LINK
endif
@ -872,12 +873,12 @@ endif
$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) -- $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif
endif
@ -1466,8 +1467,8 @@ endif
# dependency directory in the object directory, where we really need
# it.
ifneq (,$(filter-out all chrome default export realchrome tools clean clobber clobber_all distclean realclean,$(MAKECMDGOALS)))
MDDEPEND_FILES := $(strip $(wildcard $(foreach file,$(sort $(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS) $(TARGETS)),$(MDDEPDIR)/$(notdir $(file)).pp) $(addprefix $(MDDEPDIR)/,$(EXTRA_MDDEPEND_FILES))))
ifneq (,$(filter-out all chrome default export realchrome clean clobber clobber_all distclean realclean,$(MAKECMDGOALS)))
MDDEPEND_FILES := $(strip $(wildcard $(addprefix $(MDDEPDIR)/,$(EXTRA_MDDEPEND_FILES) $(addsuffix .pp,$(notdir $(sort $(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS))) $(TARGETS)))))
ifneq (,$(MDDEPEND_FILES))
$(call include_deps,$(MDDEPEND_FILES))

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

@ -3986,7 +3986,7 @@ MOZ_PDF_PRINTING=
MOZ_DISABLE_CRYPTOLEGACY=
NSS_DISABLE_DBM=
NECKO_COOKIES=1
NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
NECKO_PROTOCOLS_DEFAULT="about app data file ftp http res viewsource websocket wyciwyg device"
USE_ARM_KUSER=
BUILD_CTYPES=1
MOZ_USE_NATIVE_POPUP_WINDOWS=
@ -8342,6 +8342,11 @@ AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
AC_SUBST(MOZ_LINKER_EXTRACT)
AC_SUBST(MOZ_JSDOWNLOADS)
if test -n "$MOZ_JSDOWNLOADS"; then
AC_DEFINE(MOZ_JSDOWNLOADS)
fi
dnl ========================================================
dnl = Mac bundle name prefix
dnl ========================================================

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

@ -7,6 +7,7 @@
XPIDL_SOURCES += [
'nsIContentPolicy.idl',
'nsIContentSecurityPolicy.idl',
'nsIDocumentEncoder.idl',
'nsIDOMDataChannel.idl',
'nsIDOMFile.idl',
'nsIDOMFileList.idl',
@ -14,7 +15,6 @@ XPIDL_SOURCES += [
'nsIDOMFormData.idl',
'nsIDOMParser.idl',
'nsIDOMSerializer.idl',
'nsIDocumentEncoder.idl',
'nsIDroppedLinkHandler.idl',
'nsIFrameLoader.idl',
'nsIImageLoadingContent.idl',
@ -43,9 +43,9 @@ EXPORTS += [
'nsContentTypeParser.h',
'nsContentUtils.h',
'nsCopySupport.h',
'nsDOMFile.h',
'nsDeprecatedOperationList.h',
'nsDocElementCreatedNotificationRunner.h',
'nsDOMFile.h',
'nsHostObjectProtocolHandler.h',
'nsIAttribute.h',
'nsIContent.h',

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

@ -54,11 +54,11 @@ if CONFIG['INTEL_ARCHITECTURE']:
EXPORTS.mozilla.dom += [
'Attr.h',
'Comment.h',
'DocumentFragment.h',
'DocumentType.h',
'DOMImplementation.h',
'DOMParser.h',
'DOMRect.h',
'DocumentFragment.h',
'DocumentType.h',
'EventSource.h',
'Link.h',
'NodeIterator.h',
@ -68,31 +68,26 @@ EXPORTS.mozilla.dom += [
CPP_SOURCES += [
'Attr.cpp',
'ChildIterator.cpp',
'Comment.cpp',
'DOMImplementation.cpp',
'DOMRect.cpp',
'DirectionalityUtils.cpp',
'DocumentFragment.cpp',
'DocumentType.cpp',
'DOMImplementation.cpp',
'DOMParser.cpp',
'DOMRect.cpp',
'Element.cpp',
'EventSource.cpp',
'FileIOObject.cpp',
'FragmentOrElement.cpp',
'Link.cpp',
'NodeIterator.cpp',
'Text.cpp',
'ThirdPartyUtil.cpp',
'TreeWalker.cpp',
'WebSocket.cpp',
'nsAtomListUtils.cpp',
'nsAttrAndChildArray.cpp',
'nsAttrValue.cpp',
'nsAttrValueOrString.cpp',
'nsCCUncollectableMarker.cpp',
'nsCSPService.cpp',
'nsChannelPolicy.cpp',
'ChildIterator.cpp',
'nsContentAreaDragDrop.cpp',
'nsContentIterator.cpp',
'nsContentList.cpp',
@ -101,6 +96,10 @@ CPP_SOURCES += [
'nsContentUtils.cpp',
'nsCopySupport.cpp',
'nsCrossSiteListenerProxy.cpp',
'nsCSPService.cpp',
'nsDataDocumentContentPolicy.cpp',
'nsDocument.cpp',
'nsDocumentEncoder.cpp',
'nsDOMAttributeMap.cpp',
'nsDOMBlobBuilder.cpp',
'nsDOMCaretPosition.cpp',
@ -111,20 +110,17 @@ CPP_SOURCES += [
'nsDOMSerializer.cpp',
'nsDOMSettableTokenList.cpp',
'nsDOMTokenList.cpp',
'nsDataDocumentContentPolicy.cpp',
'nsDocument.cpp',
'nsDocumentEncoder.cpp',
'nsFormData.cpp',
'nsFrameLoader.cpp',
'nsFrameMessageManager.cpp',
'nsGenConImageContent.cpp',
'nsGenericDOMDataNode.cpp',
'nsGkAtoms.cpp',
'nsHTMLContentSerializer.cpp',
'nsHostObjectProtocolHandler.cpp',
'nsHostObjectURI.cpp',
'nsINode.cpp',
'nsHTMLContentSerializer.cpp',
'nsImageLoadingContent.cpp',
'nsINode.cpp',
'nsInProcessTabChildGlobal.cpp',
'nsLineBreaker.cpp',
'nsMappedAttributeElement.cpp',
@ -144,8 +140,8 @@ CPP_SOURCES += [
'nsScriptLoader.cpp',
'nsStubDocumentObserver.cpp',
'nsStubMutationObserver.cpp',
'nsStyleLinkElement.cpp',
'nsStyledElement.cpp',
'nsStyleLinkElement.cpp',
'nsSyncLoadService.cpp',
'nsTextFragment.cpp',
'nsTextNode.cpp',
@ -156,6 +152,10 @@ CPP_SOURCES += [
'nsXMLContentSerializer.cpp',
'nsXMLHttpRequest.cpp',
'nsXMLNameSpaceMap.cpp',
'Text.cpp',
'ThirdPartyUtil.cpp',
'TreeWalker.cpp',
'WebSocket.cpp',
]
EXTRA_COMPONENTS += [

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

@ -78,8 +78,8 @@ private:
// Creates and returns an encoder instance of the type specified in aType.
// aType may change to "image/png" if no instance of the original type could
// be created and we had to fall back to a PNG encoder. A return value of
// NULL should be interpreted as NS_IMAGELIB_ERROR_NO_ENCODER and aType is
// be created and we had to fall back to a PNG encoder. A null return value
// should be interpreted as NS_IMAGELIB_ERROR_NO_ENCODER and aType is
// undefined in this case.
static already_AddRefed<imgIEncoder> GetImageEncoder(nsAString& aType);

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

@ -27,21 +27,21 @@ CPP_SOURCES += [
if CONFIG['MOZ_WEBGL']:
CPP_SOURCES += [
'WebGLActiveInfo.cpp',
'WebGLBuffer.cpp',
'WebGL1Context.cpp',
'WebGL2Context.cpp',
'WebGLActiveInfo.cpp',
'WebGLBuffer.cpp',
'WebGLContext.cpp',
'WebGLContextAsyncQueries.cpp',
'WebGLContextBuffers.cpp',
'WebGLContextLossTimer.cpp',
'WebGLContextGL.cpp',
'WebGLContextUtils.cpp',
'WebGLContextReporter.cpp',
'WebGLContextState.cpp',
'WebGLContextValidate.cpp',
'WebGLContextExtensions.cpp',
'WebGLContextFramebufferOperations.cpp',
'WebGLContextGL.cpp',
'WebGLContextLossTimer.cpp',
'WebGLContextReporter.cpp',
'WebGLContextState.cpp',
'WebGLContextUtils.cpp',
'WebGLContextValidate.cpp',
'WebGLContextVertexArray.cpp',
'WebGLContextVertices.cpp',
'WebGLElementArrayCache.cpp',

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

@ -25,8 +25,6 @@ if CONFIG['MOZ_WEBSPEECH']:
CPP_SOURCES += [
'DOMWheelEvent.cpp',
'EventTarget.cpp',
'TextComposition.cpp',
'Touch.cpp',
'nsAsyncDOMEvent.cpp',
'nsContentEventHandler.cpp',
'nsDOMAnimationEvent.cpp',
@ -62,6 +60,8 @@ CPP_SOURCES += [
'nsIMEStateManager.cpp',
'nsPaintRequest.cpp',
'nsPrivateTextRange.cpp',
'TextComposition.cpp',
'Touch.cpp',
]
if CONFIG['MOZ_WEBSPEECH']:

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

@ -17,7 +17,7 @@
#include "DecoderTraits.h"
#include "nsIAudioChannelAgent.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/TextTrackList.h"
#include "mozilla/dom/TextTrackManager.h"
// Define to output information on decoding and painting framerate
/* #define DEBUG_FRAME_RATE 1 */
@ -50,6 +50,7 @@ namespace dom {
class MediaError;
class MediaSource;
class TextTrackList;
class HTMLMediaElement : public nsGenericHTMLElement,
public nsIObserver,
@ -526,12 +527,14 @@ public:
const nsAString& aLanguage);
void AddTextTrack(TextTrack* aTextTrack) {
mTextTracks->AddTextTrack(aTextTrack);
if (mTextTrackManager) {
mTextTrackManager->AddTextTrack(aTextTrack);
}
}
void RemoveTextTrack(TextTrack* aTextTrack) {
if (mTextTracks) {
mTextTracks->RemoveTextTrack(*aTextTrack);
if (mTextTrackManager) {
mTextTrackManager->RemoveTextTrack(aTextTrack);
}
}
@ -1148,8 +1151,7 @@ protected:
// An agent used to join audio channel service.
nsCOMPtr<nsIAudioChannelAgent> mAudioChannelAgent;
// List of our attached text track objects.
nsRefPtr<TextTrackList> mTextTracks;
nsRefPtr<TextTrackManager> mTextTrackManager;
};
} // namespace dom

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

@ -425,7 +425,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTM
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOutputStreams[i].mStream);
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlayed);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTextTracks);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTextTrackManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
@ -445,7 +445,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLE
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOutputStreams[i].mStream);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mPlayed);
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTextTracks);
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTextTrackManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLMediaElement)
@ -1999,7 +1999,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
RegisterFreezableElement();
NotifyOwnerDocumentActivityChanged();
mTextTracks = new TextTrackList(OwnerDoc()->GetParentObject());
mTextTrackManager = new TextTrackManager(this);
}
HTMLMediaElement::~HTMLMediaElement()
@ -2979,7 +2979,9 @@ void HTMLMediaElement::SeekCompleted()
DispatchAsyncEvent(NS_LITERAL_STRING("seeked"));
// We changed whether we're seeking so we need to AddRemoveSelfReference
AddRemoveSelfReference();
mTextTracks->DidSeek();
if (mTextTrackManager) {
mTextTrackManager->DidSeek();
}
}
void HTMLMediaElement::NotifySuspendedByCache(bool aIsSuspended)
@ -3668,11 +3670,11 @@ void HTMLMediaElement::FireTimeUpdate(bool aPeriodic)
}
// Update visible text tracks.
// Here mTextTracks can be null if the cycle collector has unlinked
// Here mTextTrackManager can be null if the cycle collector has unlinked
// us before our parent. In that case UnbindFromTree will call us
// when our parent is unlinked.
if (mTextTracks) {
mTextTracks->Update(time);
if (mTextTrackManager) {
mTextTrackManager->Update(time);
}
}
@ -3905,7 +3907,7 @@ NS_IMETHODIMP HTMLMediaElement::CanPlayChanged(int32_t canPlay)
TextTrackList*
HTMLMediaElement::TextTracks() const
{
return mTextTracks;
return mTextTrackManager ? mTextTrackManager->TextTracks() : nullptr;
}
already_AddRefed<TextTrack>
@ -3913,7 +3915,9 @@ HTMLMediaElement::AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,
const nsAString& aLanguage)
{
return mTextTracks->AddTextTrack(this, aKind, aLabel, aLanguage);
return mTextTrackManager ? mTextTrackManager->AddTextTrack(aKind, aLabel,
aLanguage)
: nullptr;
}
} // namespace dom

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

@ -0,0 +1,68 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
/* 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/dom/TextTrackManager.h"
#include "mozilla/dom/HTMLMediaElement.h"
namespace mozilla {
namespace dom {
NS_IMPL_CYCLE_COLLECTION_1(TextTrackManager, mTextTracks)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(TextTrackManager, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(TextTrackManager, Release)
TextTrackManager::TextTrackManager(HTMLMediaElement *aMediaElement)
: mMediaElement(aMediaElement)
{
MOZ_COUNT_CTOR(TextTrackManager);
mTextTracks = new TextTrackList(mMediaElement->OwnerDoc()->GetParentObject());
}
TextTrackManager::~TextTrackManager()
{
MOZ_COUNT_DTOR(TextTrackManager);
}
TextTrackList*
TextTrackManager::TextTracks() const
{
return mTextTracks;
}
already_AddRefed<TextTrack>
TextTrackManager::AddTextTrack(TextTrackKind aKind, const nsAString& aLabel,
const nsAString& aLanguage)
{
return mTextTracks->AddTextTrack(mMediaElement, aKind, aLabel, aLanguage);
}
void
TextTrackManager::AddTextTrack(TextTrack* aTextTrack)
{
mTextTracks->AddTextTrack(aTextTrack);
}
void
TextTrackManager::RemoveTextTrack(TextTrack* aTextTrack)
{
mTextTracks->RemoveTextTrack(aTextTrack);
}
void
TextTrackManager::DidSeek()
{
mTextTracks->DidSeek();
}
void
TextTrackManager::Update(double aTime)
{
mTextTracks->Update(aTime);
}
} // namespace dom
} // namespace mozilla

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

@ -0,0 +1,53 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
/* 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/. */
#ifndef mozilla_dom_TextTrackManager_h
#define mozilla_dom_TextTrackManager_h
#include "mozilla/dom/TextTrack.h"
#include "mozilla/dom/TextTrackList.h"
namespace mozilla {
namespace dom {
class HTMLMediaElement;
class TextTrackManager
{
public:
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(TextTrackManager)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(TextTrackManager);
TextTrackManager(HTMLMediaElement *aMediaElement);
~TextTrackManager();
TextTrackList* TextTracks() const;
already_AddRefed<TextTrack> AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,
const nsAString& aLanguage);
void AddTextTrack(TextTrack* aTextTrack);
void RemoveTextTrack(TextTrack* aTextTrack);
void DidSeek();
// Update the display of cues on the video as per the current play back time
// of aTime.
void Update(double aTime);
private:
// The HTMLMediaElement that this TextTrackManager manages the TextTracks of.
// This is a weak reference as the life time of TextTrackManager is dependent
// on the HTMLMediaElement, so it should not be trying to hold the
// HTMLMediaElement alive.
HTMLMediaElement* mMediaElement;
// List of the TextTrackManager's owning HTMLMediaElement's TextTracks.
nsRefPtr<TextTrackList> mTextTracks;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_TextTrackManager_h

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

@ -15,8 +15,8 @@ EXPORTS += [
EXPORTS.mozilla.dom += [
'HTMLAnchorElement.h',
'HTMLAreaElement.h',
'HTMLBRElement.h',
'HTMLBodyElement.h',
'HTMLBRElement.h',
'HTMLButtonElement.h',
'HTMLDataElement.h',
'HTMLDataListElement.h',
@ -27,14 +27,14 @@ EXPORTS.mozilla.dom += [
'HTMLFormElement.h',
'HTMLFrameElement.h',
'HTMLFrameSetElement.h',
'HTMLHRElement.h',
'HTMLHeadingElement.h',
'HTMLHRElement.h',
'HTMLIFrameElement.h',
'HTMLImageElement.h',
'HTMLInputElement.h',
'HTMLLIElement.h',
'HTMLLabelElement.h',
'HTMLLegendElement.h',
'HTMLLIElement.h',
'HTMLLinkElement.h',
'HTMLMapElement.h',
'HTMLMenuElement.h',
@ -71,6 +71,7 @@ EXPORTS.mozilla.dom += [
'HTMLTrackElement.h',
'HTMLUnknownElement.h',
'MediaError.h',
'TextTrackManager.h',
'TimeRanges.h',
'UndoManager.h',
'ValidityState.h',
@ -80,8 +81,8 @@ CPP_SOURCES += [
'HTMLAnchorElement.cpp',
'HTMLAreaElement.cpp',
'HTMLAudioElement.cpp',
'HTMLBRElement.cpp',
'HTMLBodyElement.cpp',
'HTMLBRElement.cpp',
'HTMLButtonElement.cpp',
'HTMLCanvasElement.cpp',
'HTMLDataElement.cpp',
@ -94,14 +95,14 @@ CPP_SOURCES += [
'HTMLFormElement.cpp',
'HTMLFrameElement.cpp',
'HTMLFrameSetElement.cpp',
'HTMLHRElement.cpp',
'HTMLHeadingElement.cpp',
'HTMLHRElement.cpp',
'HTMLIFrameElement.cpp',
'HTMLImageElement.cpp',
'HTMLInputElement.cpp',
'HTMLLIElement.cpp',
'HTMLLabelElement.cpp',
'HTMLLegendElement.cpp',
'HTMLLIElement.cpp',
'HTMLLinkElement.cpp',
'HTMLMapElement.cpp',
'HTMLMediaElement.cpp',
@ -141,9 +142,6 @@ CPP_SOURCES += [
'HTMLUnknownElement.cpp',
'HTMLVideoElement.cpp',
'MediaError.cpp',
'TimeRanges.cpp',
'UndoManager.cpp',
'ValidityState.cpp',
'nsDOMStringMap.cpp',
'nsFormSubmission.cpp',
'nsGenericHTMLElement.cpp',
@ -152,6 +150,10 @@ CPP_SOURCES += [
'nsIConstraintValidation.cpp',
'nsRadioVisitor.cpp',
'nsTextEditorState.cpp',
'TextTrackManager.cpp',
'TimeRanges.cpp',
'UndoManager.cpp',
'ValidityState.cpp',
]
FAIL_ON_WARNINGS = True

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

@ -19,10 +19,10 @@ CPP_SOURCES += [
'HTMLAllCollection.cpp',
'ImageDocument.cpp',
'MediaDocument.cpp',
'PluginDocument.cpp',
'VideoDocument.cpp',
'nsHTMLContentSink.cpp',
'nsHTMLDocument.cpp',
'PluginDocument.cpp',
'VideoDocument.cpp',
]
LIBRARY_NAME = 'gkconhtmldoc_s'

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

@ -433,15 +433,16 @@ AudioStream* AudioStream::AllocateStream()
int AudioStream::MaxNumberOfChannels()
{
uint32_t maxNumberOfChannels, rv;
#if defined(MOZ_CUBEB)
uint32_t maxNumberOfChannels;
rv = cubeb_get_max_channel_count(GetCubebContext(), &maxNumberOfChannels);
if (rv != CUBEB_OK) {
return 0;
if (cubeb_get_max_channel_count(GetCubebContext(),
&maxNumberOfChannels) == CUBEB_OK) {
return static_cast<int>(maxNumberOfChannels);
}
#endif
return static_cast<int>(maxNumberOfChannels);
return 0;
}
int AudioStream::PreferredSampleRate()
@ -453,9 +454,13 @@ int AudioStream::PreferredSampleRate()
// backend used.
const int fallbackSampleRate = 44100;
if (mPreferredSampleRate == 0) {
if (cubeb_get_preferred_sample_rate(GetCubebContext(), &mPreferredSampleRate) != CUBEB_OK) {
mPreferredSampleRate = fallbackSampleRate;
#if defined(MOZ_CUBEB)
if (cubeb_get_preferred_sample_rate(GetCubebContext(),
&mPreferredSampleRate) == CUBEB_OK) {
return mPreferredSampleRate;
}
#endif
mPreferredSampleRate = fallbackSampleRate;
}
return mPreferredSampleRate;

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

@ -520,7 +520,8 @@ DecoderTraits::CreateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
}
#endif
#ifdef MOZ_MEDIA_PLUGINS
if (MediaDecoder::IsMediaPluginsEnabled() && GetMediaPluginHost()->FindDecoder(aType, NULL)) {
if (MediaDecoder::IsMediaPluginsEnabled() &&
GetMediaPluginHost()->FindDecoder(aType, nullptr)) {
decoder = new MediaPluginDecoder(aType);
}
#endif

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

@ -166,14 +166,14 @@ public:
Plane mPlanes[3];
};
// Constructs a VideoData object. If aImage is NULL, creates a new Image
// holding a copy of the YCbCr data passed in aBuffer. If aImage is not NULL,
// it's stored as the underlying video image and aBuffer is assumed to point
// to memory within aImage so no copy is made. aTimecode is a codec specific
// number representing the timestamp of the frame of video data. Returns
// nsnull if an error occurs. This may indicate that memory couldn't be
// allocated to create the VideoData object, or it may indicate some problem
// with the input data (e.g. negative stride).
// Constructs a VideoData object. If aImage is nullptr, creates a new Image
// holding a copy of the YCbCr data passed in aBuffer. If aImage is not
// nullptr, it's stored as the underlying video image and aBuffer is assumed
// to point to memory within aImage so no copy is made. aTimecode is a codec
// specific number representing the timestamp of the frame of video data.
// Returns nsnull if an error occurs. This may indicate that memory couldn't
// be allocated to create the VideoData object, or it may indicate some
// problem with the input data (e.g. negative stride).
static VideoData* Create(VideoInfo& aInfo,
ImageContainer* aContainer,
Image* aImage,

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

@ -960,9 +960,9 @@ MediaStreamGraphImpl::PrepareUpdatesToMainThreadState(bool aFinalUpdate)
{
mMonitor.AssertCurrentThreadOwns();
// We don't want to update the main thread about timing update when we are not
// running in realtime.
if (ShouldUpdateMainThread()) {
// We don't want to frequently update the main thread about timing update
// when we are not running in realtime.
if (aFinalUpdate || ShouldUpdateMainThread()) {
mStreamUpdates.SetCapacity(mStreamUpdates.Length() + mStreams.Length());
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
MediaStream* stream = mStreams[i];

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

@ -77,10 +77,10 @@ TextTrackList::GetTrackById(const nsAString& aId)
}
void
TextTrackList::RemoveTextTrack(TextTrack& aTrack)
TextTrackList::RemoveTextTrack(TextTrack* aTrack)
{
if (mTextTracks.RemoveElement(&aTrack)) {
CreateAndDispatchTrackEventRunner(&aTrack, NS_LITERAL_STRING("removetrack"));
if (mTextTracks.RemoveElement(aTrack)) {
CreateAndDispatchTrackEventRunner(aTrack, NS_LITERAL_STRING("removetrack"));
}
}

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

@ -53,7 +53,7 @@ public:
mTextTracks.AppendElement(aTextTrack);
}
void RemoveTextTrack(TextTrack& aTrack);
void RemoveTextTrack(TextTrack* aTrack);
void DidSeek();
nsresult DispatchTrackEvent(TrackEvent* aEvent);

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

@ -35,48 +35,6 @@ struct nsIntSize;
// mozilla::Monitor non-reentrant.
namespace mozilla {
/**
* ReentrantMonitorAutoExit
* Exit the ReentrantMonitor when it enters scope, and enters it when it leaves
* scope.
*
* MUCH PREFERRED to bare calls to ReentrantMonitor.Exit and Enter.
*/
class MOZ_STACK_CLASS ReentrantMonitorAutoExit
{
public:
/**
* Constructor
* The constructor releases the given lock. The destructor
* acquires the lock. The lock must be held before constructing
* this object!
*
* @param aReentrantMonitor A valid mozilla::ReentrantMonitor*. It
* must be already locked.
**/
ReentrantMonitorAutoExit(ReentrantMonitor& aReentrantMonitor) :
mReentrantMonitor(&aReentrantMonitor)
{
NS_ASSERTION(mReentrantMonitor, "null monitor");
mReentrantMonitor->AssertCurrentThreadIn();
mReentrantMonitor->Exit();
}
~ReentrantMonitorAutoExit(void)
{
mReentrantMonitor->Enter();
}
private:
ReentrantMonitorAutoExit();
ReentrantMonitorAutoExit(const ReentrantMonitorAutoExit&);
ReentrantMonitorAutoExit& operator =(const ReentrantMonitorAutoExit&);
static void* operator new(size_t) CPP_THROW_NEW;
static void operator delete(void*);
ReentrantMonitor* mReentrantMonitor;
};
/**
* ReentrantMonitorConditionallyEnter
*

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

@ -14,7 +14,7 @@
#include <initguid.h>
#include <wmsdkidl.h>
#define DELETE_RESET(p) { delete (p) ; (p) = NULL ;}
#define DELETE_RESET(p) { delete (p) ; (p) = nullptr ;}
DEFINE_GUID(CLSID_MozAudioSinkFilter, 0x1872d8c8, 0xea8d, 0x4c34, 0xae, 0x96, 0x69, 0xde,
0xf1, 0x33, 0x7b, 0x33);

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

@ -83,7 +83,7 @@ DirectShowReader::ReadMetadata(MediaInfo* aInfo,
// Create the filter graph, reference it by the GraphBuilder interface,
// to make graph building more convenient.
hr = CoCreateInstance(CLSID_FilterGraph,
NULL,
nullptr,
CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,
reinterpret_cast<void**>(static_cast<IGraphBuilder**>(byRef(mGraph))));
@ -217,7 +217,7 @@ DirectShowReader::Finish(HRESULT aStatus)
RefPtr<IMediaEventSink> eventSink;
HRESULT hr = mGraph->QueryInterface(static_cast<IMediaEventSink**>(byRef(eventSink)));
if (SUCCEEDED(hr) && eventSink) {
eventSink->Notify(EC_COMPLETE, aStatus, NULL);
eventSink->Notify(EC_COMPLETE, aStatus, 0);
}
return false;
}

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

@ -163,7 +163,7 @@ GetGraphNotifyString(long evCode)
CASE(VFW_S_VIDEO_NOT_RENDERED); // Partial success; the video was not rendered.
CASE(E_ABORT); // Operation aborted.
CASE(E_OUTOFMEMORY); // Insufficient memory.
CASE(E_POINTER); // NULL pointer argument.
CASE(E_POINTER); // Null pointer argument.
CASE(VFW_E_CANNOT_CONNECT); // No combination of intermediate filters could be found to make the connection.
CASE(VFW_E_CANNOT_RENDER); // No combination of filters could be found to render the stream.
CASE(VFW_E_NO_ACCEPTABLE_TYPES); // There is no common media type between these pins.
@ -187,7 +187,7 @@ CreateAndAddFilter(IGraphBuilder* aGraph,
nsRefPtr<IBaseFilter> filter;
hr = CoCreateInstance(aFilterClsId,
NULL,
nullptr,
CLSCTX_INPROC_SERVER,
IID_IBaseFilter,
getter_AddRefs(filter));
@ -215,7 +215,7 @@ AddMP3DMOWrapperFilter(IGraphBuilder* aGraph,
// Create the wrapper filter.
nsRefPtr<IBaseFilter> filter;
hr = CoCreateInstance(CLSID_DMOWrapperFilter,
NULL,
nullptr,
CLSCTX_INPROC_SERVER,
IID_IBaseFilter,
getter_AddRefs(filter));
@ -281,7 +281,7 @@ GetUnconnectedPin(IBaseFilter* aFilter, PIN_DIRECTION aPinDir)
// Test each pin to see if it matches the direction we're looking for.
RefPtr<IPin> pin;
while (S_OK == enumPins->Next(1, byRef(pin), NULL)) {
while (S_OK == enumPins->Next(1, byRef(pin), nullptr)) {
bool matches = FALSE;
if (SUCCEEDED(MatchUnconnectedPin(pin, aPinDir, &matches)) &&
matches) {

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

@ -22,7 +22,7 @@ public:
: mLock(aLock)
{
CriticalSectionAutoEnter lock(*mLock);
mEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
mEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
}
~Signal() {

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

@ -385,7 +385,7 @@ OutputPin::RequestAllocator(IMemAllocator* aPreferred,
CLSCTX_INPROC_SERVER,
IID_IMemAllocator,
getter_AddRefs(allocator));
if(FAILED(hr) || (allocator == NULL)) {
if(FAILED(hr) || (allocator == nullptr)) {
NS_WARNING("Can't create our own DirectShow allocator.");
return hr;
}
@ -451,7 +451,7 @@ OutputPin::WaitForNext(DWORD aTimeout,
NS_ASSERTION(aTimeout == 0 || aTimeout == INFINITE,
"Oops, we don't handle this!");
*aOutSample = NULL;
*aOutSample = nullptr;
*aOutDwUser = 0;
LONGLONG offset = 0;
@ -657,7 +657,7 @@ SourceFilter::GetPin(int n)
NS_ASSERTION(mOutputPin != 0, "GetPin with no pin!");
return static_cast<BasePin*>(mOutputPin);
} else {
return NULL;
return nullptr;
}
}

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

@ -27,12 +27,12 @@ CPP_SOURCES += [
# If WebRTC isn't being built, we need to compile the DirectShow base classes so that
# they're available at link time.
if not CONFIG['MOZ_WEBRTC']:
CPP_SOURCES += [
TOPSRCDIR + '/media/webrtc/trunk/webrtc/modules/video_capture/windows/BaseFilter.cpp',
TOPSRCDIR + '/media/webrtc/trunk/webrtc/modules/video_capture/windows/BaseInputPin.cpp',
TOPSRCDIR + '/media/webrtc/trunk/webrtc/modules/video_capture/windows/BasePin.cpp',
TOPSRCDIR + '/media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp',
]
CPP_SOURCES += [ '%s/%s' % (TOPSRCDIR, p) for p in [
'media/webrtc/trunk/webrtc/modules/video_capture/windows/BaseFilter.cpp',
'media/webrtc/trunk/webrtc/modules/video_capture/windows/BaseInputPin.cpp',
'media/webrtc/trunk/webrtc/modules/video_capture/windows/BasePin.cpp',
'media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp',
]]
FAIL_ON_WARNINGS = True

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

@ -143,7 +143,7 @@ bool GStreamerFormatHelper::CanHandleMediaType(const nsACString& aMIMEType,
}
const char *type;
NS_CStringGetData(aMIMEType, &type, NULL);
NS_CStringGetData(aMIMEType, &type, nullptr);
GstCaps *caps;
if (aCodecs && !aCodecs->IsEmpty()) {

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

@ -44,7 +44,7 @@ load_gstreamer()
return true;
}
void *gstreamerLib = NULL;
void *gstreamerLib = nullptr;
guint major = 0;
guint minor = 0;
guint micro, nano;

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

@ -49,7 +49,7 @@ gst_moz_video_buffer_copy(GstMozVideoBuffer* self)
{
GstMozVideoBuffer* copy;
g_return_val_if_fail(GST_IS_MOZ_VIDEO_BUFFER(self), NULL);
g_return_val_if_fail(GST_IS_MOZ_VIDEO_BUFFER(self), nullptr);
copy = gst_moz_video_buffer_new();
@ -95,7 +95,7 @@ gst_moz_video_buffer_set_data(GstMozVideoBuffer* self, GstMozVideoBufferData* da
GstMozVideoBufferData*
gst_moz_video_buffer_get_data(const GstMozVideoBuffer* self)
{
g_return_val_if_fail(GST_IS_MOZ_VIDEO_BUFFER(self), NULL);
g_return_val_if_fail(GST_IS_MOZ_VIDEO_BUFFER(self), nullptr);
return self->data;
}

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

@ -199,7 +199,7 @@ void GStreamerReader::PlayBinSourceSetupCb(GstElement* aPlayBin,
GstElement *source;
GStreamerReader* reader = reinterpret_cast<GStreamerReader*>(aUserData);
g_object_get(aPlayBin, "source", &source, NULL);
g_object_get(aPlayBin, "source", &source, nullptr);
reader->PlayBinSourceSetup(GST_APP_SRC(source));
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше