зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1269383 - Remove dom.server-events.enabled pref, r=smaug
This commit is contained in:
Родитель
a29728b62b
Коммит
a8a55d5447
|
@ -185,7 +185,7 @@ EventSource::Init(nsISupports* aOwner,
|
|||
const nsAString& aURL,
|
||||
bool aWithCredentials)
|
||||
{
|
||||
if (mReadyState != CONNECTING || !PrefEnabled()) {
|
||||
if (mReadyState != CONNECTING) {
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
|
||||
|
@ -572,13 +572,6 @@ EventSource::GetInterface(const nsIID & aIID,
|
|||
return QueryInterface(aIID, aResult);
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
EventSource::PrefEnabled(JSContext* aCx, JSObject* aGlobal)
|
||||
{
|
||||
return Preferences::GetBool("dom.server-events.enabled", false);
|
||||
}
|
||||
|
||||
nsresult
|
||||
EventSource::GetBaseURI(nsIURI **aBaseURI)
|
||||
{
|
||||
|
|
|
@ -93,9 +93,6 @@ public:
|
|||
IMPL_EVENT_HANDLER(error)
|
||||
void Close();
|
||||
|
||||
// Determine if preferences allow EventSource
|
||||
static bool PrefEnabled(JSContext* aCx = nullptr, JSObject* aGlobal = nullptr);
|
||||
|
||||
virtual void DisconnectFromOwner() override;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -21,9 +21,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=716841
|
|||
<script class="testbody" type="text/javascript">
|
||||
|
||||
function doTest(test_id) {
|
||||
oldPrefVal = SpecialPowers.getBoolPref("dom.server-events.enabled");
|
||||
ok(true, "here we go");
|
||||
|
||||
source = new EventSource("eventsource_redirect.resource");
|
||||
ok(source.url == "http://mochi.test:8888/tests/dom/base/test/eventsource_redirect.resource", "Test failed.");
|
||||
ok(source.readyState == 0 || source.readyState == 1, "Test failed.");
|
||||
|
@ -47,9 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=716841
|
|||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [['dom.server-events.enabled', true]]}, doTest);
|
||||
});
|
||||
addLoadEvent(doTest);
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
|
|
|
@ -621,7 +621,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
|||
function doTest()
|
||||
{
|
||||
// Allow all cookies, then run the actual test
|
||||
SpecialPowers.pushPrefEnv({"set": [["network.cookie.cookieBehavior", 0], ["dom.server-events.enabled", true]]}, function() { SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], doTestCallback);});
|
||||
SpecialPowers.pushPrefEnv({"set": [["network.cookie.cookieBehavior", 0]]},
|
||||
function() {
|
||||
SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}],
|
||||
doTestCallback);
|
||||
});
|
||||
}
|
||||
|
||||
function doTestCallback()
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
* and create derivative works of this document.
|
||||
*/
|
||||
|
||||
[Constructor(USVString url, optional EventSourceInit eventSourceInitDict),
|
||||
Func="mozilla::dom::EventSource::PrefEnabled"]
|
||||
[Constructor(USVString url, optional EventSourceInit eventSourceInitDict)]
|
||||
interface EventSource : EventTarget {
|
||||
[Constant]
|
||||
readonly attribute DOMString url;
|
||||
|
|
|
@ -1565,8 +1565,6 @@ pref("network.websocket.delay-failed-reconnects", true);
|
|||
// </ws>
|
||||
|
||||
// Server-Sent Events
|
||||
|
||||
pref("dom.server-events.enabled", true);
|
||||
// Equal to the DEFAULT_RECONNECTION_TIME_VALUE value in nsEventSource.cpp
|
||||
pref("dom.server-events.default-reconnection-time", 5000); // in milliseconds
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче