зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central and inbound
This commit is contained in:
Коммит
7644bb7745
|
@ -17,9 +17,10 @@
|
|||
- (NSString*)title
|
||||
{
|
||||
nsAutoString title;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -886,6 +886,10 @@ pref("network.sntp.timeout", 30); // In seconds.
|
|||
|
||||
// Enable dataStore
|
||||
pref("dom.datastore.enabled", true);
|
||||
// When an entry is changed, use two timers to fire system messages in a more
|
||||
// moderate pattern.
|
||||
pref("dom.datastore.sysMsgOnChangeShortTimeoutSec", 10);
|
||||
pref("dom.datastore.sysMsgOnChangeLongTimeoutSec", 60);
|
||||
|
||||
// DOM Inter-App Communication API.
|
||||
pref("dom.inter-app-communication-api.enabled", true);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -52,7 +52,7 @@ ul {
|
|||
}
|
||||
|
||||
@media (max-width: 675px) {
|
||||
#errorTitle {
|
||||
#errorTitleText {
|
||||
padding-top: 0;
|
||||
background-image: none;
|
||||
-moz-padding-start: 0;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;"
|
||||
|
|
|
@ -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");
|
||||
},
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -754,7 +754,7 @@ class nsDOMFileList MOZ_FINAL : public nsIDOMFileList,
|
|||
~nsDOMFileList() {}
|
||||
|
||||
public:
|
||||
nsDOMFileList(nsISupports *aParent) : mParent(aParent)
|
||||
explicit nsDOMFileList(nsISupports *aParent) : mParent(aParent)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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__ \
|
||||
{ \
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -302,7 +302,8 @@ Attr::GetBaseURI(bool aTryUseXHRDocBaseURI) const
|
|||
}
|
||||
|
||||
void
|
||||
Attr::GetTextContentInternal(nsAString& aTextContent)
|
||||
Attr::GetTextContentInternal(nsAString& aTextContent,
|
||||
ErrorResult& aError)
|
||||
{
|
||||
OwnerDoc()->WarnOnceAbout(nsIDocument::eTextContent);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -2326,7 +2326,7 @@ nsFrameLoader::DoSendAsyncMessage(JSContext* aCx,
|
|||
return false;
|
||||
}
|
||||
return tabParent->SendAsyncMessage(nsString(aMessage), data, cpows,
|
||||
aPrincipal);
|
||||
IPC::Principal(aPrincipal));
|
||||
}
|
||||
|
||||
if (mChildMessageManager) {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -380,7 +380,7 @@ nsINode::ChildNodes()
|
|||
}
|
||||
|
||||
void
|
||||
nsINode::GetTextContentInternal(nsAString& aTextContent)
|
||||
nsINode::GetTextContentInternal(nsAString& aTextContent, ErrorResult& aError)
|
||||
{
|
||||
SetDOMStringToNull(aTextContent);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{}
|
||||
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
{}
|
||||
};
|
||||
|
|
|
@ -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() {}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -37,7 +37,8 @@ HTMLTimeElement::GetItemValueText(nsAString& text)
|
|||
if (HasAttr(kNameSpaceID_None, nsGkAtoms::datetime)) {
|
||||
GetDateTime(text);
|
||||
} else {
|
||||
GetTextContentInternal(text);
|
||||
ErrorResult rv;
|
||||
GetTextContentInternal(text, rv);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
ValidityState(nsIConstraintValidation* aConstraintValidation);
|
||||
explicit ValidityState(nsIConstraintValidation* aConstraintValidation);
|
||||
|
||||
/**
|
||||
* Helper function to get a validity state from constraint validation instance.
|
||||
|
|
|
@ -3126,7 +3126,8 @@ nsGenericHTMLElement::SetItemValue(nsIVariant* aValue)
|
|||
void
|
||||
nsGenericHTMLElement::GetItemValueText(nsAString& text)
|
||||
{
|
||||
GetTextContentInternal(text);
|
||||
ErrorResult rv;
|
||||
GetTextContentInternal(text, rv);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -1011,6 +1011,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual ~MediaDecoder();
|
||||
void SetStateMachineParameters();
|
||||
|
||||
/******
|
||||
* The following members should be accessed with the decoder lock held.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -109,7 +109,7 @@ protected:
|
|||
|
||||
// playback parameters
|
||||
CheckedUint32 mInputIndex;
|
||||
bool mEndOfStream;
|
||||
bool mInputEndOfStream;
|
||||
int64_t mSeekTimeUs;
|
||||
bool mFlushed; // meaningless when mSeekTimeUs is invalid.
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
nsresult Init();
|
||||
|
||||
protected:
|
||||
nsDSURIContentListener(nsDocShell* aDocShell);
|
||||
explicit nsDSURIContentListener(nsDocShell* aDocShell);
|
||||
virtual ~nsDSURIContentListener();
|
||||
|
||||
void DropDocShellreference() {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class nsDocShellEditorData
|
|||
{
|
||||
public:
|
||||
|
||||
nsDocShellEditorData(nsIDocShell* inOwningDocShell);
|
||||
explicit nsDocShellEditorData(nsIDocShell* inOwningDocShell);
|
||||
~nsDocShellEditorData();
|
||||
|
||||
nsresult MakeEditable(bool inWaitForUriLoad);
|
||||
|
|
|
@ -42,7 +42,7 @@ protected:
|
|||
|
||||
public:
|
||||
|
||||
nsDocShellEnumerator(int32_t inEnumerationDirection);
|
||||
explicit nsDocShellEnumerator(int32_t inEnumerationDirection);
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
|
|
@ -108,7 +108,7 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSISIMPLEENUMERATOR
|
||||
|
||||
nsSHEnumerator(nsSHistory * aHistory);
|
||||
explicit nsSHEnumerator(nsSHistory * aHistory);
|
||||
|
||||
protected:
|
||||
friend class nsSHistory;
|
||||
|
|
|
@ -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) &&
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
static bool Enabled(JSContext* aCx, JSObject* aGlobal);
|
||||
|
||||
public:
|
||||
MessageChannel(nsPIDOMWindow* aWindow);
|
||||
explicit MessageChannel(nsPIDOMWindow* aWindow);
|
||||
|
||||
nsPIDOMWindow*
|
||||
GetParentObject() const
|
||||
|
|
|
@ -28,7 +28,7 @@ class DispatchEventRunnable : public nsRunnable
|
|||
friend class MessagePort;
|
||||
|
||||
public:
|
||||
DispatchEventRunnable(MessagePort* aPort)
|
||||
explicit DispatchEventRunnable(MessagePort* aPort)
|
||||
: mPort(aPort)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -8646,7 +8646,7 @@ nsGlobalWindow::EnterModalState()
|
|||
|
||||
if (activeShell) {
|
||||
nsRefPtr<nsFrameSelection> frameSelection = activeShell->FrameSelection();
|
||||
frameSelection->SetMouseDownState(false);
|
||||
frameSelection->SetDragState(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -729,7 +729,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();
|
||||
|
||||
|
@ -842,7 +842,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))
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -23,12 +23,33 @@ XPCOMUtils.defineLazyServiceGetter(this, "dataStoreService",
|
|||
"@mozilla.org/datastore-service;1",
|
||||
"nsIDataStoreService");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "systemMessenger",
|
||||
"@mozilla.org/system-message-internal;1",
|
||||
"nsISystemMessagesInternal");
|
||||
|
||||
var kSysMsgOnChangeShortTimeoutSec =
|
||||
Services.prefs.getIntPref("dom.datastore.sysMsgOnChangeShortTimeoutSec");
|
||||
var kSysMsgOnChangeLongTimeoutSec =
|
||||
Services.prefs.getIntPref("dom.datastore.sysMsgOnChangeLongTimeoutSec");
|
||||
|
||||
this.DataStoreChangeNotifier = {
|
||||
children: [],
|
||||
messages: [ "DataStore:Changed", "DataStore:RegisterForMessages",
|
||||
"DataStore:UnregisterForMessages",
|
||||
"child-process-shutdown" ],
|
||||
|
||||
// These hashes are used for storing the mapping between the datastore
|
||||
// identifiers (name | owner manifest URL) and their correspondent timers.
|
||||
// The object literal is defined as below:
|
||||
//
|
||||
// {
|
||||
// "datastore name 1|owner manifest URL 1": timer1,
|
||||
// "datastore name 2|owner manifest URL 2": timer2,
|
||||
// ...
|
||||
// }
|
||||
sysMsgOnChangeShortTimers: {},
|
||||
sysMsgOnChangeLongTimers: {},
|
||||
|
||||
init: function() {
|
||||
debug("init");
|
||||
|
||||
|
@ -59,7 +80,8 @@ this.DataStoreChangeNotifier = {
|
|||
},
|
||||
|
||||
broadcastMessage: function broadcastMessage(aData) {
|
||||
debug("Broadast");
|
||||
debug("broadcast");
|
||||
|
||||
this.children.forEach(function(obj) {
|
||||
if (obj.store == aData.store && obj.owner == aData.owner) {
|
||||
obj.mm.sendAsyncMessage("DataStore:Changed:Return:OK", aData);
|
||||
|
@ -67,6 +89,69 @@ this.DataStoreChangeNotifier = {
|
|||
});
|
||||
},
|
||||
|
||||
broadcastSystemMessage: function(aStore, aOwner) {
|
||||
debug("broadcastSystemMessage");
|
||||
|
||||
// Clear relevant timers.
|
||||
var storeKey = aStore + "|" + aOwner;
|
||||
var shortTimer = this.sysMsgOnChangeShortTimers[storeKey];
|
||||
if (shortTimer) {
|
||||
shortTimer.cancel();
|
||||
delete this.sysMsgOnChangeShortTimers[storeKey];
|
||||
}
|
||||
var longTimer = this.sysMsgOnChangeLongTimers[storeKey];
|
||||
if (longTimer) {
|
||||
longTimer.cancel();
|
||||
delete this.sysMsgOnChangeLongTimers[storeKey];
|
||||
}
|
||||
|
||||
// Get all the manifest URLs of the apps which can access the datastore.
|
||||
var manifestURLs = dataStoreService.getAppManifestURLsForDataStore(aStore);
|
||||
var enumerate = manifestURLs.enumerate();
|
||||
while (enumerate.hasMoreElements()) {
|
||||
var manifestURL = enumerate.getNext().QueryInterface(Ci.nsISupportsString);
|
||||
debug("Notify app " + manifestURL + " of datastore updates");
|
||||
// Send the system message 'datastore-update-{store name}' to all the
|
||||
// pages for these apps. With the manifest URL of the owner in the message
|
||||
// payload, it notifies the consumer a sync operation should be performed.
|
||||
systemMessenger.sendMessage("datastore-update-" + aStore,
|
||||
{ owner: aOwner },
|
||||
null,
|
||||
Services.io.newURI(manifestURL, null, null));
|
||||
}
|
||||
},
|
||||
|
||||
// Use the following logic to broadcast system messages in a moderate pattern.
|
||||
// 1. When an entry is changed, start a short timer and a long timer.
|
||||
// 2. If an entry is changed while the short timer is running, reset it.
|
||||
// Do not reset the long timer.
|
||||
// 3. Once either fires, broadcast the system message and cancel both timers.
|
||||
setSystemMessageTimeout: function(aStore, aOwner) {
|
||||
debug("setSystemMessageTimeout");
|
||||
|
||||
var storeKey = aStore + "|" + aOwner;
|
||||
|
||||
// Reset the short timer.
|
||||
var shortTimer = this.sysMsgOnChangeShortTimers[storeKey];
|
||||
if (!shortTimer) {
|
||||
shortTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this.sysMsgOnChangeShortTimers[storeKey] = shortTimer;
|
||||
} else {
|
||||
shortTimer.cancel();
|
||||
}
|
||||
shortTimer.initWithCallback({ notify: this.broadcastSystemMessage.bind(this, aStore, aOwner) },
|
||||
kSysMsgOnChangeShortTimeoutSec * 1000,
|
||||
Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
|
||||
// Set the long timer if necessary.
|
||||
if (!this.sysMsgOnChangeLongTimers[storeKey]) {
|
||||
var longTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this.sysMsgOnChangeLongTimers[storeKey] = longTimer;
|
||||
longTimer.initWithCallback({ notify: this.broadcastSystemMessage.bind(this, aStore, aOwner) },
|
||||
kSysMsgOnChangeLongTimeoutSec * 1000,
|
||||
Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
}
|
||||
},
|
||||
|
||||
receiveMessage: function(aMessage) {
|
||||
debug("receiveMessage ");
|
||||
|
@ -89,6 +174,7 @@ this.DataStoreChangeNotifier = {
|
|||
switch (aMessage.name) {
|
||||
case "DataStore:Changed":
|
||||
this.broadcastMessage(aMessage.data);
|
||||
this.setSystemMessageTimeout(aMessage.data.store, aMessage.data.owner);
|
||||
break;
|
||||
|
||||
case "DataStore:RegisterForMessages":
|
||||
|
|
|
@ -33,9 +33,11 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIDOMGlobalPropertyInitializer.h"
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIUUIDGenerator.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIURI.h"
|
||||
|
@ -375,6 +377,24 @@ GetDataStoreInfosEnumerator(const uint32_t& aAppId,
|
|||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
PLDHashOperator
|
||||
GetAppManifestURLsEnumerator(const uint32_t& aAppId,
|
||||
DataStoreInfo* aInfo,
|
||||
void* aUserData)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
auto* manifestURLs = static_cast<nsIMutableArray*>(aUserData);
|
||||
nsCOMPtr<nsISupportsString> manifestURL(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||
if (manifestURL) {
|
||||
manifestURL->SetData(aInfo->mManifestURL);
|
||||
manifestURLs->AppendElement(manifestURL, false);
|
||||
}
|
||||
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
// This class is useful to enumerate the add permissions for each app.
|
||||
class MOZ_STACK_CLASS AddPermissionsData
|
||||
{
|
||||
|
@ -1057,6 +1077,31 @@ DataStoreService::GetDataStoreInfos(const nsAString& aName,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DataStoreService::GetAppManifestURLsForDataStore(const nsAString& aName,
|
||||
nsIArray** aManifestURLs)
|
||||
{
|
||||
ASSERT_PARENT_PROCESS()
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
nsCOMPtr<nsIMutableArray> manifestURLs = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
if (!manifestURLs) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
HashApp* apps = nullptr;
|
||||
if (mStores.Get(aName, &apps)) {
|
||||
apps->EnumerateRead(GetAppManifestURLsEnumerator, manifestURLs.get());
|
||||
}
|
||||
if (mAccessStores.Get(aName, &apps)) {
|
||||
apps->EnumerateRead(GetAppManifestURLsEnumerator, manifestURLs.get());
|
||||
}
|
||||
|
||||
*aManifestURLs = manifestURLs;
|
||||
NS_ADDREF(*aManifestURLs);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
DataStoreService::CheckPermission(nsIPrincipal* aPrincipal)
|
||||
{
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
|
||||
interface nsIDOMWindow;
|
||||
interface nsIPrincipal;
|
||||
interface nsIArray;
|
||||
|
||||
[scriptable, uuid(9b59c49a-0cd7-11e4-b096-74d02b97e723)]
|
||||
[scriptable, uuid(79944b1c-187d-11e4-abb6-74d02b97e723)]
|
||||
interface nsIDataStoreService : nsISupports
|
||||
{
|
||||
void installDataStore(in unsigned long appId,
|
||||
|
@ -27,5 +28,7 @@ interface nsIDataStoreService : nsISupports
|
|||
in DOMString name,
|
||||
in DOMString owner);
|
||||
|
||||
nsIArray getAppManifestURLsForDataStore(in DOMString name);
|
||||
|
||||
boolean checkPermission(in nsIPrincipal principal);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for DataStore - notify updates with system messages</title>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
var gStore;
|
||||
var gChangeId = null;
|
||||
var gChangeOperation = null;
|
||||
var gIsSystemMessageFired = false;
|
||||
|
||||
function is(a, b, msg) {
|
||||
alert((a === b ? 'OK' : 'KO') + ' ' + msg)
|
||||
}
|
||||
|
||||
function ok(a, msg) {
|
||||
alert((a ? 'OK' : 'KO')+ ' ' + msg)
|
||||
}
|
||||
|
||||
function cbError() {
|
||||
alert('KO error');
|
||||
}
|
||||
|
||||
function finish() {
|
||||
alert('DONE');
|
||||
}
|
||||
|
||||
function testGetDataStores() {
|
||||
navigator.getDataStores('foo').then(function(stores) {
|
||||
is(stores.length, 1, "getDataStores('foo') returns 1 element");
|
||||
is(stores[0].name, 'foo', 'The dataStore.name is foo');
|
||||
is(stores[0].readOnly, false, 'The dataStore foo is not in readonly');
|
||||
|
||||
gStore = stores[0];
|
||||
runTest();
|
||||
}, cbError);
|
||||
}
|
||||
|
||||
function testStoreAdd(value, expectedId) {
|
||||
gStore.add(value).then(function(id) {
|
||||
is(id, expectedId, "store.add() is called");
|
||||
}, cbError);
|
||||
}
|
||||
|
||||
function eventListener(evt) {
|
||||
ok(evt instanceof DataStoreChangeEvent, "DataStoreChangeEvent has been received");
|
||||
ok(evt, "OnChangeListener is called with data");
|
||||
is(/[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}/.test(evt.revisionId), true, "event.revisionId returns something");
|
||||
is(evt.id, gChangeId, "OnChangeListener is called with the right ID: " + evt.id);
|
||||
is(evt.operation, gChangeOperation, "OnChangeListener is called with the right operation:" + evt.operation + " " + gChangeOperation);
|
||||
runTest();
|
||||
}
|
||||
|
||||
function onDatastoreUpdateFoo(message) {
|
||||
gIsSystemMessageFired = true;
|
||||
ok(true, "System message 'datastore-update-foo' has been received");
|
||||
runTest();
|
||||
}
|
||||
|
||||
var tests = [
|
||||
// Test for GetDataStore.
|
||||
testGetDataStores,
|
||||
|
||||
// Add onchange = function.
|
||||
function() {
|
||||
gStore.onchange = eventListener;
|
||||
is(gStore.onchange, eventListener, "onChange is set");
|
||||
runTest();
|
||||
},
|
||||
|
||||
// Set system message handler.
|
||||
function() {
|
||||
navigator.mozSetMessageHandler('datastore-update-foo', onDatastoreUpdateFoo);
|
||||
runTest();
|
||||
},
|
||||
|
||||
// Add.
|
||||
function() { gChangeId = 1; gChangeOperation = 'added';
|
||||
testStoreAdd({ number: 42 }, 1); },
|
||||
|
||||
// Remove event listener.
|
||||
function() {
|
||||
gStore.removeEventListener('change', eventListener);
|
||||
runTest();
|
||||
},
|
||||
|
||||
// Wait enough amount of time for the system message to fire.
|
||||
function() {
|
||||
setTimeout(runTest, 10000);
|
||||
},
|
||||
|
||||
// Ensure the system message has fired and no more pending ones.
|
||||
function() {
|
||||
ok(!navigator.mozHasPendingMessage('datastore-update-foo'), "No more pending system message");
|
||||
ok(gIsSystemMessageFired, "The system message has fired");
|
||||
runTest();
|
||||
}
|
||||
];
|
||||
|
||||
function runTest() {
|
||||
if (!tests.length) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
var test = tests.shift();
|
||||
test();
|
||||
}
|
||||
|
||||
runTest();
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -30,6 +30,7 @@ support-files =
|
|||
file_sync_common.js
|
||||
file_bug1008044.html
|
||||
file_bug957086.html
|
||||
file_notify_system_message.html
|
||||
|
||||
[test_app_install.html]
|
||||
[test_readonly.html]
|
||||
|
@ -50,3 +51,5 @@ support-files =
|
|||
[test_transactions.html]
|
||||
[test_bug1008044.html]
|
||||
[test_bug957086.html]
|
||||
[test_notify_system_message.html]
|
||||
skip-if = toolkit == 'gonk' # b2g
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
<div id="container"></div>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var gBaseURL = 'http://test/tests/dom/datastore/tests/';
|
||||
|
@ -26,8 +22,14 @@
|
|||
{ "type": "webapps-manage", "allow": 1, "context": document }],
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, function() {
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
gGenerator.next(); });
|
||||
});
|
||||
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -116,10 +122,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -116,10 +122,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -116,10 +122,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,12 +77,18 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.ipc.browser_frames.oop_by_default", true],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -117,10 +123,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -116,10 +122,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -81,12 +81,18 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.ipc.browser_frames.oop_by_default", true],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -124,10 +130,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -82,11 +82,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -124,10 +130,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -75,12 +75,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
// Enabling mozBrowser
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.mozBrowserFramesEnabled", true]]}, runTest);
|
||||
},
|
||||
|
@ -134,10 +139,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,6 +77,8 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", false]]}, runTest);
|
||||
},
|
||||
|
@ -89,6 +91,10 @@
|
|||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -123,10 +129,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -121,12 +121,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
// Enabling mozBrowser
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.mozBrowserFramesEnabled", true]]}, runTest);
|
||||
},
|
||||
|
@ -169,10 +174,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -116,10 +122,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -116,10 +122,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for DataStore - notify updates with system messages</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
var gHostedManifestURL = 'http://test/tests/dom/datastore/tests/file_app.sjs?testToken=file_notify_system_message.html';
|
||||
var gHostedPageURL = 'http://mochi.test:8888/tests/dom/datastore/tests/file_notify_system_message.html';
|
||||
var gApp;
|
||||
|
||||
function cbError() {
|
||||
ok(false, "Error callback invoked");
|
||||
finish();
|
||||
}
|
||||
|
||||
function installApp() {
|
||||
var request = navigator.mozApps.install(gHostedManifestURL);
|
||||
request.onerror = cbError;
|
||||
request.onsuccess = function() {
|
||||
gApp = request.result;
|
||||
runTest();
|
||||
}
|
||||
}
|
||||
|
||||
function uninstallApp() {
|
||||
// Uninstall the app.
|
||||
var request = navigator.mozApps.mgmt.uninstall(gApp);
|
||||
request.onerror = cbError;
|
||||
request.onsuccess = function() {
|
||||
// All done.
|
||||
info("All done");
|
||||
runTest();
|
||||
}
|
||||
}
|
||||
|
||||
function testApp() {
|
||||
var ifr = document.createElement('iframe');
|
||||
ifr.setAttribute('mozbrowser', 'true');
|
||||
ifr.setAttribute('mozapp', gApp.manifestURL);
|
||||
ifr.setAttribute('src', gApp.manifest.launch_path);
|
||||
var domParent = document.getElementById('container');
|
||||
|
||||
// Set us up to listen for messages from the app.
|
||||
var listener = function(e) {
|
||||
var message = e.detail.message;
|
||||
if (/^OK/.exec(message)) {
|
||||
ok(true, "Message from app: " + message);
|
||||
} else if (/KO/.exec(message)) {
|
||||
ok(false, "Message from app: " + message);
|
||||
} else if (/DONE/.exec(message)) {
|
||||
ok(true, "Messaging from app complete");
|
||||
ifr.removeEventListener('mozbrowsershowmodalprompt', listener);
|
||||
domParent.removeChild(ifr);
|
||||
runTest();
|
||||
}
|
||||
}
|
||||
|
||||
// This event is triggered when the app calls "alert".
|
||||
ifr.addEventListener('mozbrowsershowmodalprompt', listener, false);
|
||||
domParent.appendChild(ifr);
|
||||
}
|
||||
|
||||
var tests = [
|
||||
// Permissions.
|
||||
function() {
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type": "browser", "allow": 1, "context": document },
|
||||
{ "type": "embed-apps", "allow": 1, "context": document },
|
||||
{ "type": "webapps-manage", "allow": 1, "context": document }], runTest);
|
||||
},
|
||||
|
||||
// Preferences.
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.sysmsg.enabled", true],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true],
|
||||
["dom.mozBrowserFramesEnabled", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
// No confirmation needed when an app is installed.
|
||||
SpecialPowers.autoConfirmAppInstall(runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
SpecialPowers.Cu.import("resource://gre/modules/Services.jsm");
|
||||
var ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIIOService);
|
||||
var systemMessenger = SpecialPowers.Cc["@mozilla.org/system-message-internal;1"]
|
||||
.getService(SpecialPowers.Ci.nsISystemMessagesInternal);
|
||||
systemMessenger.registerPage("datastore-update-foo",
|
||||
ioService.newURI(gHostedPageURL, null, null),
|
||||
ioService.newURI(gHostedManifestURL, null, null));
|
||||
}
|
||||
runTest();
|
||||
},
|
||||
|
||||
// Installing the app.
|
||||
installApp,
|
||||
|
||||
// Run tests in app.
|
||||
testApp,
|
||||
|
||||
// Uninstall the app.
|
||||
uninstallApp
|
||||
];
|
||||
|
||||
function runTest() {
|
||||
if (!tests.length) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
var test = tests.shift();
|
||||
test();
|
||||
}
|
||||
|
||||
function finish() {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -77,12 +77,18 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.ipc.browser_frames.oop_by_default", true],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -117,10 +123,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -105,12 +105,18 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.ipc.browser_frames.oop_by_default", true],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -147,10 +153,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
}
|
||||
|
||||
function runTest() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
|
||||
|
@ -95,12 +99,10 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
},
|
||||
|
@ -115,10 +121,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
},
|
||||
|
@ -115,10 +121,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,17 @@
|
|||
// Preferences
|
||||
function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
|
||||
["dom.datastore.sysMsgOnChangeShortTimeoutSec", 1],
|
||||
["dom.datastore.sysMsgOnChangeLongTimeoutSec", 3],
|
||||
["dom.testing.ignore_ipc_principal", true],
|
||||
["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
||||
runTest();
|
||||
|
@ -116,10 +122,6 @@
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
runTest();
|
||||
</script>
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
, mHasOrHasHadOwnerWindow(false)
|
||||
{
|
||||
}
|
||||
DOMEventTargetHelper(nsPIDOMWindow* aWindow)
|
||||
explicit DOMEventTargetHelper(nsPIDOMWindow* aWindow)
|
||||
: mParentObject(nullptr)
|
||||
, mOwnerWindow(nullptr)
|
||||
, mHasOrHasHadOwnerWindow(false)
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
// All objects coming through here are WebIDL objects
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
DOMEventTargetHelper(DOMEventTargetHelper* aOther)
|
||||
explicit DOMEventTargetHelper(DOMEventTargetHelper* aOther)
|
||||
: mParentObject(nullptr)
|
||||
, mOwnerWindow(nullptr)
|
||||
, mHasOrHasHadOwnerWindow(false)
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
Event(EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent);
|
||||
Event(nsPIDOMWindow* aWindow);
|
||||
explicit Event(nsPIDOMWindow* aWindow);
|
||||
|
||||
protected:
|
||||
virtual ~Event();
|
||||
|
|
|
@ -198,7 +198,7 @@ public:
|
|||
class EventChainPostVisitor : public mozilla::EventChainVisitor
|
||||
{
|
||||
public:
|
||||
EventChainPostVisitor(EventChainVisitor& aOther)
|
||||
explicit EventChainPostVisitor(EventChainVisitor& aOther)
|
||||
: EventChainVisitor(aOther.mPresContext, aOther.mEvent,
|
||||
aOther.mDOMEvent, aOther.mEventStatus)
|
||||
{
|
||||
|
|
|
@ -211,7 +211,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
EventListenerManager(dom::EventTarget* aTarget);
|
||||
explicit EventListenerManager(dom::EventTarget* aTarget);
|
||||
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(EventListenerManager)
|
||||
|
||||
|
|
|
@ -1444,10 +1444,10 @@ EventStateManager::FireContextClick()
|
|||
nsRefPtr<nsFrameSelection> frameSel =
|
||||
mCurrentTarget->GetFrameSelection();
|
||||
|
||||
if (frameSel && frameSel->GetMouseDownState()) {
|
||||
if (frameSel && frameSel->GetDragState()) {
|
||||
// note that this can cause selection changed events to fire if we're in
|
||||
// a text field, which will null out mCurrentTarget
|
||||
frameSel->SetMouseDownState(false);
|
||||
frameSel->SetDragState(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1566,7 +1566,7 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
|
|||
if (mCurrentTarget)
|
||||
{
|
||||
nsRefPtr<nsFrameSelection> frameSel = mCurrentTarget->GetFrameSelection();
|
||||
if (frameSel && frameSel->GetMouseDownState()) {
|
||||
if (frameSel && frameSel->GetDragState()) {
|
||||
StopTrackingDragGesture();
|
||||
return;
|
||||
}
|
||||
|
@ -2908,7 +2908,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
|||
nsIPresShell *shell = presContext->GetPresShell();
|
||||
if (shell) {
|
||||
nsRefPtr<nsFrameSelection> frameSelection = shell->FrameSelection();
|
||||
frameSelection->SetMouseDownState(false);
|
||||
frameSelection->SetDragState(false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -35,17 +35,17 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
TypedEventHandler(dom::EventHandlerNonNull* aHandler)
|
||||
explicit TypedEventHandler(dom::EventHandlerNonNull* aHandler)
|
||||
{
|
||||
Assign(aHandler, eNormal);
|
||||
}
|
||||
|
||||
TypedEventHandler(dom::OnErrorEventHandlerNonNull* aHandler)
|
||||
explicit TypedEventHandler(dom::OnErrorEventHandlerNonNull* aHandler)
|
||||
{
|
||||
Assign(aHandler, eOnError);
|
||||
}
|
||||
|
||||
TypedEventHandler(dom::OnBeforeUnloadEventHandlerNonNull* aHandler)
|
||||
explicit TypedEventHandler(dom::OnBeforeUnloadEventHandlerNonNull* aHandler)
|
||||
{
|
||||
Assign(aHandler, eOnBeforeUnload);
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче