Backed out changeset 2bdaed564656 (bug 1125961) for b2g emulator mochitest-21 failures starting in test_fetch_event_client_postmessage.html

This commit is contained in:
Wes Kocher 2015-07-30 14:53:38 -07:00
parent 2366731881
commit 9b80d96625
19 changed files with 25 additions and 137 deletions

View File

@ -1,4 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'b2g'
support-files =
worker.js
worker2.js
@ -157,7 +158,7 @@ support-files =
sw_clients/dummy.html
[test_app_protocol.html]
skip-if = release_build || buildapp == 'b2g' # bug 1184427
skip-if = release_build
[test_bug1151916.html]
[test_claim.html]
[test_claim_fetch.html]
@ -173,15 +174,10 @@ skip-if = release_build || buildapp == 'b2g' # bug 1184427
[test_force_refresh.html]
[test_gzip_redirect.html]
[test_https_fetch.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_https_fetch_cloned_response.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_https_origin_after_redirect.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_https_origin_after_redirect_cached.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_https_synth_fetch_from_cached_sw.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_importscript.html]
[test_install_event.html]
[test_installation_simple.html]
@ -192,22 +188,16 @@ skip-if = buildapp == 'b2g' # bug 1184427
[test_match_all_client_properties.html]
[test_navigator.html]
[test_origin_after_redirect.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_origin_after_redirect_cached.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_origin_after_redirect_to_https.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_origin_after_redirect_to_https_cached.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_periodic_https_update.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_periodic_update.html]
[test_post_message.html]
[test_post_message_advanced.html]
[test_post_message_source.html]
[test_register_base.html]
[test_register_https_in_http.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_request_context_audio.html]
[test_request_context_beacon.html]
[test_request_context_cache.html]
@ -247,7 +237,6 @@ skip-if = buildapp == 'b2g' # bug 1184427
[test_skip_waiting.html]
[test_strict_mode_error.html]
[test_third_party_iframes.html]
skip-if = buildapp == 'b2g' # bug 1184427
[test_unregister.html]
[test_workerUnregister.html]
[test_workerUpdate.html]

View File

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

View File

@ -98,7 +98,6 @@ struct HttpChannelConnectArgs
{
uint32_t channelId;
bool shouldIntercept;
OptionalLoadInfoArgs loadInfo;
};
union HttpChannelCreationArgs
@ -123,7 +122,6 @@ struct FTPChannelOpenArgs
struct FTPChannelConnectArgs
{
uint32_t channelId;
OptionalLoadInfoArgs loadInfo;
};
union FTPChannelCreationArgs

View File

@ -157,8 +157,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;
@ -122,11 +121,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"
@ -171,7 +170,6 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
const char *
NeckoParent::CreateChannelLoadContext(const PBrowserOrId& aBrowser,
nsIPrincipal* aRequestingPrincipal,
PContentParent* aContent,
const SerializedLoadContext& aSerialized,
nsCOMPtr<nsILoadContext> &aResult)
@ -194,23 +192,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;
aRequestingPrincipal->GetAppId(&reportedAppId);
if (appId != reportedAppId) {
return "app id mismatch for request without associated browser";
}
bool reportedInBrowser = false;
aRequestingPrincipal->GetIsInBrowserElement(&reportedInBrowser);
if (reportedInBrowser != inBrowser) {
return "browser element mismatch for request without associated browser";
}
}
aResult = new LoadContext(aSerialized, topFrameElement,
appId, inBrowser);
@ -241,26 +222,8 @@ NeckoParent::AllocPHttpChannelParent(const PBrowserOrId& aBrowser,
const SerializedLoadContext& aSerialized,
const HttpChannelCreationArgs& aOpenArgs)
{
const OptionalLoadInfoArgs& infoArgs =
aOpenArgs.type() == HttpChannelCreationArgs::THttpChannelOpenArgs ?
aOpenArgs.get_HttpChannelOpenArgs().loadInfo() :
aOpenArgs.get_HttpChannelConnectArgs().loadInfo();
nsCOMPtr<nsILoadInfo> loadInfo;
nsresult rv = mozilla::ipc::LoadInfoArgsToLoadInfo(infoArgs, getter_AddRefs(loadInfo));
if (NS_FAILED(rv)) {
printf_stderr("NeckoParent::AllocPHttpChannelParent: "
"FATAL error: couldn't deserialize load info: KILLING CHILD PROCESS\n");
return nullptr;
}
nsCOMPtr<nsIPrincipal> requestingPrincipal;
if (loadInfo) {
requestingPrincipal = loadInfo->LoadingPrincipal();
}
nsCOMPtr<nsILoadContext> loadContext;
const char *error = CreateChannelLoadContext(aBrowser, requestingPrincipal, Manager(),
const char *error = CreateChannelLoadContext(aBrowser, Manager(),
aSerialized, loadContext);
if (error) {
printf_stderr("NeckoParent::AllocPHttpChannelParent: "
@ -298,26 +261,8 @@ NeckoParent::AllocPFTPChannelParent(const PBrowserOrId& aBrowser,
const SerializedLoadContext& aSerialized,
const FTPChannelCreationArgs& aOpenArgs)
{
const OptionalLoadInfoArgs& infoArgs =
aOpenArgs.type() == FTPChannelCreationArgs::TFTPChannelOpenArgs ?
aOpenArgs.get_FTPChannelOpenArgs().loadInfo() :
aOpenArgs.get_FTPChannelConnectArgs().loadInfo();
nsCOMPtr<nsILoadInfo> loadInfo;
nsresult rv = mozilla::ipc::LoadInfoArgsToLoadInfo(infoArgs, getter_AddRefs(loadInfo));
if (NS_FAILED(rv)) {
printf_stderr("NeckoParent::AllocPFTPChannelParent: "
"FATAL error: couldn't deserialize load info: KILLING CHILD PROCESS\n");
return nullptr;
}
nsCOMPtr<nsIPrincipal> requestingPrincipal;
if (loadInfo) {
requestingPrincipal = loadInfo->LoadingPrincipal();
}
nsCOMPtr<nsILoadContext> loadContext;
const char *error = CreateChannelLoadContext(aBrowser, requestingPrincipal, Manager(),
const char *error = CreateChannelLoadContext(aBrowser, Manager(),
aSerialized, loadContext);
if (error) {
printf_stderr("NeckoParent::AllocPFTPChannelParent: "
@ -381,20 +326,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

@ -51,7 +51,6 @@ public:
MOZ_WARN_UNUSED_RESULT
static const char*
CreateChannelLoadContext(const PBrowserOrId& aBrowser,
nsIPrincipal* aRequestingPrincipal,
PContentParent* aContent,
const SerializedLoadContext& aSerialized,
nsCOMPtr<nsILoadContext> &aResult);
@ -125,8 +124,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

@ -210,7 +210,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

@ -169,7 +169,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;
}
@ -718,10 +718,7 @@ FTPChannelChild::ConnectParent(uint32_t id)
// until OnStopRequest, or we do a redirect, or we hit an IPDL error.
AddIPDLReference();
FTPChannelConnectArgs connectArgs;
connectArgs.channelId() = id;
nsresult rv = mozilla::ipc::LoadInfoToLoadInfoArgs(mLoadInfo, &connectArgs.loadInfo());
NS_ENSURE_SUCCESS(rv, rv);
FTPChannelConnectArgs connectArgs(id);
if (!gNeckoChild->SendPFTPChannelConstructor(this, tabChild,
IPC::SerializedLoadContext(this),

View File

@ -1271,7 +1271,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;
}
@ -1279,12 +1279,7 @@ HttpChannelChild::ConnectParent(uint32_t id)
// until OnStopRequest, or we do a redirect, or we hit an IPDL error.
AddIPDLReference();
HttpChannelConnectArgs connectArgs;
connectArgs.channelId() = id;
connectArgs.shouldIntercept() = mShouldParentIntercept;
nsresult rv = mozilla::ipc::LoadInfoToLoadInfoArgs(mLoadInfo, &connectArgs.loadInfo());
NS_ENSURE_SUCCESS(rv, rv);
HttpChannelConnectArgs connectArgs(id, mShouldParentIntercept);
PBrowserOrId browser = static_cast<ContentChild*>(gNeckoChild->Manager())
->GetBrowserOrId(tabChild);
if (!gNeckoChild->
@ -1600,7 +1595,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

@ -473,7 +473,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;
}
@ -487,14 +487,8 @@ WebSocketChannelChild::AsyncOpen(nsIURI *aURI,
nsresult rv = LoadInfoToLoadInfoArgs(mLoadInfo, &loadInfoArgs);
NS_ENSURE_SUCCESS(rv, rv);
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, loadInfoArgs)) {

View File

@ -667,7 +667,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

@ -20,14 +20,11 @@ function cached_handler(metadata, response) {
function makeChan(url, appId, inBrowser) {
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var uri = ios.newURI(url, null, null);
var chan = ios.newChannel2(url,
null,
null,
null, // aLoadingNode
Services.scriptSecurityManager.getAppCodebasePrincipal(uri,
appId,
inBrowser),
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER).QueryInterface(Ci.nsIHttpChannel);

View File

@ -49,16 +49,11 @@ var i = 0;
function setupChannel(path)
{
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var uri = ios.newURI(URL + path, null, null);
var appId = tests[i].loadContext.appId;
var inBrowser = tests[i].loadContext.isInBrowserElement;
var chan = ios.newChannel2(URL + path,
"",
null,
null, // aLoadingNode
Services.scriptSecurityManager.getAppCodebasePrincipal(uri,
appId,
inBrowser),
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);

View File

@ -8,14 +8,11 @@ function inChildProcess() {
function makeChan(url, appId, inBrowser) {
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var uri = ios.newURI(url, null, null);
var chan = ios.newChannel2(url,
null,
null,
null, // aLoadingNode
Services.scriptSecurityManager.getAppCodebasePrincipal(uri,
appId,
inBrowser),
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER).QueryInterface(Ci.nsIHttpChannel);

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;
}