Skip to content

Commit

Permalink
Backed out 22 changesets (bug 1231213) for Browser-chrome failures on…
Browse files Browse the repository at this point in the history
… /workers/remoteworkers/RemoteWorkerChild.cpp

Backed out changeset 7e09ad9ceea6 (bug 1231213)
Backed out changeset a275eb0b1a19 (bug 1231213)
Backed out changeset 906b80778539 (bug 1231213)
Backed out changeset 6a40ab6852cb (bug 1231213)
Backed out changeset 216591953f97 (bug 1231213)
Backed out changeset 1de357bc1921 (bug 1231213)
Backed out changeset 8e3fedf6502a (bug 1231213)
Backed out changeset 1b9a8b022fce (bug 1231213)
Backed out changeset 85df1959eb98 (bug 1231213)
Backed out changeset 666bf4260046 (bug 1231213)
Backed out changeset 0b03a19a6dc1 (bug 1231213)
Backed out changeset 11f010e6d6e7 (bug 1231213)
Backed out changeset 6ed55807374f (bug 1231213)
Backed out changeset 395062aef2ec (bug 1231213)
Backed out changeset bacf8499ba7b (bug 1231213)
Backed out changeset bf5d60c7a85a (bug 1231213)
Backed out changeset cd434b787ce6 (bug 1231213)
Backed out changeset ee4565104217 (bug 1231213)
Backed out changeset 581653ef33dd (bug 1231213)
Backed out changeset 2d5628a0e52d (bug 1231213)
Backed out changeset 3449c2eba4c6 (bug 1231213)
Backed out changeset ae221b628899 (bug 1231213)
  • Loading branch information
dgluca committed Aug 14, 2019
1 parent a2c6ed2 commit 73975f1
Show file tree
Hide file tree
Showing 79 changed files with 669 additions and 7,618 deletions.
2 changes: 0 additions & 2 deletions dom/abort/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ UNIFIED_SOURCES += [
'AbortSignal.cpp',
]

include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'
2 changes: 0 additions & 2 deletions dom/console/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,4 @@ MOCHITEST_MANIFESTS += [ 'tests/mochitest.ini' ]
MOCHITEST_CHROME_MANIFESTS += [ 'tests/chrome.ini' ]
XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']

include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'
46 changes: 2 additions & 44 deletions dom/fetch/FetchTypes.ipdlh
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,15 @@ include ChannelInfo;
include PBackgroundSharedTypes;

using HeadersGuardEnum from "mozilla/dom/FetchIPCTypes.h";
using ReferrerPolicy from "mozilla/dom/FetchIPCTypes.h";
using RequestCache from "mozilla/dom/FetchIPCTypes.h";
using RequestCredentials from "mozilla/dom/FetchIPCTypes.h";
using RequestMode from "mozilla/dom/FetchIPCTypes.h";
using RequestRedirect from "mozilla/dom/FetchIPCTypes.h";
using ResponseType from "mozilla/dom/FetchIPCTypes.h";

namespace mozilla {
namespace dom {

struct HeadersEntry {
struct HeadersEntry
{
nsCString name;
nsCString value;
};

struct IPCInternalRequest {
nsCString method;
nsCString[] urlList;
HeadersGuardEnum headersGuard;
HeadersEntry[] headers;
IPCStream? body;
int64_t bodySize;
nsCString preferredAlternativeDataType;
uint32_t contentPolicyType;
nsString referrer;
ReferrerPolicy referrerPolicy;
RequestMode requestMode;
RequestCredentials requestCredentials;
RequestCache cacheMode;
RequestRedirect requestRedirect;
nsString integrity;
nsCString fragment;
bool createdByFetchEvent;
PrincipalInfo? principalInfo;
};

struct IPCInternalResponse {
ResponseType type;
nsCString[] urlList;
uint16_t status;
nsCString statusText;
HeadersGuardEnum headersGuard;
HeadersEntry[] headers;
IPCStream? body;
int64_t bodySize;
nsresult errorCode;
nsCString alternativeDataType;
IPCStream? alternativeBody;
IPCChannelInfo channelInfo;
PrincipalInfo? principalInfo;
};

} // namespace ipc
} // namespace mozilla
67 changes: 0 additions & 67 deletions dom/fetch/InternalRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#include "mozilla/dom/WorkerCommon.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"

namespace mozilla {
namespace dom {
Expand Down Expand Up @@ -173,73 +171,8 @@ InternalRequest::InternalRequest(const InternalRequest& aOther)
// NOTE: does not copy body stream... use the fallible Clone() for that
}

InternalRequest::InternalRequest(const IPCInternalRequest& aIPCRequest)
: mMethod(aIPCRequest.method()),
mURLList(aIPCRequest.urlList()),
mHeaders(new InternalHeaders(aIPCRequest.headers(),
aIPCRequest.headersGuard())),
mBodyStream(mozilla::ipc::DeserializeIPCStream(aIPCRequest.body())),
mBodyLength(aIPCRequest.bodySize()),
mPreferredAlternativeDataType(aIPCRequest.preferredAlternativeDataType()),
mContentPolicyType(
static_cast<nsContentPolicyType>(aIPCRequest.contentPolicyType())),
mReferrer(aIPCRequest.referrer()),
mReferrerPolicy(aIPCRequest.referrerPolicy()),
mMode(aIPCRequest.requestMode()),
mCredentialsMode(aIPCRequest.requestCredentials()),
mCacheMode(aIPCRequest.cacheMode()),
mRedirectMode(aIPCRequest.requestRedirect()),
mIntegrity(aIPCRequest.integrity()),
mFragment(aIPCRequest.fragment()),
mCreatedByFetchEvent(aIPCRequest.createdByFetchEvent()) {
if (aIPCRequest.principalInfo()) {
mPrincipalInfo = MakeUnique<mozilla::ipc::PrincipalInfo>(
aIPCRequest.principalInfo().ref());
}
}

InternalRequest::~InternalRequest() {}

template void InternalRequest::ToIPC<mozilla::ipc::PBackgroundChild>(
IPCInternalRequest* aIPCRequest, mozilla::ipc::PBackgroundChild* aManager,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream);

template <typename M>
void InternalRequest::ToIPC(
IPCInternalRequest* aIPCRequest, M* aManager,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream) {
MOZ_ASSERT(aIPCRequest);
MOZ_ASSERT(aManager);
MOZ_ASSERT(!mURLList.IsEmpty());

aIPCRequest->method() = mMethod;
aIPCRequest->urlList() = mURLList;
mHeaders->ToIPC(aIPCRequest->headers(), aIPCRequest->headersGuard());

if (mBodyStream) {
aAutoStream.reset(new mozilla::ipc::AutoIPCStream(aIPCRequest->body()));
DebugOnly<bool> ok = aAutoStream->Serialize(mBodyStream, aManager);
MOZ_ASSERT(ok);
}

aIPCRequest->bodySize() = mBodyLength;
aIPCRequest->preferredAlternativeDataType() = mPreferredAlternativeDataType;
aIPCRequest->contentPolicyType() = static_cast<uint32_t>(mContentPolicyType);
aIPCRequest->referrer() = mReferrer;
aIPCRequest->referrerPolicy() = mReferrerPolicy;
aIPCRequest->requestMode() = mMode;
aIPCRequest->requestCredentials() = mCredentialsMode;
aIPCRequest->cacheMode() = mCacheMode;
aIPCRequest->requestRedirect() = mRedirectMode;
aIPCRequest->integrity() = mIntegrity;
aIPCRequest->fragment() = mFragment;
aIPCRequest->createdByFetchEvent() = mCreatedByFetchEvent;

if (mPrincipalInfo) {
aIPCRequest->principalInfo().emplace(*mPrincipalInfo);
}
}

void InternalRequest::SetContentPolicyType(
nsContentPolicyType aContentPolicyType) {
mContentPolicyType = aContentPolicyType;
Expand Down
9 changes: 0 additions & 9 deletions dom/fetch/InternalRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "mozilla/dom/RequestBinding.h"
#include "mozilla/LoadTainting.h"
#include "mozilla/net/ReferrerPolicy.h"
#include "mozilla/UniquePtr.h"

#include "nsIContentPolicy.h"
#include "nsIInputStream.h"
Expand All @@ -27,7 +26,6 @@ namespace mozilla {

namespace ipc {
class PrincipalInfo;
class AutoIPCStream;
} // namespace ipc

namespace dom {
Expand Down Expand Up @@ -70,7 +68,6 @@ namespace dom {
*
*/

class IPCInternalRequest;
class Request;

#define kFETCH_CLIENT_REFERRER_STR "about:client"
Expand All @@ -90,12 +87,6 @@ class InternalRequest final {
nsContentPolicyType aContentPolicyType,
const nsAString& aIntegrity);

explicit InternalRequest(const IPCInternalRequest& aIPCRequest);

template <typename M>
void ToIPC(IPCInternalRequest* aIPCRequest, M* aManager,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream);

already_AddRefed<InternalRequest> Clone();

void GetMethod(nsCString& aMethod) const { aMethod.Assign(mMethod); }
Expand Down
106 changes: 0 additions & 106 deletions dom/fetch/InternalResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include "InternalResponse.h"

#include "mozilla/Assertions.h"
#include "mozilla/RefPtr.h"
#include "mozilla/dom/FetchTypes.h"
#include "mozilla/dom/InternalHeaders.h"
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
Expand Down Expand Up @@ -41,112 +39,8 @@ InternalResponse::InternalResponse(uint16_t aStatus,
mErrorCode(NS_OK),
mCredentialsMode(aCredentialsMode) {}

/* static */ RefPtr<InternalResponse> InternalResponse::FromIPC(
const IPCInternalResponse& aIPCResponse) {
if (aIPCResponse.type() == ResponseType::Error) {
return InternalResponse::NetworkError(aIPCResponse.errorCode());
}

RefPtr<InternalResponse> response =
new InternalResponse(aIPCResponse.status(), aIPCResponse.statusText());

response->SetURLList(aIPCResponse.urlList());
response->mHeaders =
new InternalHeaders(aIPCResponse.headers(), aIPCResponse.headersGuard());

nsCOMPtr<nsIInputStream> body =
mozilla::ipc::DeserializeIPCStream(aIPCResponse.body());
response->SetBody(body, aIPCResponse.bodySize());

response->SetAlternativeDataType(aIPCResponse.alternativeDataType());

nsCOMPtr<nsIInputStream> alternativeBody =
mozilla::ipc::DeserializeIPCStream(aIPCResponse.alternativeBody());
response->SetAlternativeBody(alternativeBody);

response->InitChannelInfo(aIPCResponse.channelInfo());

if (aIPCResponse.principalInfo()) {
response->SetPrincipalInfo(MakeUnique<mozilla::ipc::PrincipalInfo>(
aIPCResponse.principalInfo().ref()));
}

switch (aIPCResponse.type()) {
case ResponseType::Basic:
response = response->BasicResponse();
break;
case ResponseType::Cors:
response = response->CORSResponse();
break;
case ResponseType::Default:
break;
case ResponseType::Opaque:
response = response->OpaqueResponse();
break;
case ResponseType::Opaqueredirect:
response = response->OpaqueRedirectResponse();
break;
default:
MOZ_CRASH("Unexpected ResponseType!");
}

MOZ_ASSERT(response);

return response;
}

InternalResponse::~InternalResponse() {}

template void InternalResponse::ToIPC<mozilla::ipc::PBackgroundChild>(
IPCInternalResponse* aIPCResponse, mozilla::ipc::PBackgroundChild* aManager,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoBodyStream,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoAlternativeBodyStream);

template <typename M>
void InternalResponse::ToIPC(
IPCInternalResponse* aIPCResponse, M* aManager,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoBodyStream,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoAlternativeBodyStream) {
MOZ_ASSERT(aIPCResponse);

aIPCResponse->type() = mType;
GetUnfilteredURLList(aIPCResponse->urlList());
aIPCResponse->status() = GetUnfilteredStatus();
aIPCResponse->statusText() = GetUnfilteredStatusText();
UnfilteredHeaders()->ToIPC(aIPCResponse->headers(),
aIPCResponse->headersGuard());

nsCOMPtr<nsIInputStream> body;
int64_t bodySize;
GetUnfilteredBody(getter_AddRefs(body), &bodySize);

if (body) {
aAutoBodyStream.reset(
new mozilla::ipc::AutoIPCStream(aIPCResponse->body()));
DebugOnly<bool> ok = aAutoBodyStream->Serialize(body, aManager);
MOZ_ASSERT(ok);
}

aIPCResponse->bodySize() = bodySize;
aIPCResponse->errorCode() = mErrorCode;
aIPCResponse->alternativeDataType() = GetAlternativeDataType();

nsCOMPtr<nsIInputStream> alternativeBody = TakeAlternativeBody();
if (alternativeBody) {
aAutoAlternativeBodyStream.reset(
new mozilla::ipc::AutoIPCStream(aIPCResponse->alternativeBody()));
DebugOnly<bool> ok =
aAutoAlternativeBodyStream->Serialize(alternativeBody, aManager);
MOZ_ASSERT(ok);
}

aIPCResponse->channelInfo() = mChannelInfo.AsIPCChannelInfo();

if (mPrincipalInfo) {
aIPCResponse->principalInfo().emplace(*mPrincipalInfo);
}
}

already_AddRefed<InternalResponse> InternalResponse::Clone(
CloneType aCloneType) {
RefPtr<InternalResponse> clone = CreateIncompleteCopy();
Expand Down
29 changes: 0 additions & 29 deletions dom/fetch/InternalResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class AutoIPCStream;

namespace dom {

class IPCInternalResponse;
class InternalHeaders;

class InternalResponse final {
Expand All @@ -39,15 +38,6 @@ class InternalResponse final {
uint16_t aStatus, const nsACString& aStatusText,
RequestCredentials aCredentialsMode = RequestCredentials::Omit);

static RefPtr<InternalResponse> FromIPC(
const IPCInternalResponse& aIPCResponse);

template <typename M>
void ToIPC(
IPCInternalResponse* aIPCResponse, M* aManager,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoBodyStream,
UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoAlternativeBodyStream);

enum CloneType {
eCloneInputStream,
eDontCloneInputStream,
Expand Down Expand Up @@ -221,24 +211,6 @@ class InternalResponse final {

void SetPaddingSize(int64_t aPaddingSize);

void SetAlternativeDataType(const nsACString& aAltDataType) {
if (mWrappedResponse) {
return mWrappedResponse->SetAlternativeDataType(aAltDataType);
}

MOZ_DIAGNOSTIC_ASSERT(mAlternativeDataType.IsEmpty());

mAlternativeDataType.Assign(aAltDataType);
}

const nsCString& GetAlternativeDataType() {
if (mWrappedResponse) {
return mWrappedResponse->GetAlternativeDataType();
}

return mAlternativeDataType;
}

void SetAlternativeBody(nsIInputStream* aAlternativeBody) {
if (mWrappedResponse) {
return mWrappedResponse->SetAlternativeBody(aAlternativeBody);
Expand Down Expand Up @@ -351,7 +323,6 @@ class InternalResponse final {
RequestCredentials mCredentialsMode;

// For alternative data such as JS Bytecode cached in the HTTP cache.
nsCString mAlternativeDataType;
nsCOMPtr<nsIInputStream> mAlternativeBody;
nsMainThreadPtrHandle<nsICacheInfoChannel> mCacheInfoChannel;

Expand Down
Loading

0 comments on commit 73975f1

Please sign in to comment.