Backed out 16 changesets (bug 1525245) for Android failures. CLOSED TREE

Backed out changeset 9f8a1b410320 (bug 1525245)
Backed out changeset 0ef284a9a1d5 (bug 1525245)
Backed out changeset 835e5f642a03 (bug 1525245)
Backed out changeset 362f5a8d033c (bug 1525245)
Backed out changeset 9da3ab33cf67 (bug 1525245)
Backed out changeset 6aacd2d6e835 (bug 1525245)
Backed out changeset 8ff9e8f45e02 (bug 1525245)
Backed out changeset 2020227181cc (bug 1525245)
Backed out changeset fc3c64c330b9 (bug 1525245)
Backed out changeset 2762bf88e050 (bug 1525245)
Backed out changeset ffc10fdc50a6 (bug 1525245)
Backed out changeset bb6ade1207d7 (bug 1525245)
Backed out changeset 1875eb5085e4 (bug 1525245)
Backed out changeset 7e4f67a6d6f1 (bug 1525245)
Backed out changeset e671fc9581eb (bug 1525245)
Backed out changeset b89f5def8d0d (bug 1525245)
This commit is contained in:
Dorel Luca
2019-03-06 21:07:49 +02:00
parent d252cdd39a
commit 9a275b4283
149 changed files with 1246 additions and 2907 deletions

View File

@@ -82,8 +82,7 @@ class EventSourceImpl final : public nsIObserver,
NS_DECL_NSIEVENTTARGET_FULL
NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
EventSourceImpl(EventSource* aEventSource,
nsICookieSettings* aCookieSettings);
explicit EventSourceImpl(EventSource* aEventSource);
enum { CONNECTING = 0U, OPEN = 1U, CLOSED = 2U };
@@ -292,8 +291,6 @@ class EventSourceImpl final : public nsIObserver,
uint64_t mInnerWindowID;
private:
nsCOMPtr<nsICookieSettings> mCookieSettings;
// Pointer to the target thread for checking whether we are
// on the target thread. This is intentionally a non-owning
// pointer in order not to affect the thread destruction
@@ -319,8 +316,7 @@ NS_IMPL_ISUPPORTS(EventSourceImpl, nsIObserver, nsIStreamListener,
nsIInterfaceRequestor, nsISupportsWeakReference,
nsIEventTarget, nsIThreadRetargetableStreamListener)
EventSourceImpl::EventSourceImpl(EventSource* aEventSource,
nsICookieSettings* aCookieSettings)
EventSourceImpl::EventSourceImpl(EventSource* aEventSource)
: mEventSource(aEventSource),
mReconnectionTime(0),
mStatus(PARSE_STATE_OFF),
@@ -332,7 +328,6 @@ EventSourceImpl::EventSourceImpl(EventSource* aEventSource,
mScriptLine(0),
mScriptColumn(0),
mInnerWindowID(0),
mCookieSettings(aCookieSettings),
mTargetThread(NS_GetCurrentThread()) {
MOZ_ASSERT(mEventSource);
if (!mIsMainThread) {
@@ -976,8 +971,6 @@ nsresult EventSourceImpl::InitChannelAndRequestEventSource() {
nsCOMPtr<nsIChannel> channel;
// If we have the document, use it
if (doc) {
MOZ_ASSERT(mCookieSettings == doc->CookieSettings());
nsCOMPtr<nsILoadGroup> loadGroup = doc->GetDocumentLoadGroup();
rv = NS_NewChannel(getter_AddRefs(channel), mSrc, doc, securityFlags,
nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE,
@@ -989,7 +982,6 @@ nsresult EventSourceImpl::InitChannelAndRequestEventSource() {
// otherwise use the principal
rv = NS_NewChannel(getter_AddRefs(channel), mSrc, mPrincipal, securityFlags,
nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE,
mCookieSettings,
nullptr, // aPerformanceStorage
nullptr, // loadGroup
nullptr, // aCallbacks
@@ -1785,14 +1777,12 @@ EventSourceImpl::CheckListenerChain() {
////////////////////////////////////////////////////////////////////////////////
EventSource::EventSource(nsPIDOMWindowInner* aOwnerWindow,
nsICookieSettings* aCookieSettings,
bool aWithCredentials)
: DOMEventTargetHelper(aOwnerWindow),
mWithCredentials(aWithCredentials),
mIsMainThread(true),
mKeepingAlive(false) {
MOZ_ASSERT(aCookieSettings);
mImpl = new EventSourceImpl(this, aCookieSettings);
mImpl = new EventSourceImpl(this);
}
EventSource::~EventSource() {}
@@ -1816,24 +1806,8 @@ already_AddRefed<EventSource> EventSource::Constructor(
MOZ_ASSERT(!NS_IsMainThread() || ownerWindow);
nsCOMPtr<nsICookieSettings> cookieSettings;
if (ownerWindow) {
Document* doc = ownerWindow->GetExtantDoc();
if (NS_WARN_IF(!doc)) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
cookieSettings = doc->CookieSettings();
} else {
// Worker side.
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
MOZ_ASSERT(workerPrivate);
cookieSettings = workerPrivate->CookieSettings();
}
RefPtr<EventSource> eventSource = new EventSource(
ownerWindow, cookieSettings, aEventSourceInitDict.mWithCredentials);
RefPtr<EventSource> eventSource =
new EventSource(ownerWindow, aEventSourceInitDict.mWithCredentials);
RefPtr<EventSourceImpl> eventSourceImp = eventSource->mImpl;
if (NS_IsMainThread()) {