Backed out changeset 068df0223a6c (bug 1125961) for e10s crashes.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2015-06-15 15:27:53 -04:00
parent 815a3d5741
commit 350215c93f
15 changed files with 19 additions and 89 deletions

View File

@ -1,4 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'b2g'
support-files =
worker.js
worker2.js

View File

@ -270,6 +270,7 @@ private:
nsCOMPtr<nsIProgressEventSink> mProgressSink;
nsCOMPtr<nsIURI> mOriginalURI;
nsCOMPtr<nsISupports> mOwner;
nsCOMPtr<nsILoadInfo> mLoadInfo;
nsCOMPtr<nsISupports> mSecurityInfo;
nsCOMPtr<nsIChannel> mRedirectChannel;
nsCString mContentType;
@ -288,7 +289,6 @@ protected:
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
nsCOMPtr<nsIStreamListener> mListener;
nsCOMPtr<nsISupports> mListenerContext;
nsCOMPtr<nsILoadInfo> mLoadInfo;
nsresult mStatus;
uint32_t mContentDispositionHint;
nsAutoPtr<nsString> mContentDispositionFilename;

View File

@ -153,8 +153,7 @@ NeckoChild::DeallocPWyciwygChannelChild(PWyciwygChannelChild* channel)
PWebSocketChild*
NeckoChild::AllocPWebSocketChild(const PBrowserOrId& browser,
const SerializedLoadContext& aSerialized,
const PrincipalInfo& requestingPrincipal)
const SerializedLoadContext& aSerialized)
{
NS_NOTREACHED("AllocPWebSocketChild should not be called");
return nullptr;

View File

@ -41,8 +41,7 @@ protected:
virtual bool DeallocPFTPChannelChild(PFTPChannelChild*) override;
virtual PWebSocketChild*
AllocPWebSocketChild(const PBrowserOrId&,
const SerializedLoadContext&,
const PrincipalInfo&) override;
const SerializedLoadContext&) override;
virtual bool DeallocPWebSocketChild(PWebSocketChild*) override;
virtual PTCPSocketChild* AllocPTCPSocketChild(const nsString& host,
const uint16_t& port) override;

View File

@ -12,7 +12,6 @@
#include "prenv.h"
#include "nsPrintfCString.h"
#include "mozilla/Preferences.h"
#include "nsILoadInfo.h"
namespace mozilla { namespace dom {
class TabChild;
@ -121,11 +120,10 @@ UsingNeckoIPCSecurity()
inline bool
MissingRequiredTabChild(mozilla::dom::TabChild* tabChild,
nsILoadInfo* loadInfo,
const char* context)
{
if (UsingNeckoIPCSecurity()) {
if (!tabChild && (!loadInfo || !loadInfo->LoadingPrincipal())) {
if (!tabChild) {
printf_stderr("WARNING: child tried to open %s IPDL channel w/o "
"security info\n", context);
return true;

View File

@ -27,7 +27,6 @@
#include "mozilla/dom/network/TCPSocketParent.h"
#include "mozilla/dom/network/TCPServerSocketParent.h"
#include "mozilla/dom/network/UDPSocketParent.h"
#include "mozilla/ipc/BackgroundUtils.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/LoadContext.h"
#include "mozilla/AppProcessChecker.h"
@ -167,7 +166,6 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
const char *
NeckoParent::CreateChannelLoadContext(const PBrowserOrId& aBrowser,
nsIPrincipal* aRequestingPrincipal,
PContentParent* aContent,
const SerializedLoadContext& aSerialized,
nsCOMPtr<nsILoadContext> &aResult)
@ -190,23 +188,6 @@ NeckoParent::CreateChannelLoadContext(const PBrowserOrId& aBrowser,
dom::Element* topFrameElement = nullptr;
if (tabParent) {
topFrameElement = tabParent->GetOwnerElement();
} else {
if (!aRequestingPrincipal) {
return "missing associated browser and requesting principal";
}
// If a null tab parent is provided, we rely on comparing the requesting principal's
// reported data against the provided load context's data.
uint32_t reportedAppId = NECKO_UNKNOWN_APP_ID;
nsresult rv = aRequestingPrincipal->GetAppId(&reportedAppId);
if (NS_WARN_IF(NS_FAILED(rv)) || appId != reportedAppId) {
return "app id mismatch for request without associated browser";
}
bool reportedInBrowser = false;
rv = aRequestingPrincipal->GetIsInBrowserElement(&reportedInBrowser);
if (NS_WARN_IF(NS_FAILED(rv)) || reportedInBrowser != inBrowser) {
return "browser element mismatch for request without associated browser";
}
}
aResult = new LoadContext(aSerialized, topFrameElement,
appId, inBrowser);
@ -237,22 +218,8 @@ NeckoParent::AllocPHttpChannelParent(const PBrowserOrId& aBrowser,
const SerializedLoadContext& aSerialized,
const HttpChannelCreationArgs& aOpenArgs)
{
nsCOMPtr<nsIPrincipal> requestingPrincipal;
if (aOpenArgs.type() == HttpChannelCreationArgs::THttpChannelOpenArgs) {
nsresult rv;
requestingPrincipal =
mozilla::ipc::PrincipalInfoToPrincipal(aOpenArgs.get_HttpChannelOpenArgs()
.requestingPrincipalInfo(), &rv);
if (NS_FAILED(rv)) {
printf_stderr("NeckoParent::AllocPHttpChannelParent: "
"FATAL error: couldn't deserialize principal: KILLING CHILD PROCESS\n");
return nullptr;
}
}
nsCOMPtr<nsILoadContext> loadContext;
const char *error = CreateChannelLoadContext(aBrowser, requestingPrincipal, Manager(),
const char *error = CreateChannelLoadContext(aBrowser, Manager(),
aSerialized, loadContext);
if (error) {
printf_stderr("NeckoParent::AllocPHttpChannelParent: "
@ -290,22 +257,8 @@ NeckoParent::AllocPFTPChannelParent(const PBrowserOrId& aBrowser,
const SerializedLoadContext& aSerialized,
const FTPChannelCreationArgs& aOpenArgs)
{
nsCOMPtr<nsIPrincipal> requestingPrincipal;
if (aOpenArgs.type() == FTPChannelCreationArgs::TFTPChannelOpenArgs) {
nsresult rv;
requestingPrincipal =
mozilla::ipc::PrincipalInfoToPrincipal(aOpenArgs.get_FTPChannelOpenArgs()
.requestingPrincipalInfo(), &rv);
if (NS_FAILED(rv)) {
printf_stderr("NeckoParent::AllocPFTPChannelParent: "
"FATAL error: couldn't deserialize principal: KILLING CHILD PROCESS\n");
return nullptr;
}
}
nsCOMPtr<nsILoadContext> loadContext;
const char *error = CreateChannelLoadContext(aBrowser, requestingPrincipal, Manager(),
const char *error = CreateChannelLoadContext(aBrowser, Manager(),
aSerialized, loadContext);
if (error) {
printf_stderr("NeckoParent::AllocPFTPChannelParent: "
@ -369,20 +322,10 @@ NeckoParent::DeallocPWyciwygChannelParent(PWyciwygChannelParent* channel)
PWebSocketParent*
NeckoParent::AllocPWebSocketParent(const PBrowserOrId& browser,
const SerializedLoadContext& serialized,
const PrincipalInfo& requestingPrincipalInfo)
const SerializedLoadContext& serialized)
{
nsresult rv;
nsCOMPtr<nsIPrincipal> requestingPrincipal =
mozilla::ipc::PrincipalInfoToPrincipal(requestingPrincipalInfo, &rv);
if (NS_FAILED(rv)) {
printf_stderr("NeckoParent::AllocPWebSocketParent: "
"FATAL error: couldn't deserialize principal: KILLING CHILD PROCESS\n");
return nullptr;
}
nsCOMPtr<nsILoadContext> loadContext;
const char *error = CreateChannelLoadContext(browser, requestingPrincipal, Manager(),
const char *error = CreateChannelLoadContext(browser, Manager(),
serialized, loadContext);
if (error) {
printf_stderr("NeckoParent::AllocPWebSocketParent: "

View File

@ -48,7 +48,6 @@ public:
MOZ_WARN_UNUSED_RESULT
static const char*
CreateChannelLoadContext(const PBrowserOrId& aBrowser,
nsIPrincipal* aRequestingPrincipal,
PContentParent* aContent,
const SerializedLoadContext& aSerialized,
nsCOMPtr<nsILoadContext> &aResult);
@ -122,8 +121,7 @@ protected:
virtual bool DeallocPFTPChannelParent(PFTPChannelParent*) override;
virtual PWebSocketParent*
AllocPWebSocketParent(const PBrowserOrId& browser,
const SerializedLoadContext& aSerialized,
const PrincipalInfo& requestingPrincipal) override;
const SerializedLoadContext& aSerialized) override;
virtual bool DeallocPWebSocketParent(PWebSocketParent*) override;
virtual PTCPSocketParent* AllocPTCPSocketParent(const nsString& host,
const uint16_t& port) override;

View File

@ -28,7 +28,6 @@ include URIParams;
include InputStreamParams;
include NeckoChannelParams;
include PBrowserOrId;
include PBackgroundSharedTypes;
using class IPC::SerializedLoadContext from "SerializedLoadContext.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
@ -67,8 +66,7 @@ parent:
PFTPChannel(PBrowserOrId browser, SerializedLoadContext loadContext,
FTPChannelCreationArgs args);
PWebSocket(PBrowserOrId browser, SerializedLoadContext loadContext,
PrincipalInfo requestingPrincipalInfo);
PWebSocket(PBrowserOrId browser, SerializedLoadContext loadContext);
PTCPServerSocket(uint16_t localPort, uint16_t backlog, nsString binaryType);
PUDPSocket(Principal principal, nsCString filter);

View File

@ -209,7 +209,7 @@ RemoteOpenFileChild::AsyncRemoteFileOpen(int32_t aFlags,
mTabChild = static_cast<TabChild*>(aTabChild);
if (MissingRequiredTabChild(mTabChild, nullptr, "remoteopenfile")) {
if (MissingRequiredTabChild(mTabChild, "remoteopenfile")) {
return NS_ERROR_ILLEGAL_VALUE;
}

View File

@ -208,7 +208,7 @@ FTPChannelChild::AsyncOpen(::nsIStreamListener* listener, nsISupports* aContext)
if (iTabChild) {
tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
}
if (MissingRequiredTabChild(tabChild, mLoadInfo, "ftp")) {
if (MissingRequiredTabChild(tabChild, "ftp")) {
return NS_ERROR_ILLEGAL_VALUE;
}

View File

@ -1266,7 +1266,7 @@ HttpChannelChild::ConnectParent(uint32_t id)
if (iTabChild) {
tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
}
if (MissingRequiredTabChild(tabChild, mLoadInfo, "http")) {
if (MissingRequiredTabChild(tabChild, "http")) {
return NS_ERROR_ILLEGAL_VALUE;
}
@ -1618,7 +1618,7 @@ HttpChannelChild::ContinueAsyncOpen()
if (iTabChild) {
tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
}
if (MissingRequiredTabChild(tabChild, mLoadInfo, "http")) {
if (MissingRequiredTabChild(tabChild, "http")) {
return NS_ERROR_ILLEGAL_VALUE;
}

View File

@ -494,7 +494,7 @@ WebSocketChannelChild::AsyncOpen(nsIURI *aURI,
if (iTabChild) {
tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
}
if (MissingRequiredTabChild(tabChild, mLoadInfo, "websocket")) {
if (MissingRequiredTabChild(tabChild, "websocket")) {
return NS_ERROR_ILLEGAL_VALUE;
}
@ -507,13 +507,8 @@ WebSocketChannelChild::AsyncOpen(nsIURI *aURI,
WebSocketLoadInfoArgs wsArgs;
propagateLoadInfo(mLoadInfo, wsArgs);
mozilla::ipc::PrincipalInfo requestingPrincipalInfo;
mozilla::ipc::PrincipalToPrincipalInfo(mLoadInfo->LoadingPrincipal(),
&requestingPrincipalInfo);
gNeckoChild->SendPWebSocketConstructor(this, tabChild,
IPC::SerializedLoadContext(this),
requestingPrincipalInfo);
IPC::SerializedLoadContext(this));
if (!SendAsyncOpen(uri, nsCString(aOrigin), mProtocol, mEncrypted,
mPingInterval, mClientSetPingInterval,
mPingResponseTimeout, mClientSetPingTimeout, wsArgs)) {

View File

@ -657,7 +657,7 @@ WyciwygChannelChild::AsyncOpen(nsIStreamListener *aListener, nsISupports *aConte
SerializeURI(mOriginalURI, originalURI);
mozilla::dom::TabChild* tabChild = GetTabChild(this);
if (MissingRequiredTabChild(tabChild, nullptr, "wyciwyg")) {
if (MissingRequiredTabChild(tabChild, "wyciwyg")) {
return NS_ERROR_ILLEGAL_VALUE;
}

View File

@ -134,7 +134,6 @@ WyciwygChannelParent::SetupAppData(const IPC::SerializedLoadContext& loadContext
return true;
const char* error = NeckoParent::CreateChannelLoadContext(aParent,
nullptr,
Manager()->Manager(),
loadContext,
mLoadContext);

View File

@ -401,7 +401,7 @@ OfflineCacheUpdateChild::Schedule()
// the one and only TabChild.
TabChild* child = tabchild ? static_cast<TabChild*>(tabchild.get()) : nullptr;
if (MissingRequiredTabChild(child, nullptr, "offlinecacheupdate")) {
if (MissingRequiredTabChild(child, "offlinecacheupdate")) {
return NS_ERROR_FAILURE;
}