Merge m-c to fx-team on a CLOSED TREE

This commit is contained in:
Wes Kocher 2014-08-05 17:38:06 -07:00
commit 659f33fb19
346 changed files with 3308 additions and 2130 deletions

View File

@ -17,9 +17,10 @@
- (NSString*)title
{
nsAutoString title;
mozilla::ErrorResult rv;
// XXX use the flattening API when there are available
// see bug 768298
mGeckoAccessible->GetContent()->GetTextContent(title);
mGeckoAccessible->GetContent()->GetTextContent(title, rv);
return nsCocoaUtils::ToNSString(title);
}

View File

@ -19,8 +19,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="227354333a185180b85471f2cc6abfb029e44718"/>

View File

@ -17,8 +17,8 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="999e945b85c578c503ad445c2285940f16aacdae">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>

View File

@ -19,8 +19,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="227354333a185180b85471f2cc6abfb029e44718"/>

View File

@ -17,8 +17,8 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "cf6d955a1703c6b7a947d0f01cb60955e7e87b0d",
"revision": "04973907d6a5b55c69159bf8b77994bf475b3d65",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,8 +17,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>

View File

@ -15,8 +15,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>

View File

@ -17,8 +17,8 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>

View File

@ -17,8 +17,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d85bbae28dd9ab9679b42d8d37c84810059e097c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2249037c79fda1d2eede2d085716577d5357e796"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="88295e1ec6d52bd63d45ea0e3673a3f933f4a6b9"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cff8f990433810780088c545641c3110d956949f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>

View File

@ -12,6 +12,9 @@ Cu.import("resource://gre/modules/FxAccounts.jsm");
let fxAccountsCommon = {};
Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon);
// for master-password utilities
Cu.import("resource://services-sync/util.js");
const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash";
const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog";
@ -104,6 +107,12 @@ let wrapper = {
return;
}
// If a master-password is enabled, we want to encourage the user to
// unlock it. Things still work if not, but the user will probably need
// to re-auth next startup (in which case we will get here again and
// re-prompt)
Utils.ensureMPUnlocked();
let iframe = document.getElementById("remote");
this.iframe = iframe;
iframe.addEventListener("load", this);

View File

@ -52,7 +52,7 @@ ul {
}
@media (max-width: 675px) {
#errorTitle {
#errorTitleText {
padding-top: 0;
background-image: none;
-moz-padding-start: 0;

View File

@ -4,20 +4,6 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
let service = Cc["@mozilla.org/weave/service;1"]
.getService(Ci.nsISupports)
.wrappedJSObject;
if (!service.allowPasswordsEngine) {
let checkbox = document.getElementById("fxa-pweng-chk");
checkbox.checked = false;
checkbox.disabled = true;
}
addEventListener("dialogaccept", function () {
let pane = document.getElementById("sync-customize-pane");
pane.writePreferences(true);

View File

@ -45,8 +45,7 @@
<checkbox label="&engine.bookmarks.label;"
accesskey="&engine.bookmarks.accesskey;"
preference="engine.bookmarks"/>
<checkbox id="fxa-pweng-chk"
label="&engine.passwords.label;"
<checkbox label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
preference="engine.passwords"/>
<checkbox label="&engine.history.label;"

View File

@ -87,12 +87,6 @@ let gSyncUtils = {
this._openLink(Weave.Svc.Prefs.get(root + "privacyURL"));
},
openMPInfoPage: function (event) {
event.stopPropagation();
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
this._openLink(baseURL + "sync-master-password");
},
openFirstSyncProgressPage: function () {
this._openLink("about:sync-progress");
},

View File

@ -782,9 +782,7 @@ nsDefaultCommandLineHandler.prototype = {
Components.utils.reportError(e);
}
count = cmdLine.length;
for (i = 0; i < count; ++i) {
for (let i = 0; i < cmdLine.length; ++i) {
var curarg = cmdLine.getArgument(i);
if (curarg.match(/^-/)) {
Components.utils.reportError("Warning: unrecognized command line flag " + curarg + "\n");

View File

@ -154,17 +154,6 @@ let gSyncPane = {
for (let checkbox of engines.querySelectorAll("checkbox")) {
checkbox.disabled = enginesListDisabled;
}
let checkbox = document.getElementById("fxa-pweng-chk");
let help = document.getElementById("fxa-pweng-help");
let allowPasswordsEngine = service.allowPasswordsEngine;
if (!allowPasswordsEngine) {
checkbox.checked = false;
}
checkbox.disabled = !allowPasswordsEngine || enginesListDisabled;
help.hidden = allowPasswordsEngine || enginesListDisabled;
});
// If fxAccountEnabled is false and we are in a "not configured" state,
// then fxAccounts is probably fully disabled rather than just unconfigured,

View File

@ -276,20 +276,9 @@
<checkbox label="&engine.bookmarks.label;"
accesskey="&engine.bookmarks.accesskey;"
preference="engine.bookmarks"/>
<hbox>
<checkbox id="fxa-pweng-chk"
label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
preference="engine.passwords"/>
<vbox id="fxa-pweng-help">
<spacer flex="1"/>
<hbox id="fxa-pweng-help-link">
<image onclick="gSyncUtils.openMPInfoPage(event);" />
</hbox>
<spacer flex="1"/>
</vbox>
</hbox>
<checkbox label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
preference="engine.passwords"/>
<checkbox label="&engine.history.label;"
accesskey="&engine.history.accesskey;"
preference="engine.history"/>

View File

@ -154,17 +154,6 @@ let gSyncPane = {
for (let checkbox of engines.querySelectorAll("checkbox")) {
checkbox.disabled = enginesListDisabled;
}
let checkbox = document.getElementById("fxa-pweng-chk");
let help = document.getElementById("fxa-pweng-help");
let allowPasswordsEngine = service.allowPasswordsEngine;
if (!allowPasswordsEngine) {
checkbox.checked = false;
}
checkbox.disabled = !allowPasswordsEngine || enginesListDisabled;
help.hidden = allowPasswordsEngine || enginesListDisabled;
});
// If fxAccountEnabled is false and we are in a "not configured" state,
// then fxAccounts is probably fully disabled rather than just unconfigured,

View File

@ -265,20 +265,9 @@
<checkbox label="&engine.bookmarks.label;"
accesskey="&engine.bookmarks.accesskey;"
preference="engine.bookmarks"/>
<hbox>
<checkbox id="fxa-pweng-chk"
label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
preference="engine.passwords"/>
<vbox id="fxa-pweng-help">
<spacer flex="1"/>
<hbox id="fxa-pweng-help-link">
<image onclick="gSyncUtils.openMPInfoPage(event);" />
</hbox>
<spacer flex="1"/>
</vbox>
</hbox>
<checkbox label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
preference="engine.passwords"/>
<checkbox label="&engine.history.label;"
accesskey="&engine.history.accesskey;"
preference="engine.history"/>

View File

@ -171,12 +171,4 @@ label.small {
margin-bottom: 0.6em;
}
#fxa-pweng-help-link > label {
margin: 0;
}
#fxa-pweng-help-link > image {
list-style-image: url("chrome://global/skin/icons/question-16.png");
}
%endif

View File

@ -233,20 +233,4 @@ html|a.inline-link:-moz-focusring {
margin-bottom: 0.6em;
}
#fxa-pweng-help-link > label {
margin: 0;
}
#fxa-pweng-help-link > image {
width: 16px;
height: 16px;
list-style-image: url("chrome://global/skin/icons/question-16.png");
}
@media (min-resolution: 2dppx) {
#fxa-pweng-help-link > image {
list-style-image: url("chrome://global/skin/icons/question-32.png");
}
}
%endif

View File

@ -161,12 +161,4 @@ label.small {
margin-bottom: 0.6em;
}
#fxa-pweng-help-link > label {
margin: 0;
}
#fxa-pweng-help-link > image {
list-style-image: url("chrome://global/skin/icons/question-16.png");
}
%endif

View File

@ -33,6 +33,9 @@ gyp_vars = {
# saves 4MB when webrtc_trace is off
'enable_lazy_trace_alloc': 0,
'use_x11': 1 if CONFIG['MOZ_X11'] else 0,
'use_glib': 1 if CONFIG['GLIB_LIBS'] else 0,
# turn off mandatory use of NEON and instead use NEON detection
'arm_neon': 0,
'arm_neon_optional': 1,

View File

@ -139,7 +139,7 @@ class Element : public FragmentOrElement
{
public:
#ifdef MOZILLA_INTERNAL_API
Element(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo) :
explicit Element(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo) :
FragmentOrElement(aNodeInfo),
mState(NS_EVENT_STATE_MOZ_READONLY)
{
@ -1213,7 +1213,7 @@ private:
class DestinationInsertionPointList : public nsINodeList
{
public:
DestinationInsertionPointList(Element* aElement);
explicit DestinationInsertionPointList(Element* aElement);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DestinationInsertionPointList)

View File

@ -48,7 +48,7 @@ class Element;
class nsChildContentList MOZ_FINAL : public nsINodeList
{
public:
nsChildContentList(nsINode* aNode)
explicit nsChildContentList(nsINode* aNode)
: mNode(aNode)
{
SetIsDOMBinding();
@ -96,7 +96,7 @@ public:
NS_DECL_NSIDOMXPATHNSRESOLVER
nsNode3Tearoff(nsINode *aNode) : mNode(aNode)
explicit nsNode3Tearoff(nsINode *aNode) : mNode(aNode)
{
}
@ -114,7 +114,7 @@ private:
class nsNodeWeakReference MOZ_FINAL : public nsIWeakReference
{
public:
nsNodeWeakReference(nsINode* aNode)
explicit nsNodeWeakReference(nsINode* aNode)
: mNode(aNode)
{
}
@ -143,7 +143,7 @@ private:
class nsNodeSupportsWeakRefTearoff MOZ_FINAL : public nsISupportsWeakReference
{
public:
nsNodeSupportsWeakRefTearoff(nsINode* aNode)
explicit nsNodeSupportsWeakRefTearoff(nsINode* aNode)
: mNode(aNode)
{
}
@ -175,8 +175,8 @@ class UndoManager;
class FragmentOrElement : public nsIContent
{
public:
FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
explicit FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -190,7 +190,8 @@ public:
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
bool aNotify) MOZ_OVERRIDE;
virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE;
virtual void GetTextContentInternal(nsAString& aTextContent) MOZ_OVERRIDE;
virtual void GetTextContentInternal(nsAString& aTextContent,
mozilla::ErrorResult& aError) MOZ_OVERRIDE;
virtual void SetTextContentInternal(const nsAString& aTextContent,
mozilla::ErrorResult& aError) MOZ_OVERRIDE;

View File

@ -754,7 +754,7 @@ class nsDOMFileList MOZ_FINAL : public nsIDOMFileList,
~nsDOMFileList() {}
public:
nsDOMFileList(nsISupports *aParent) : mParent(aParent)
explicit nsDOMFileList(nsISupports *aParent) : mParent(aParent)
{
SetIsDOMBinding();
}

View File

@ -54,7 +54,7 @@ public:
// If you're using the external API, the only thing you can know about
// nsIContent is that it exists with an IID
nsIContent(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
explicit nsIContent(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsINode(aNodeInfo)
{
MOZ_ASSERT(mNodeInfo);

View File

@ -688,7 +688,7 @@ private:
class SelectorCacheKey
{
public:
SelectorCacheKey(const nsAString& aString) : mKey(aString)
explicit SelectorCacheKey(const nsAString& aString) : mKey(aString)
{
MOZ_COUNT_CTOR(SelectorCacheKey);
}
@ -2728,7 +2728,7 @@ private:
class MOZ_STACK_CLASS nsAutoSyncOperation
{
public:
nsAutoSyncOperation(nsIDocument* aDocument);
explicit nsAutoSyncOperation(nsIDocument* aDocument);
~nsAutoSyncOperation();
private:
nsCOMArray<nsIDocument> mDocuments;

View File

@ -337,7 +337,7 @@ public:
friend class nsAttrAndChildArray;
#ifdef MOZILLA_INTERNAL_API
nsINode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
explicit nsINode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: mNodeInfo(aNodeInfo),
mParent(nullptr),
mBoolFlags(0),
@ -1136,9 +1136,10 @@ protected:
}
public:
void GetTextContent(nsAString& aTextContent)
void GetTextContent(nsAString& aTextContent,
mozilla::ErrorResult& aError)
{
GetTextContentInternal(aTextContent);
GetTextContentInternal(aTextContent, aError);
}
void SetTextContent(const nsAString& aTextContent,
mozilla::ErrorResult& aError)
@ -1749,7 +1750,8 @@ protected:
return IsEditableInternal();
}
virtual void GetTextContentInternal(nsAString& aTextContent);
virtual void GetTextContentInternal(nsAString& aTextContent,
mozilla::ErrorResult& aError);
virtual void SetTextContentInternal(const nsAString& aTextContent,
mozilla::ErrorResult& aError)
{
@ -2032,8 +2034,9 @@ ToCanonicalSupports(nsINode* aPointer)
} \
NS_IMETHOD GetTextContent(nsAString& aTextContent) __VA_ARGS__ \
{ \
nsINode::GetTextContent(aTextContent); \
return NS_OK; \
mozilla::ErrorResult rv; \
nsINode::GetTextContent(aTextContent, rv); \
return rv.ErrorCode(); \
} \
NS_IMETHOD SetTextContent(const nsAString& aTextContent) __VA_ARGS__ \
{ \

View File

@ -20,7 +20,7 @@ public:
typedef const nsAString* KeyType;
typedef const nsAString* KeyTypePointer;
nsNameSpaceKey(KeyTypePointer aKey) : mKey(aKey)
explicit nsNameSpaceKey(KeyTypePointer aKey) : mKey(aKey)
{
}
nsNameSpaceKey(const nsNameSpaceKey& toCopy) : mKey(toCopy.mKey)

View File

@ -302,7 +302,8 @@ Attr::GetBaseURI(bool aTryUseXHRDocBaseURI) const
}
void
Attr::GetTextContentInternal(nsAString& aTextContent)
Attr::GetTextContentInternal(nsAString& aTextContent,
ErrorResult& aError)
{
OwnerDoc()->WarnOnceAbout(nsIDocument::eTextContent);

View File

@ -42,7 +42,8 @@ public:
// nsIDOMNode interface
NS_FORWARD_NSIDOMNODE_TO_NSINODE
virtual void GetTextContentInternal(nsAString& aTextContent) MOZ_OVERRIDE;
virtual void GetTextContentInternal(nsAString& aTextContent,
ErrorResult& aError) MOZ_OVERRIDE;
virtual void SetTextContentInternal(const nsAString& aTextContent,
ErrorResult& aError) MOZ_OVERRIDE;
virtual void GetNodeValueInternal(nsAString& aNodeValue) MOZ_OVERRIDE;

View File

@ -33,7 +33,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectReadOnly)
DOMRectReadOnly(nsISupports* aParent)
explicit DOMRectReadOnly(nsISupports* aParent)
: mParent(aParent)
{
SetIsDOMBinding();
@ -80,8 +80,8 @@ class DOMRect MOZ_FINAL : public DOMRectReadOnly
, public nsIDOMClientRect
{
public:
DOMRect(nsISupports* aParent, double aX = 0, double aY = 0,
double aWidth = 0, double aHeight = 0)
explicit DOMRect(nsISupports* aParent, double aX = 0, double aY = 0,
double aWidth = 0, double aHeight = 0)
: DOMRectReadOnly(aParent)
, mX(aX)
, mY(aY)
@ -150,7 +150,7 @@ class DOMRectList MOZ_FINAL : public nsIDOMClientRectList,
~DOMRectList() {}
public:
DOMRectList(nsISupports *aParent) : mParent(aParent)
explicit DOMRectList(nsISupports *aParent) : mParent(aParent)
{
SetIsDOMBinding();
}

View File

@ -1102,10 +1102,12 @@ FragmentOrElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
}
void
FragmentOrElement::GetTextContentInternal(nsAString& aTextContent)
FragmentOrElement::GetTextContentInternal(nsAString& aTextContent,
ErrorResult& aError)
{
if(!nsContentUtils::GetNodeTextContent(this, true, aTextContent))
NS_RUNTIMEABORT("OOM");
if(!nsContentUtils::GetNodeTextContent(this, true, aTextContent)) {
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
}
}
void

View File

@ -67,7 +67,7 @@ struct ImageValue;
*/
class nsCheapString : public nsString {
public:
nsCheapString(nsStringBuffer* aBuf)
explicit nsCheapString(nsStringBuffer* aBuf)
{
if (aBuf)
aBuf->ToString(aBuf->StorageSize()/sizeof(char16_t) - 1, *this);

View File

@ -55,7 +55,7 @@ public:
typedef const nsAttrKey& KeyType;
typedef const nsAttrKey* KeyTypePointer;
nsAttrHashKey(KeyTypePointer aKey) : mKey(*aKey) {}
explicit nsAttrHashKey(KeyTypePointer aKey) : mKey(*aKey) {}
nsAttrHashKey(const nsAttrHashKey& aCopy) : mKey(aCopy.mKey) {}
~nsAttrHashKey() {}
@ -89,7 +89,7 @@ public:
typedef mozilla::dom::Element Element;
typedef mozilla::ErrorResult ErrorResult;
nsDOMAttributeMap(Element *aContent);
explicit nsDOMAttributeMap(Element *aContent);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMAttributeMap)

View File

@ -2326,7 +2326,7 @@ nsFrameLoader::DoSendAsyncMessage(JSContext* aCx,
return false;
}
return tabParent->SendAsyncMessage(nsString(aMessage), data, cpows,
aPrincipal);
IPC::Principal(aPrincipal));
}
if (mChildMessageManager) {

View File

@ -1729,10 +1729,10 @@ public:
}
if (aIsSync) {
return cc->SendSyncMessage(PromiseFlatString(aMessage), data, cpows,
aPrincipal, aJSONRetVal);
IPC::Principal(aPrincipal), aJSONRetVal);
}
return cc->CallRpcMessage(PromiseFlatString(aMessage), data, cpows,
aPrincipal, aJSONRetVal);
IPC::Principal(aPrincipal), aJSONRetVal);
}
virtual bool DoSendAsyncMessage(JSContext* aCx,
@ -1755,7 +1755,7 @@ public:
return false;
}
return cc->SendAsyncMessage(PromiseFlatString(aMessage), data, cpows,
aPrincipal);
IPC::Principal(aPrincipal));
}
};

View File

@ -93,7 +93,8 @@ public:
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
bool aNotify) MOZ_OVERRIDE;
virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE;
virtual void GetTextContentInternal(nsAString& aTextContent) MOZ_OVERRIDE
virtual void GetTextContentInternal(nsAString& aTextContent,
mozilla::ErrorResult& aError) MOZ_OVERRIDE
{
GetNodeValue(aTextContent);
}

View File

@ -380,7 +380,7 @@ nsINode::ChildNodes()
}
void
nsINode::GetTextContentInternal(nsAString& aTextContent)
nsINode::GetTextContentInternal(nsAString& aTextContent, ErrorResult& aError)
{
SetDOMStringToNull(aTextContent);
}

View File

@ -28,7 +28,7 @@ class nsMappedAttributeElement : public nsMappedAttributeElementBase
protected:
nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
explicit nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsMappedAttributeElementBase(aNodeInfo)
{}

View File

@ -52,8 +52,8 @@ public:
// These are the types of objects that can own properties. No object should
// inherit more then one of these classes.
// To add support for more types just add to this list.
nsPropertyOwner(const nsINode* aObject) : mObject(aObject) {}
nsPropertyOwner(const nsIFrame* aObject) : mObject(aObject) {}
MOZ_IMPLICIT nsPropertyOwner(const nsINode* aObject) : mObject(aObject) {}
MOZ_IMPLICIT nsPropertyOwner(const nsIFrame* aObject) : mObject(aObject) {}
operator const void*() { return mObject; }
const void* get() { return mObject; }

View File

@ -41,7 +41,7 @@ class nsRange MOZ_FINAL : public nsIDOMRange,
virtual ~nsRange();
public:
nsRange(nsINode* aNode)
explicit nsRange(nsINode* aNode)
: mRoot(nullptr)
, mStartOffset(0)
, mEndOffset(0)
@ -290,7 +290,7 @@ protected:
struct MOZ_STACK_CLASS AutoInvalidateSelection
{
AutoInvalidateSelection(nsRange* aRange) : mRange(aRange)
explicit AutoInvalidateSelection(nsRange* aRange) : mRange(aRange)
{
#ifdef DEBUG
mWasInSelection = mRange->IsInSelection();

View File

@ -30,7 +30,7 @@ class nsStyledElementNotElementCSSInlineStyle : public nsStyledElementBase
protected:
inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
inline explicit nsStyledElementNotElementCSSInlineStyle(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsStyledElementBase(aNodeInfo)
{}
@ -72,7 +72,7 @@ protected:
class nsStyledElement : public nsStyledElementNotElementCSSInlineStyle {
protected:
inline nsStyledElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
inline explicit nsStyledElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsStyledElementNotElementCSSInlineStyle(aNodeInfo)
{}
};

View File

@ -113,7 +113,7 @@ class nsXHREventTarget : public mozilla::DOMEventTargetHelper,
public nsIXMLHttpRequestEventTarget
{
protected:
nsXHREventTarget(mozilla::DOMEventTargetHelper* aOwner)
explicit nsXHREventTarget(mozilla::DOMEventTargetHelper* aOwner)
: mozilla::DOMEventTargetHelper(aOwner)
{
}
@ -151,7 +151,7 @@ class nsXMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget,
public nsIXMLHttpRequestUpload
{
public:
nsXMLHttpRequestUpload(mozilla::DOMEventTargetHelper* aOwner)
explicit nsXMLHttpRequestUpload(mozilla::DOMEventTargetHelper* aOwner)
: nsXHREventTarget(aOwner)
{
}
@ -343,31 +343,31 @@ private:
RequestBody() : mType(Uninitialized)
{
}
RequestBody(const mozilla::dom::ArrayBuffer* aArrayBuffer) : mType(ArrayBuffer)
explicit RequestBody(const mozilla::dom::ArrayBuffer* aArrayBuffer) : mType(ArrayBuffer)
{
mValue.mArrayBuffer = aArrayBuffer;
}
RequestBody(const mozilla::dom::ArrayBufferView* aArrayBufferView) : mType(ArrayBufferView)
explicit RequestBody(const mozilla::dom::ArrayBufferView* aArrayBufferView) : mType(ArrayBufferView)
{
mValue.mArrayBufferView = aArrayBufferView;
}
RequestBody(nsIDOMBlob* aBlob) : mType(Blob)
explicit RequestBody(nsIDOMBlob* aBlob) : mType(Blob)
{
mValue.mBlob = aBlob;
}
RequestBody(nsIDocument* aDocument) : mType(Document)
explicit RequestBody(nsIDocument* aDocument) : mType(Document)
{
mValue.mDocument = aDocument;
}
RequestBody(const nsAString& aString) : mType(DOMString)
explicit RequestBody(const nsAString& aString) : mType(DOMString)
{
mValue.mString = &aString;
}
RequestBody(nsFormData& aFormData) : mType(FormData)
explicit RequestBody(nsFormData& aFormData) : mType(FormData)
{
mValue.mFormData = &aFormData;
}
RequestBody(nsIInputStream* aStream) : mType(InputStream)
explicit RequestBody(nsIInputStream* aStream) : mType(InputStream)
{
mValue.mStream = aStream;
}
@ -809,7 +809,7 @@ class nsXMLHttpRequestXPCOMifier MOZ_FINAL : public nsIStreamListener,
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpRequestXPCOMifier,
nsIStreamListener)
nsXMLHttpRequestXPCOMifier(nsXMLHttpRequest* aXHR) :
explicit nsXMLHttpRequestXPCOMifier(nsXMLHttpRequest* aXHR) :
mXHR(aXHR)
{
}
@ -847,7 +847,7 @@ public:
mXHR = nullptr;
return NS_OK;
}
nsXHRParseEndListener(nsIXMLHttpRequest* aXHR)
explicit nsXHRParseEndListener(nsIXMLHttpRequest* aXHR)
: mXHR(do_GetWeakReference(aXHR)) {}
private:
virtual ~nsXHRParseEndListener() {}

View File

@ -47,7 +47,7 @@ class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement,
typedef layers::LayerManager LayerManager;
public:
HTMLCanvasElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLCanvasElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLCanvasElement, canvas)

View File

@ -3895,6 +3895,11 @@ void HTMLMediaElement::UpdateAudioChannelPlayingState()
if (playingThroughTheAudioChannel != mPlayingThroughTheAudioChannel) {
mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;
// If we are not playing, we don't need to create a new audioChannelAgent.
if (!mAudioChannelAgent && !mPlayingThroughTheAudioChannel) {
return;
}
if (!mAudioChannelAgent) {
nsresult rv;
mAudioChannelAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1", &rv);

View File

@ -37,7 +37,8 @@ HTMLTimeElement::GetItemValueText(nsAString& text)
if (HasAttr(kNameSpaceID_None, nsGkAtoms::datetime)) {
GetDateTime(text);
} else {
GetTextContentInternal(text);
ErrorResult rv;
GetTextContentInternal(text, rv);
}
}

View File

@ -75,7 +75,7 @@ public:
}
protected:
ValidityState(nsIConstraintValidation* aConstraintValidation);
explicit ValidityState(nsIConstraintValidation* aConstraintValidation);
/**
* Helper function to get a validity state from constraint validation instance.

View File

@ -3126,7 +3126,8 @@ nsGenericHTMLElement::SetItemValue(nsIVariant* aValue)
void
nsGenericHTMLElement::GetItemValueText(nsAString& text)
{
GetTextContentInternal(text);
ErrorResult rv;
GetTextContentInternal(text, rv);
}
void

View File

@ -51,7 +51,7 @@ class nsGenericHTMLElement : public nsGenericHTMLElementBase,
public nsIDOMHTMLElement
{
public:
nsGenericHTMLElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
explicit nsGenericHTMLElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElementBase(aNodeInfo),
mScrollgrab(false)
{
@ -1263,7 +1263,7 @@ class nsGenericHTMLFormElement : public nsGenericHTMLElement,
public nsIFormControl
{
public:
nsGenericHTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit nsGenericHTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
NS_DECL_ISUPPORTS_INHERITED
@ -1421,7 +1421,7 @@ protected:
class nsGenericHTMLFormElementWithState : public nsGenericHTMLFormElement
{
public:
nsGenericHTMLFormElementWithState(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit nsGenericHTMLFormElementWithState(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
/**
* Get the presentation state for a piece of content, or create it if it does

View File

@ -15,6 +15,8 @@ Test plugins with DOM full-screen API:
<head>
<title>Test for Bug 545812</title>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="enableTestPlugin.js"></script>
<script type="application/javascript" src="file_fullscreen-utils.js"></script>
<style>
body:-moz-full-screen, div:-moz-full-screen {

View File

@ -17,6 +17,7 @@ support-files =
bug392567.jar^headers^
bug441930_iframe.html
bug514856_iframe.html
enableTestPlugin.js
file_bug209275_1.html
file_bug209275_2.html
file_bug209275_3.html

View File

@ -8,6 +8,7 @@ Implement HTML5 sandbox attribute for IFRAMEs
<meta charset="utf-8">
<title>Test for Bug 341604 - plugins</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="enableTestPlugin.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<script type="application/javascript">

View File

@ -560,23 +560,29 @@ nsresult MediaDecoder::InitializeStateMachine(MediaDecoder* aCloneDonor)
DECODER_LOG(PR_LOG_WARNING, "Failed to init state machine!");
return NS_ERROR_FAILURE;
}
{
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
mDecoderStateMachine->SetDuration(mDuration);
mDecoderStateMachine->SetVolume(mInitialVolume);
mDecoderStateMachine->SetAudioCaptured(mInitialAudioCaptured);
SetPlaybackRate(mInitialPlaybackRate);
mDecoderStateMachine->SetPreservesPitch(mInitialPreservesPitch);
if (mMinimizePreroll) {
mDecoderStateMachine->SetMinimizePrerollUntilPlaybackStarts();
}
}
// If some parameters got set before the state machine got created,
// set them now
SetStateMachineParameters();
ChangeState(PLAY_STATE_LOADING);
return ScheduleStateMachineThread();
}
void MediaDecoder::SetStateMachineParameters()
{
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
mDecoderStateMachine->SetDuration(mDuration);
mDecoderStateMachine->SetVolume(mInitialVolume);
mDecoderStateMachine->SetAudioCaptured(mInitialAudioCaptured);
SetPlaybackRate(mInitialPlaybackRate);
mDecoderStateMachine->SetPreservesPitch(mInitialPreservesPitch);
if (mMinimizePreroll) {
mDecoderStateMachine->SetMinimizePrerollUntilPlaybackStarts();
}
}
void MediaDecoder::SetMinimizePrerollUntilPlaybackStarts()
{
MOZ_ASSERT(NS_IsMainThread());

View File

@ -1011,6 +1011,7 @@ public:
protected:
virtual ~MediaDecoder();
void SetStateMachineParameters();
/******
* The following members should be accessed with the decoder lock held.

View File

@ -310,7 +310,14 @@ MediaSourceDecoder::Load(nsIStreamListener**, MediaDecoder*)
return NS_ERROR_FAILURE;
}
return mDecoderStateMachine->Init(nullptr);
nsresult rv = mDecoderStateMachine->Init(nullptr);
NS_ENSURE_SUCCESS(rv, rv);
SetStateMachineParameters();
return rv;
}
nsresult

View File

@ -123,7 +123,7 @@ bool MediaCodecReader::TrackInputCopier::Copy(MediaBuffer* aSourceBuffer, sp<ABu
MediaCodecReader::Track::Track()
: mDurationUs(INT64_C(0))
, mInputIndex(sInvalidInputIndex)
, mEndOfStream(false)
, mInputEndOfStream(false)
, mSeekTimeUs(sInvalidTimestampUs)
, mFlushed(false)
{
@ -229,13 +229,14 @@ MediaCodecReader::DecodeAudioData()
// Get one audio output data from MediaCodec
CodecBufferInfo bufferInfo;
status_t status;
TimeStamp timeout = TimeStamp::Now() + TimeDuration::FromSeconds(sMaxAudioDecodeDurationS);
while (true) {
if (timeout < TimeStamp::Now()) {
return true; // Try it again later.
}
status_t status = GetCodecOutputData(mAudioTrack, bufferInfo, sInvalidTimestampUs, timeout);
if (status == OK) {
status = GetCodecOutputData(mAudioTrack, bufferInfo, sInvalidTimestampUs, timeout);
if (status == OK || status == ERROR_END_OF_STREAM) {
break;
} else if (status == -EAGAIN) {
return true; // Try it again later.
@ -272,6 +273,10 @@ MediaCodecReader::DecodeAudioData()
mAudioTrack.mCodec->releaseOutputBuffer(bufferInfo.mIndex);
if (status == ERROR_END_OF_STREAM) {
return false;
}
return result;
}
@ -291,13 +296,14 @@ MediaCodecReader::DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold)
// Get one video output data from MediaCodec
CodecBufferInfo bufferInfo;
status_t status;
TimeStamp timeout = TimeStamp::Now() + TimeDuration::FromSeconds(sMaxVideoDecodeDurationS);
while (true) {
if (timeout < TimeStamp::Now()) {
return true; // Try it again later.
}
status_t status = GetCodecOutputData(mVideoTrack, bufferInfo, threshold, timeout);
if (status == OK) {
status = GetCodecOutputData(mVideoTrack, bufferInfo, threshold, timeout);
if (status == OK || status == ERROR_END_OF_STREAM) {
break;
} else if (status == -EAGAIN) {
return true; // Try it again later.
@ -392,6 +398,10 @@ MediaCodecReader::DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold)
mVideoTrack.mCodec->releaseOutputBuffer(bufferInfo.mIndex);
if (status == ERROR_END_OF_STREAM) {
return false;
}
return result;
}
@ -475,8 +485,8 @@ MediaCodecReader::Seek(int64_t aTime,
}
}
mAudioTrack.mEndOfStream = false;
mVideoTrack.mEndOfStream = false;
mAudioTrack.mInputEndOfStream = false;
mVideoTrack.mInputEndOfStream = false;
mAudioTrack.mSeekTimeUs = aTime;
mVideoTrack.mSeekTimeUs = aTime;
@ -995,7 +1005,7 @@ MediaCodecReader::FillCodecInputData(Track &aTrack)
return UNKNOWN_ERROR;
}
if (aTrack.mEndOfStream) {
if (aTrack.mInputEndOfStream) {
return ERROR_END_OF_STREAM;
}
@ -1024,8 +1034,10 @@ MediaCodecReader::FillCodecInputData(Track &aTrack)
if (status == INFO_FORMAT_CHANGED) {
return INFO_FORMAT_CHANGED;
} else if (status == ERROR_END_OF_STREAM) {
aTrack.mEndOfStream = true;
aTrack.mCodec->signalEndOfInputStream();
aTrack.mInputEndOfStream = true;
status = aTrack.mCodec->queueInputBuffer(aTrack.mInputIndex.value(),
0, 0, 0,
MediaCodec::BUFFER_FLAG_EOS);
return ERROR_END_OF_STREAM;
} else if (status == -ETIMEDOUT) {
return OK; // try it later
@ -1036,7 +1048,7 @@ MediaCodecReader::FillCodecInputData(Track &aTrack)
}
// read() successes
aTrack.mEndOfStream = false;
aTrack.mInputEndOfStream = false;
aTrack.mSeekTimeUs = sInvalidTimestampUs;
sp<ABuffer> input_buffer = nullptr;
@ -1079,17 +1091,28 @@ MediaCodecReader::GetCodecOutputData(Track &aTrack,
// Try to fill more input buffers and then get one output buffer.
// FIXME: use callback from MediaCodec
status_t status = FillCodecInputData(aTrack);
int64_t duration = (int64_t)(aTimeout - TimeStamp::Now()).ToMicroseconds();
if (!IsValidDurationUs(duration)) {
return -EAGAIN;
}
if (status == OK) {
status = aTrack.mCodec->dequeueOutputBuffer(
&info.mIndex, &info.mOffset, &info.mSize, &info.mTimeUs, &info.mFlags, duration);
}
status_t status = OK;
while (status == OK || status == INFO_OUTPUT_BUFFERS_CHANGED ||
status == -EAGAIN || status == ERROR_END_OF_STREAM) {
// Try to fill more input buffers and then get one output buffer.
// FIXME: use callback from MediaCodec
status = FillCodecInputData(aTrack);
int64_t duration = (int64_t)(aTimeout - TimeStamp::Now()).ToMicroseconds();
if (!IsValidDurationUs(duration)) {
return -EAGAIN;
}
if (status == OK || status == ERROR_END_OF_STREAM) {
status = aTrack.mCodec->dequeueOutputBuffer(
&info.mIndex, &info.mOffset, &info.mSize, &info.mTimeUs, &info.mFlags, duration);
if (info.mFlags & MediaCodec::BUFFER_FLAG_EOS) {
aBuffer = info;
aBuffer.mBuffer = aTrack.mOutputBuffers[info.mIndex];
return ERROR_END_OF_STREAM;
}
}
while (status == OK || status == INFO_OUTPUT_BUFFERS_CHANGED || status == -EAGAIN) {
if (status == OK) {
if (!IsValidTimestampUs(aThreshold) || info.mTimeUs >= aThreshold) {
// Get a valid output buffer.
@ -1110,21 +1133,6 @@ MediaCodecReader::GetCodecOutputData(Track &aTrack,
// Don't let this loop run for too long. Try it again later.
return -EAGAIN;
}
// FIXME: use callback from MediaCodec
status = FillCodecInputData(aTrack);
if (status == INFO_OUTPUT_BUFFERS_CHANGED) {
continue;
} else if (status != OK) {
return status;
}
duration = (int64_t)(aTimeout - TimeStamp::Now()).ToMicroseconds();
if (!IsValidDurationUs(duration)) {
return -EAGAIN;
}
status = aTrack.mCodec->dequeueOutputBuffer(
&info.mIndex, &info.mOffset, &info.mSize, &info.mTimeUs, &info.mFlags, duration);
}
if (status != OK) {

View File

@ -109,7 +109,7 @@ protected:
// playback parameters
CheckedUint32 mInputIndex;
bool mEndOfStream;
bool mInputEndOfStream;
int64_t mSeekTimeUs;
bool mFlushed; // meaningless when mSeekTimeUs is invalid.
};

View File

@ -1,18 +1,18 @@
skip-if(B2G) load 0-timescale.html
skip-if(B2G) load 459439-1.html # bug 888557
skip-if(Android||B2G) load 0-timescale.html # bug 1048628 for Android
skip-if(Android||B2G) load 459439-1.html # bug 888557
load 466607-1.html
load 466945-1.html
load 468763-1.html
load 474744-1.html
HTTP load 481136-1.html # needs to be HTTP to recognize the ogg as an audio file?
load 493915-1.html
skip-if(Android) load 495794-1.html
load 492286-1.xhtml
skip-if(Android) load 495794-1.html
load 576612-1.html
skip-if(Android||B2G) load 691096-1.html # Android sound API can't handle playing large number of sounds at once, bug 852821 for B2G
load 752784-1.html
skip-if(Android||B2G) HTTP load 795892-1.html # load failed, bug 833371 for B2G
skip-if(Android||B2G) load 789075-1.html # load failed, bug 833371 for B2G
skip-if(Android||B2G) HTTP load 795892-1.html # load failed, bug 833371 for B2G
load 844563.html
load 846612.html
load 852838.html
@ -33,12 +33,12 @@ load 876215.html
load 876249.html
load 876252.html
load 876834.html
load 877527.html
load 877820.html
load 878014.html
load 878328.html
load 878407.html
load 878478.html
load 877527.html
load 880129.html
skip-if(B2G) load 880202.html # load failed, bug 908306 for B2G
load 880342-1.html
@ -47,8 +47,8 @@ load 880384.html
load 880404.html
load 880724.html
load 881775.html
load 882956.html
test-pref(media.webvtt.enabled,true) load 882549.html
load 882956.html
load 884459.html
load 889042.html
test-pref(media.webvtt.enabled,true) load 894104.html
@ -68,11 +68,11 @@ load 952756.html
load 966636.html
load 986901.html
load 990794.html
load 1015662.html
skip-if(Android||B2G) test-pref(media.navigator.permission.disabled,true) load 1028458.html
load buffer-source-ended-1.html
load offline-buffer-source-ended-1.html
HTTP load media-element-source-seek-1.html
skip-if(B2G) load oscillator-ended-1.html # intermittent B2G timeouts, bug 920338
skip-if(B2G) load oscillator-ended-2.html # intermittent B2G timeouts, bug 920338
load 1015662.html
load offline-buffer-source-ended-1.html
include ../../mediasource/test/crashtests/crashtests.list
test-pref(media.navigator.permission.disabled,true) load 1028458.html

View File

@ -211,19 +211,7 @@ support-files =
seek.webm
seek.webm^headers^
seek.yuv
seek1.js
seek10.js
seek11.js
seek12.js
seek13.js
seek2.js
seek3.js
seek4.js
seek5.js
seek6.js
seek7.js
seek8.js
seek9.js
seek_support.js
seekLies.sjs
seek_with_sound.ogg^headers^
short-video.ogv
@ -353,6 +341,7 @@ skip-if = toolkit == 'android' # bug 608634
[test_fastSeek-forwards.html]
[test_info_leak.html]
[test_invalid_reject.html]
[test_invalid_seek.html]
[test_load.html]
[test_load_candidates.html]
[test_load_same_resource.html]
@ -418,9 +407,19 @@ skip-if = true # bug 493692
[test_resume.html]
skip-if = true # bug 1021673
[test_seek_out_of_range.html]
[test_seek.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # Intermittent test failures in bug 1023564 and bug 981153
[test_seek2.html]
[test_seek-1.html]
[test_seek-2.html]
[test_seek-3.html]
[test_seek-4.html]
[test_seek-5.html]
[test_seek-6.html]
[test_seek-7.html]
[test_seek-8.html]
[test_seek-9.html]
[test_seek-10.html]
[test_seek-11.html]
[test_seek-12.html]
[test_seek-13.html]
[test_seekable1.html]
[test_seekable2.html]
[test_seekable3.html]

View File

@ -1,34 +0,0 @@
function test_seek7(v, seekTime, is, ok, finish) {
// If a NaN is passed to currentTime, make sure this is caught
// otherwise an infinite loop in the Ogg backend occurs.
var completed = false;
var thrown1 = false;
var thrown2 = false;
var thrown3 = false;
function startTest() {
if (completed)
return;
try {
v.currentTime = NaN;
} catch(e) {
thrown1 = true;
}
try {
v.currentTime = Math.random;
} catch(e) {
thrown3 = true;
}
completed = true;
ok(thrown1, "Setting currentTime to invalid value of NaN");
ok(thrown3, "Setting currentTime to invalid value of a function");
finish();
}
v.addEventListener("loadedmetadata", startTest, false);
}

View File

@ -1,16 +0,0 @@
function test_seek8(v, seekTime, is, ok, finish) {
function startTest() {
v.currentTime = 1000;
}
function seekEnded() {
ok(Math.abs(v.currentTime - v.duration) < 0.2,
"currentTime " + v.currentTime + " close to " + v.duration);
finish();
}
v.addEventListener("loadedmetadata", startTest, false);
v.addEventListener("seeked", seekEnded, false);
}

View File

@ -1,15 +0,0 @@
function test_seek9(v, seekTime, is, ok, finish) {
function startTest() {
v.currentTime = -1000;
}
function seekEnded() {
is(v.currentTime, 0, "currentTime clamped to 0");
finish();
}
v.addEventListener("loadedmetadata", startTest, false);
v.addEventListener("seeked", seekEnded, false);
}

View File

@ -1,28 +1,3 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek1.js"></script>
<script type="text/javascript" src="seek2.js"></script>
<script type="text/javascript" src="seek3.js"></script>
<script type="text/javascript" src="seek4.js"></script>
<script type="text/javascript" src="seek5.js"></script>
<script type="text/javascript" src="seek6.js"></script>
<script type="text/javascript" src="seek7.js"></script>
<script type="text/javascript" src="seek8.js"></script>
<script type="text/javascript" src="seek9.js"></script>
<script type="text/javascript" src="seek10.js"></script>
<script type="text/javascript" src="seek11.js"></script>
<script type="text/javascript" src="seek12.js"></script>
<script type="text/javascript" src="seek13.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.requestLongerTimeout(3);
var manager = new MediaTestManager;
@ -35,8 +10,6 @@ if (navigator.platform.startsWith("Win")) {
SimpleTest.expectAssertions(0, 5);
}
const NUM_SEEK_TESTS = 13;
function createTestArray() {
var tests = [];
var tmpVid = document.createElement("video");
@ -47,14 +20,12 @@ function createTestArray() {
continue;
}
for (var i = 1; i <= NUM_SEEK_TESTS; ++i) {
var t = new Object;
t.name = test.name;
t.type = test.type;
t.duration = test.duration;
t.number = i;
tests.push(t);
}
var t = new Object;
t.name = test.name;
t.type = test.type;
t.duration = test.duration;
t.number = SEEK_TEST_NUMBER;
tests.push(t);
}
return tests;
}
@ -82,10 +53,3 @@ function startTest(test, token) {
dump("SEEK-TEST: Started " + name + "\n");
window['test_seek' + test.number](v, test.duration/2, localIs, localOk, localFinish);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek test 2</title>
<title>Media test: invalide seek test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 1;
function test_seek1(v, seekTime, is, ok, finish) {
var startPassed = false;
@ -66,3 +85,10 @@ v.addEventListener("seeking", seekStarted, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 10;
function test_seek10(v, seekTime, is, ok, finish) {
// Test bug 523335 - ensure that if we close a stream while seeking, we
@ -28,3 +47,10 @@ v.addEventListener("loadeddata", startTest, false);
v.addEventListener("seeking", seeking, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,23 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
PARALLEL_TESTS = 1;
const SEEK_TEST_NUMBER = 11;
function test_seek11(v, seekTime, is, ok, finish) {
// Test for bug 476973, multiple seeks to the same position shouldn't cause problems.
@ -47,3 +67,10 @@ v.addEventListener("seeking", startSeeking, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 12;
function test_seek12(v, seekTime, is, ok, finish) {
var completed = false;
@ -31,3 +50,10 @@ v.addEventListener("loadedmetadata", startTest, false);
v.addEventListener("seeking", seekStarted, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 13;
function test_seek13(v, seekTime, is, ok, finish) {
var completed = false;
@ -44,3 +63,10 @@ v.addEventListener("seeking", seekStarted, false);
v.addEventListener("seeked", seekEnded, false);
v.addEventListener("ended", playbackEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,23 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
PARALLEL_TESTS = 1;
const SEEK_TEST_NUMBER = 2;
function test_seek2(v, seekTime, is, ok, finish) {
// Test seeking works if current time is set before video is
@ -47,3 +67,10 @@ v.addEventListener("seeking", seekStarted, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 3;
function test_seek3(v, seekTime, is, ok, finish) {
// Test seeking works if current time is set but video is not played.
@ -42,3 +61,10 @@ v.addEventListener("seeking", seekStarted, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 4;
function test_seek4(v, seekTime, is, ok, finish) {
// Test for a seek, followed by another seek before the first is complete.
@ -42,3 +61,10 @@ v.addEventListener("seeking", seekStarted, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 5;
function test_seek5(v, seekTime, is, ok, finish) {
// Test for a seek, followed by a play before the seek completes, ensure we play at the end of the seek.
@ -41,3 +60,10 @@ v.addEventListener("seeking", seekStarted, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -1,3 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 6;
function test_seek6(v, seekTime, is, ok, finish) {
// Test for bug identified by Chris Pearce in comment 40 on
@ -37,3 +56,10 @@ v.addEventListener("loadedmetadata", startTest, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,60 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 7;
function test_seek7(v, seekTime, is, ok, finish) {
// If a NaN is passed to currentTime, make sure this is caught
// otherwise an infinite loop in the Ogg backend occurs.
var completed = false;
var thrown1 = false;
var thrown2 = false;
var thrown3 = false;
function startTest() {
if (completed)
return;
try {
v.currentTime = NaN;
} catch(e) {
thrown1 = true;
}
try {
v.currentTime = Math.random;
} catch(e) {
thrown3 = true;
}
completed = true;
ok(thrown1, "Setting currentTime to invalid value of NaN");
ok(thrown3, "Setting currentTime to invalid value of a function");
finish();
}
v.addEventListener("loadedmetadata", startTest, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 8;
function test_seek8(v, seekTime, is, ok, finish) {
function startTest() {
v.currentTime = 1000;
}
function seekEnded() {
ok(Math.abs(v.currentTime - v.duration) < 0.2,
"currentTime " + v.currentTime + " close to " + v.duration);
finish();
}
v.addEventListener("loadedmetadata", startTest, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
<script type="text/javascript" src="seek_support.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// The data being used in these tests is specified in manifest.js.
// The functions to build the test array and to run a specific test are in
// seek_support.js.
const SEEK_TEST_NUMBER = 9;
function test_seek9(v, seekTime, is, ok, finish) {
function startTest() {
v.currentTime = -1000;
}
function seekEnded() {
is(v.currentTime, 0, "currentTime clamped to 0");
finish();
}
v.addEventListener("loadedmetadata", startTest, false);
v.addEventListener("seeked", seekEnded, false);
}
manager.runTests(createTestArray(), startTest);
</script>
</pre>
</body>
</html>

View File

@ -29,7 +29,7 @@ public:
nsresult Init();
protected:
nsDSURIContentListener(nsDocShell* aDocShell);
explicit nsDSURIContentListener(nsDocShell* aDocShell);
virtual ~nsDSURIContentListener();
void DropDocShellreference() {

View File

@ -665,7 +665,7 @@ protected:
class RestorePresentationEvent : public nsRunnable {
public:
NS_DECL_NSIRUNNABLE
RestorePresentationEvent(nsDocShell *ds) : mDocShell(ds) {}
explicit RestorePresentationEvent(nsDocShell *ds) : mDocShell(ds) {}
void Revoke() { mDocShell = nullptr; }
private:
nsRefPtr<nsDocShell> mDocShell;
@ -928,7 +928,7 @@ private:
public:
class InterfaceRequestorProxy : public nsIInterfaceRequestor {
public:
InterfaceRequestorProxy(nsIInterfaceRequestor* p);
explicit InterfaceRequestorProxy(nsIInterfaceRequestor* p);
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIINTERFACEREQUESTOR

View File

@ -20,7 +20,7 @@ class nsDocShellEditorData
{
public:
nsDocShellEditorData(nsIDocShell* inOwningDocShell);
explicit nsDocShellEditorData(nsIDocShell* inOwningDocShell);
~nsDocShellEditorData();
nsresult MakeEditable(bool inWaitForUriLoad);

View File

@ -42,7 +42,7 @@ protected:
public:
nsDocShellEnumerator(int32_t inEnumerationDirection);
explicit nsDocShellEnumerator(int32_t inEnumerationDirection);
// nsISupports
NS_DECL_ISUPPORTS

View File

@ -108,7 +108,7 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSISIMPLEENUMERATOR
nsSHEnumerator(nsSHistory * aHistory);
explicit nsSHEnumerator(nsSHistory * aHistory);
protected:
friend class nsSHistory;

View File

@ -80,9 +80,6 @@ AudioChannelAgent::InitInternal(nsIDOMWindow* aWindow, int32_t aChannelType,
nsIAudioChannelAgentCallback *aCallback,
bool aUseWeakRef, bool aWithVideo)
{
// We need the window only for IPC.
MOZ_ASSERT(aWindow || XRE_GetProcessType() == GeckoProcessType_Default);
// We syncd the enum of channel type between nsIAudioChannelAgent.idl and
// AudioChannelBinding.h the same.
MOZ_ASSERT(int(AUDIO_AGENT_CHANNEL_NORMAL) == int(AudioChannel::Normal) &&

View File

@ -44,7 +44,7 @@ public:
// aWindow can be null if this DOMError is not associated with a particular
// window.
DOMError(nsPIDOMWindow* aWindow);
explicit DOMError(nsPIDOMWindow* aWindow);
DOMError(nsPIDOMWindow* aWindow, nsresult aValue);

View File

@ -31,7 +31,7 @@ public:
static bool Enabled(JSContext* aCx, JSObject* aGlobal);
public:
MessageChannel(nsPIDOMWindow* aWindow);
explicit MessageChannel(nsPIDOMWindow* aWindow);
nsPIDOMWindow*
GetParentObject() const

View File

@ -28,7 +28,7 @@ class DispatchEventRunnable : public nsRunnable
friend class MessagePort;
public:
DispatchEventRunnable(MessagePort* aPort)
explicit DispatchEventRunnable(MessagePort* aPort)
: mPort(aPort)
{
}

View File

@ -20,7 +20,7 @@ class PostMessageRunnable;
class MessagePortBase : public DOMEventTargetHelper
{
protected:
MessagePortBase(nsPIDOMWindow* aWindow);
explicit MessagePortBase(nsPIDOMWindow* aWindow);
MessagePortBase();
public:
@ -61,7 +61,7 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MessagePort,
DOMEventTargetHelper)
MessagePort(nsPIDOMWindow* aWindow);
explicit MessagePort(nsPIDOMWindow* aWindow);
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;

View File

@ -58,7 +58,7 @@ class nsDOMWindowUtils MOZ_FINAL : public nsIDOMWindowUtils,
public nsSupportsWeakReference
{
public:
nsDOMWindowUtils(nsGlobalWindow *aWindow);
explicit nsDOMWindowUtils(nsGlobalWindow *aWindow);
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMWINDOWUTILS

View File

@ -710,7 +710,7 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
// disable selection mousedown state on activation
// XXXndeakin P3 not sure if this is necessary, but it doesn't hurt
nsRefPtr<nsFrameSelection> frameSelection = presShell->FrameSelection();
frameSelection->SetMouseDownState(false);
frameSelection->SetDragState(false);
}
Focus(currentWindow, currentFocus, 0, true, false, true, true);

View File

@ -8661,7 +8661,7 @@ nsGlobalWindow::EnterModalState()
if (activeShell) {
nsRefPtr<nsFrameSelection> frameSelection = activeShell->FrameSelection();
frameSelection->SetMouseDownState(false);
frameSelection->SetDragState(false);
}
}
}

View File

@ -523,7 +523,7 @@ public:
mozilla::ErrorResult& aRv);
// Object Management
nsGlobalWindow(nsGlobalWindow *aOuterWindow);
explicit nsGlobalWindow(nsGlobalWindow *aOuterWindow);
static nsGlobalWindow *FromSupports(nsISupports *supports)
{
@ -1666,7 +1666,7 @@ public:
// nsIDOMChromeWindow interface
NS_DECL_NSIDOMCHROMEWINDOW
nsGlobalChromeWindow(nsGlobalWindow *aOuterWindow)
explicit nsGlobalChromeWindow(nsGlobalWindow *aOuterWindow)
: nsGlobalWindow(aOuterWindow),
mGroupMessageManagers(1)
{
@ -1733,7 +1733,7 @@ class nsGlobalModalWindow : public nsGlobalWindow,
public nsIDOMModalContentWindow
{
public:
nsGlobalModalWindow(nsGlobalWindow *aOuterWindow)
explicit nsGlobalModalWindow(nsGlobalWindow *aOuterWindow)
: nsGlobalWindow(aOuterWindow)
{
mIsModalContentWindow = true;

View File

@ -741,7 +741,7 @@ protected:
// be null if and only if the created window itself is an outer
// window. In all other cases aOuterWindow should be the outer
// window for the inner window that is being created.
nsPIDOMWindow(nsPIDOMWindow *aOuterWindow);
explicit nsPIDOMWindow(nsPIDOMWindow *aOuterWindow);
~nsPIDOMWindow();
@ -858,7 +858,7 @@ class NS_AUTO_POPUP_STATE_PUSHER
{
public:
#ifdef MOZILLA_INTERNAL_API
NS_AUTO_POPUP_STATE_PUSHER(PopupControlState aState, bool aForce = false)
explicit NS_AUTO_POPUP_STATE_PUSHER(PopupControlState aState, bool aForce = false)
: mOldState(::PushPopupControlState(aState, aForce))
{
}

View File

@ -1448,6 +1448,7 @@ WrapNativeParent(JSContext* cx, T* p, nsWrapperCache* cache,
}
JS::Rooted<JSObject*> rootedParent(cx, parent);
JS::Rooted<JSObject*> xblScope(cx, xpc::GetXBLScope(cx, rootedParent));
NS_ENSURE_TRUE(xblScope, nullptr);
JSAutoCompartment ac(cx, xblScope);
if (NS_WARN_IF(!JS_WrapObject(cx, &rootedParent))) {
return nullptr;

View File

@ -10448,6 +10448,59 @@ def stripTrailingWhitespace(text):
lines = text.splitlines()
return '\n'.join(line.rstrip() for line in lines) + tail
class MemberProperties:
def __init__(self):
self.isGenericMethod = False
self.isCrossOriginMethod = False
self.isPromiseReturningMethod = False
self.isGenericGetter = False
self.isLenientGetter = False
self.isCrossOriginGetter = False
self.isGenericSetter = False
self.isLenientSetter = False
self.isCrossOriginSetter = False
self.isJsonifier = False
def memberProperties(m, descriptor):
props = MemberProperties()
if m.isMethod():
if m == descriptor.operations['Jsonifier']:
props.isGenericMethod = descriptor.needsSpecialGenericOps()
props.isJsonifier = True
elif (not m.isIdentifierLess() or m == descriptor.operations['Stringifier']):
if not m.isStatic() and descriptor.interface.hasInterfacePrototypeObject():
if m.returnsPromise() and descriptor.needsSpecialGenericOps():
props.isPromiseReturningMethod = True
if m.getExtendedAttribute("CrossOriginCallable"):
props.isCrossOriginMethod = True
elif descriptor.needsSpecialGenericOps():
props.isGenericMethod = True
elif m.isAttr():
if not m.isStatic() and descriptor.interface.hasInterfacePrototypeObject():
if m.hasLenientThis():
props.isLenientGetter = True
elif m.getExtendedAttribute("CrossOriginReadable"):
props.isCrossOriginGetter = True
elif descriptor.needsSpecialGenericOps():
props.isGenericGetter = True
if not m.readonly:
if not m.isStatic() and descriptor.interface.hasInterfacePrototypeObject():
if m.hasLenientThis():
props.isLenientSetter = True
elif IsCrossOriginWritable(m, descriptor):
props.isCrossOriginSetter = True
elif descriptor.needsSpecialGenericOps():
props.isGenericSetter = True
elif m.getExtendedAttribute("PutForwards"):
if IsCrossOriginWritable(m, descriptor):
props.isCrossOriginSetter = True
elif descriptor.needsSpecialGenericOps():
props.isGenericSetter = True
elif m.getExtendedAttribute("Replaceable"):
if descriptor.needsSpecialGenericOps():
props.isGenericSetter = True
return props
class CGDescriptor(CGThing):
def __init__(self, descriptor):
@ -10467,9 +10520,9 @@ class CGDescriptor(CGThing):
descriptor.nativeType))
# These are set to true if at least one non-static
# method/getter/setter or jsonifier exist on the interface.
(hasMethod, hasGetter, hasLenientGetter, hasSetter, hasJsonifier,
hasLenientSetter,
hasPromiseReturningMethod) = False, False, False, False, False, False, False
(hasMethod, hasGetter, hasLenientGetter, hasSetter, hasLenientSetter,
hasPromiseReturningMethod) = False, False, False, False, False, False
jsonifierMethod = None
crossOriginMethods, crossOriginGetters, crossOriginSetters = set(), set(), set()
for n in descriptor.interface.namedConstructors:
cgThings.append(CGClassConstructor(descriptor, n,
@ -10479,29 +10532,26 @@ class CGDescriptor(CGThing):
continue
if not isMaybeExposedIn(m, descriptor):
continue
if m.isMethod() and m == descriptor.operations['Jsonifier']:
hasJsonifier = True
hasMethod = descriptor.needsSpecialGenericOps()
jsonifierMethod = m
elif (m.isMethod() and
(not m.isIdentifierLess() or m == descriptor.operations['Stringifier'])):
if m.isStatic():
assert descriptor.interface.hasInterfaceObject()
cgThings.append(CGStaticMethod(descriptor, m))
if m.returnsPromise():
cgThings.append(CGStaticMethodJitinfo(m))
elif descriptor.interface.hasInterfacePrototypeObject():
specializedMethod = CGSpecializedMethod(descriptor, m)
cgThings.append(specializedMethod)
if m.returnsPromise():
if descriptor.needsSpecialGenericOps():
hasPromiseReturningMethod = True
cgThings.append(CGMethodPromiseWrapper(descriptor, specializedMethod))
cgThings.append(CGMemberJITInfo(descriptor, m))
if m.getExtendedAttribute("CrossOriginCallable"):
crossOriginMethods.add(m.identifier.name)
elif descriptor.needsSpecialGenericOps():
hasMethod = True
props = memberProperties(m, descriptor)
if m.isMethod():
if props.isJsonifier:
jsonifierMethod = m
elif not m.isIdentifierLess() or m == descriptor.operations['Stringifier']:
if m.isStatic():
assert descriptor.interface.hasInterfaceObject()
cgThings.append(CGStaticMethod(descriptor, m))
if m.returnsPromise():
cgThings.append(CGStaticMethodJitinfo(m))
elif descriptor.interface.hasInterfacePrototypeObject():
specializedMethod = CGSpecializedMethod(descriptor, m)
cgThings.append(specializedMethod)
if m.returnsPromise():
cgThings.append(CGMethodPromiseWrapper(descriptor, specializedMethod))
cgThings.append(CGMemberJITInfo(descriptor, m))
if props.isCrossOriginMethod:
crossOriginMethods.add(m.identifier.name)
elif m.isAttr():
if m.stringifier:
raise TypeError("Stringifier attributes not supported yet. "
@ -10512,12 +10562,8 @@ class CGDescriptor(CGThing):
cgThings.append(CGStaticGetter(descriptor, m))
elif descriptor.interface.hasInterfacePrototypeObject():
cgThings.append(CGSpecializedGetter(descriptor, m))
if m.hasLenientThis():
hasLenientGetter = True
elif m.getExtendedAttribute("CrossOriginReadable"):
if props.isCrossOriginGetter:
crossOriginGetters.add(m.identifier.name)
elif descriptor.needsSpecialGenericOps():
hasGetter = True
if not m.readonly:
for extAttr in ["PutForwards", "Replaceable"]:
if m.getExtendedAttribute(extAttr):
@ -10530,26 +10576,27 @@ class CGDescriptor(CGThing):
cgThings.append(CGStaticSetter(descriptor, m))
elif descriptor.interface.hasInterfacePrototypeObject():
cgThings.append(CGSpecializedSetter(descriptor, m))
if m.hasLenientThis():
hasLenientSetter = True
elif IsCrossOriginWritable(m, descriptor):
if props.isCrossOriginSetter:
crossOriginSetters.add(m.identifier.name)
elif descriptor.needsSpecialGenericOps():
hasSetter = True
elif m.getExtendedAttribute("PutForwards"):
cgThings.append(CGSpecializedForwardingSetter(descriptor, m))
if IsCrossOriginWritable(m, descriptor):
if props.isCrossOriginSetter:
crossOriginSetters.add(m.identifier.name)
elif descriptor.needsSpecialGenericOps():
hasSetter = True
elif m.getExtendedAttribute("Replaceable"):
cgThings.append(CGSpecializedReplaceableSetter(descriptor, m))
if descriptor.needsSpecialGenericOps():
hasSetter = True
if (not m.isStatic() and
descriptor.interface.hasInterfacePrototypeObject()):
cgThings.append(CGMemberJITInfo(descriptor, m))
if hasJsonifier:
hasMethod = hasMethod or props.isGenericMethod
hasPromiseReturningMethod = (hasPromiseReturningMethod or
props.isPromiseReturningMethod)
hasGetter = hasGetter or props.isGenericGetter
hasLenientGetter = hasLenientGetter or props.isLenientGetter
hasSetter = hasSetter or props.isGenericSetter
hasLenientSetter = hasLenientSetter or props.isLenientSetter
if jsonifierMethod:
cgThings.append(CGJsonifierMethod(descriptor, jsonifierMethod))
cgThings.append(CGMemberJITInfo(descriptor, jsonifierMethod))
if hasMethod:
@ -11603,10 +11650,30 @@ class CGBindingRoot(CGThing):
"""
def __init__(self, config, prefix, webIDLFile):
bindingHeaders = {}
bindingDeclareHeaders = dict.fromkeys((
'mozilla/dom/BindingDeclarations.h',
'mozilla/dom/Nullable.h',
'mozilla/ErrorResult.h',
),
True)
descriptors = config.getDescriptors(webIDLFile=webIDLFile,
hasInterfaceOrInterfacePrototypeObject=True,
skipGen=False)
def descriptorHasCrossOriginProperties(desc):
def hasCrossOriginProperty(m):
props = memberProperties(m, desc)
return (props.isCrossOriginMethod or
props.isCrossOriginGetter or
props.isCrossOriginSetter)
return any(hasCrossOriginProperty(m) for m in desc.interface.members)
bindingDeclareHeaders["jsapi.h"] = any(descriptorHasCrossOriginProperties(d) for d in descriptors)
bindingDeclareHeaders["jspubtd.h"] = not bindingDeclareHeaders["jsapi.h"]
bindingDeclareHeaders["js/RootingAPI.h"] = not bindingDeclareHeaders["jsapi.h"]
def descriptorRequiresPreferences(desc):
iface = desc.interface
return any(m.getExtendedAttribute("Pref") for m in iface.members + [iface])
@ -11647,6 +11714,7 @@ class CGBindingRoot(CGThing):
isCallback=True)
jsImplemented = config.getDescriptors(webIDLFile=webIDLFile,
isJSImplemented=True)
bindingDeclareHeaders["nsWeakReference.h"] = jsImplemented
bindingHeaders["nsPIDOMWindow.h"] = jsImplemented
bindingHeaders["AtomList.h"] = hasNonEmptyDictionaries or jsImplemented or callbackDescriptors
@ -11751,21 +11819,15 @@ class CGBindingRoot(CGThing):
bindingHeaders = [header
for header, include in bindingHeaders.iteritems()
if include]
declareIncludes = [
'mozilla/dom/BindingDeclarations.h',
'mozilla/dom/Nullable.h',
'mozilla/ErrorResult.h',
'jspubtd.h',
'js/RootingAPI.h',
]
if jsImplemented:
declareIncludes.append('nsWeakReference.h')
bindingDeclareHeaders = [header
for header, include in bindingDeclareHeaders.iteritems()
if include]
curr = CGHeaders(descriptors,
dictionaries,
mainCallbacks + workerCallbacks,
callbackDescriptors,
declareIncludes,
bindingDeclareHeaders,
bindingHeaders,
prefix,
curr,

View File

@ -233,7 +233,7 @@ class TypedArrayCreator
typedef nsTArray<typename TypedArrayType::element_type> ArrayType;
public:
TypedArrayCreator(const ArrayType& aArray)
explicit TypedArrayCreator(const ArrayType& aArray)
: mArray(aArray)
{}
@ -298,7 +298,7 @@ class MOZ_STACK_CLASS RootedTypedArray : public ArrayType,
private TypedArrayRooter<ArrayType>
{
public:
RootedTypedArray(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
explicit RootedTypedArray(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
ArrayType(),
TypedArrayRooter<ArrayType>(cx,
MOZ_THIS_IN_INITIALIZER_LIST()

View File

@ -168,23 +168,33 @@ nsDOMCameraControl::nsDOMCameraControl(uint32_t aCameraId,
// Create and initialize the underlying camera.
ICameraControl::Configuration config;
bool haveInitialConfig = false;
nsresult rv;
switch (aInitialConfig.mMode) {
case CameraMode::Picture:
config.mMode = ICameraControl::kPictureMode;
haveInitialConfig = true;
break;
case CameraMode::Video:
config.mMode = ICameraControl::kVideoMode;
haveInitialConfig = true;
break;
case CameraMode::Unspecified:
break;
default:
MOZ_ASSERT_UNREACHABLE("Unanticipated camera mode!");
break;
}
config.mPreviewSize.width = aInitialConfig.mPreviewSize.mWidth;
config.mPreviewSize.height = aInitialConfig.mPreviewSize.mHeight;
config.mRecorderProfile = aInitialConfig.mRecorderProfile;
if (haveInitialConfig) {
config.mPreviewSize.width = aInitialConfig.mPreviewSize.mWidth;
config.mPreviewSize.height = aInitialConfig.mPreviewSize.mHeight;
config.mRecorderProfile = aInitialConfig.mRecorderProfile;
}
mCameraControl = ICameraControl::Create(aCameraId);
mCurrentConfiguration = initialConfig.forget();
@ -201,7 +211,11 @@ nsDOMCameraControl::nsDOMCameraControl(uint32_t aCameraId,
mCameraControl->AddListener(mListener);
// Start the camera...
nsresult rv = mCameraControl->Start(&config);
if (haveInitialConfig) {
rv = mCameraControl->Start(&config);
} else {
rv = mCameraControl->Start();
}
if (NS_FAILED(rv)) {
mListener->OnUserError(DOMCameraControlListener::kInStartCamera, rv);
}

Some files were not shown because too many files have changed in this diff Show More