Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1442239) for xpcshell failures at widget…
Browse files Browse the repository at this point in the history
…/tests/unit/test_taskbar_jumplistitems.js on a CLOSED TREE

Backed out changeset 513cd669aca1 (bug 1442239)
Backed out changeset aef4c73f736f (bug 1442239)
  • Loading branch information
AndreeaPavel committed Mar 19, 2018
1 parent 0d0ba06 commit bf7160f
Show file tree
Hide file tree
Showing 24 changed files with 101 additions and 324 deletions.
5 changes: 5 additions & 0 deletions caps/NullPrincipalURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ class NullPrincipalURI final : public nsIURI
return InitFromIPCParams(aParams);
}

NS_IMETHOD Read(nsIObjectInputStream* aStream) override
{
return NS_ERROR_NOT_IMPLEMENTED;
}

NS_IMETHOD Finalize(nsIURI** aURI) override
{
mURI.forget(aURI);
Expand Down
10 changes: 2 additions & 8 deletions dom/file/nsHostObjectURI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ nsHostObjectURI::GetPrincipalUri(nsIURI** aUri)
NS_IMETHODIMP
nsHostObjectURI::Read(nsIObjectInputStream* aStream)
{
nsresult rv = mozilla::net::nsSimpleURI::ReadPrivate(aStream);
nsresult rv = mozilla::net::nsSimpleURI::Read(aStream);
NS_ENSURE_SUCCESS(rv, rv);

nsCOMPtr<nsISupports> supports;
Expand Down Expand Up @@ -230,13 +230,7 @@ nsHostObjectURI::EqualsInternal(nsIURI* aOther,
return NS_OK;
}

// Queries this list of interfaces. If none match, it queries mURI.
NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsHostObjectURI::Mutator,
nsIURISetters,
nsIURIMutator,
nsIBlobURIMutator,
nsIPrincipalURIMutator,
nsISerializable)
NS_IMPL_ISUPPORTS(nsHostObjectURI::Mutator, nsIURISetters, nsIURIMutator, nsIBlobURIMutator, nsIPrincipalURIMutator)

NS_IMETHODIMP
nsHostObjectURI::Mutate(nsIURIMutator** aMutator)
Expand Down
17 changes: 0 additions & 17 deletions dom/file/nsHostObjectURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,11 @@ class nsHostObjectURI final
, public BaseURIMutator<nsHostObjectURI>
, public nsIBlobURIMutator
, public nsIPrincipalURIMutator
, public nsISerializable
{
NS_DECL_ISUPPORTS
NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
NS_DEFINE_NSIMUTATOR_COMMON

NS_IMETHOD
Write(nsIObjectOutputStream *aOutputStream) override
{
return NS_ERROR_NOT_IMPLEMENTED;
}

MOZ_MUST_USE NS_IMETHOD
Read(nsIObjectInputStream* aStream) override
{
return InitFromInputStream(aStream);
}

MOZ_MUST_USE NS_IMETHOD
SetBlobImpl(mozilla::dom::BlobImpl *aBlobImpl) override
{
Expand Down Expand Up @@ -137,8 +124,4 @@ class nsHostObjectURI final
{ 0xf5475c51, 0x59a7, 0x4757, \
{ 0xb3, 0xd9, 0xe2, 0x11, 0xa9, 0x41, 0x08, 0x72 } }

#define NS_HOSTOBJECTURIMUTATOR_CID \
{ 0xbbe50ef2, 0x80eb, 0x469d, \
{ 0xb7, 0x0d, 0x02, 0x85, 0x82, 0x75, 0x38, 0x9f } }

#endif /* nsHostObjectURI_h */
17 changes: 3 additions & 14 deletions dom/jsurl/nsJSProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,16 +1283,9 @@ NS_INTERFACE_MAP_END_INHERITING(mozilla::net::nsSimpleURI)
// nsISerializable methods:

NS_IMETHODIMP
nsJSURI::Read(nsIObjectInputStream *aStream)
nsJSURI::Read(nsIObjectInputStream* aStream)
{
NS_NOTREACHED("Use nsIURIMutator.read() instead");
return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult
nsJSURI::ReadPrivate(nsIObjectInputStream *aStream)
{
nsresult rv = mozilla::net::nsSimpleURI::ReadPrivate(aStream);
nsresult rv = mozilla::net::nsSimpleURI::Read(aStream);
if (NS_FAILED(rv)) return rv;

bool haveBase;
Expand Down Expand Up @@ -1387,11 +1380,7 @@ nsJSURI::StartClone(mozilla::net::nsSimpleURI::RefHandlingEnum refHandlingMode,
return url;
}

// Queries this list of interfaces. If none match, it queries mURI.
NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsJSURI::Mutator,
nsIURISetters,
nsIURIMutator,
nsISerializable)
NS_IMPL_ISUPPORTS(nsJSURI::Mutator, nsIURISetters, nsIURIMutator)

NS_IMETHODIMP
nsJSURI::Mutate(nsIURIMutator** aMutator)
Expand Down
22 changes: 0 additions & 22 deletions dom/jsurl/nsJSProtocolHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@
{0xa9, 0x35, 0xd0, 0xc8, 0x74, 0x12, 0x89, 0x30} \
}

#define NS_JSURIMUTATOR_CID \
{ /* 574ce83e-fe9f-4095-b85c-7909abbf7c37 */ \
0x574ce83e, \
0xfe9f, \
0x4095, \
{0xb8, 0x5c, 0x79, 0x09, 0xab, 0xbf, 0x7c, 0x37} \
}

#define NS_JSPROTOCOLHANDLER_CONTRACTID \
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "javascript"

Expand Down Expand Up @@ -111,7 +103,6 @@ class nsJSURI final
RefHandlingEnum refHandlingMode,
bool* result) override;
bool Deserialize(const mozilla::ipc::URIParams&);
nsresult ReadPrivate(nsIObjectInputStream *aStream);

private:
nsCOMPtr<nsIURI> mBaseURI;
Expand All @@ -120,24 +111,11 @@ class nsJSURI final
class Mutator final
: public nsIURIMutator
, public BaseURIMutator<nsJSURI>
, public nsISerializable
{
NS_DECL_ISUPPORTS
NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
NS_DEFINE_NSIMUTATOR_COMMON

NS_IMETHOD
Write(nsIObjectOutputStream *aOutputStream) override
{
return NS_ERROR_NOT_IMPLEMENTED;
}

MOZ_MUST_USE NS_IMETHOD
Read(nsIObjectInputStream* aStream) override
{
return InitFromInputStream(aStream);
}

explicit Mutator() { }
private:
virtual ~Mutator() { }
Expand Down
5 changes: 5 additions & 0 deletions image/decoders/icon/nsIconURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class nsMozIconURI final
return InitFromIPCParams(aParams);
}

NS_IMETHOD Read(nsIObjectInputStream* aStream) override
{
return NS_ERROR_NOT_IMPLEMENTED;
}

NS_IMETHOD Finalize(nsIURI** aURI) override
{
mURI.forget(aURI);
Expand Down
50 changes: 25 additions & 25 deletions js/xpconnect/tests/unit/test_classesByID_instanceof.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
function testActual(CSPContextClassByID)
function testActual(SimpleURIClassByID)
{
var cspContext =
Cc["@mozilla.org/cspcontext;1"].createInstance();
var simpleURI =
Cc["@mozilla.org/network/simple-uri;1"].createInstance();

Assert.equal(cspContext instanceof CSPContextClassByID, true);
Assert.equal(simpleURI instanceof SimpleURIClassByID, true);
}

function testInherited(CSPContextClassByID)
function testInherited(SimpleURIClassByID)
{
var cspContext =
Cc["@mozilla.org/cspcontext;1"].createInstance();
var simpleURI =
Cc["@mozilla.org/network/simple-uri;1"].createInstance();

var inherited = Object.create(cspContext);
var inherited = Object.create(simpleURI);

Assert.equal(inherited instanceof CSPContextClassByID, true);
Assert.equal(inherited instanceof SimpleURIClassByID, true);
}

function testInheritedCrossGlobal(CSPContextClassByID)
function testInheritedCrossGlobal(SimpleURIClassByID)
{
var cspContext =
Cc["@mozilla.org/cspcontext;1"].createInstance();
var simpleURI =
Cc["@mozilla.org/network/simple-uri;1"].createInstance();

var sb = new Cu.Sandbox(this, { wantComponents: true });
var inheritedCross = sb.Object.create(cspContext);
var inheritedCross = sb.Object.create(simpleURI);

Assert.equal(inheritedCross instanceof CSPContextClassByID, true);
Assert.equal(inheritedCross instanceof SimpleURIClassByID, true);
}

function testCrossGlobalArbitraryGetPrototype(CSPContextClassByID)
function testCrossGlobalArbitraryGetPrototype(SimpleURIClassByID)
{
var cspContext =
Cc["@mozilla.org/cspcontext;1"].createInstance();
var simpleURI =
Cc["@mozilla.org/network/simple-uri;1"].createInstance();

var sb = new Cu.Sandbox(this, { wantComponents: true });
var firstLevel = Object.create(cspContext);
var firstLevel = Object.create(simpleURI);

var obj = { shouldThrow: false };
var secondLevel =
Expand All @@ -53,7 +53,7 @@ function testCrossGlobalArbitraryGetPrototype(CSPContextClassByID)
var err;
try
{
void (thirdLevel instanceof CSPContextClassByID);
void (thirdLevel instanceof SimpleURIClassByID);
}
catch (e)
{
Expand All @@ -66,14 +66,14 @@ function testCrossGlobalArbitraryGetPrototype(CSPContextClassByID)

obj.shouldThrow = false;

Assert.equal(thirdLevel instanceof CSPContextClassByID, true);
Assert.equal(thirdLevel instanceof SimpleURIClassByID, true);
}

function run_test() {
var CSPContextClassByID = Components.classesByID["{09d9ed1a-e5d4-4004-bfe0-27ceb923d9ac}"];
var SimpleURIClassByID = Components.classesByID["{e0da1d70-2f7b-11d3-8cd0-0060b0fc14a3}"];

testActual(CSPContextClassByID);
testInherited(CSPContextClassByID);
testInheritedCrossGlobal(CSPContextClassByID);
testCrossGlobalArbitraryGetPrototype(CSPContextClassByID);
testActual(SimpleURIClassByID);
testInherited(SimpleURIClassByID);
testInheritedCrossGlobal(SimpleURIClassByID);
testCrossGlobalArbitraryGetPrototype(SimpleURIClassByID);
}
14 changes: 4 additions & 10 deletions layout/build/nsLayoutModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ already_AddRefed<nsIPresentationService> NS_CreatePresentationService();
// Factory Constructor
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(txNodeSetAdaptor, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMSerializer)
typedef nsHostObjectURI::Mutator nsHostObjectURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHostObjectURIMutator)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHostObjectURI)
NS_GENERIC_FACTORY_CONSTRUCTOR(DOMParser)
NS_GENERIC_FACTORY_CONSTRUCTOR(LocalStorageManager)
NS_GENERIC_FACTORY_CONSTRUCTOR(SessionStorageManager)
Expand Down Expand Up @@ -435,8 +434,7 @@ MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManag

NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init)

typedef nsJSURI::Mutator nsJSURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSURIMutator)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSURI)

// views are not refcounted, so this is the same as
// NS_GENERIC_FACTORY_CONSTRUCTOR without the NS_ADDREF/NS_RELEASE
Expand Down Expand Up @@ -575,7 +573,6 @@ NS_DEFINE_NAMED_CID(NS_XULDOCUMENT_CID);
NS_DEFINE_NAMED_CID(NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
NS_DEFINE_NAMED_CID(NS_JSPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_JSURI_CID);
NS_DEFINE_NAMED_CID(NS_JSURIMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_WINDOWCOMMANDTABLE_CID);
NS_DEFINE_NAMED_CID(NS_WINDOWCONTROLLER_CID);
NS_DEFINE_NAMED_CID(NS_PLUGINDOCLOADERFACTORY_CID);
Expand All @@ -585,7 +582,6 @@ NS_DEFINE_NAMED_CID(NS_STYLESHEETSERVICE_CID);
NS_DEFINE_NAMED_CID(TRANSFORMIIX_NODESET_CID);
NS_DEFINE_NAMED_CID(NS_XMLSERIALIZER_CID);
NS_DEFINE_NAMED_CID(NS_HOSTOBJECTURI_CID);
NS_DEFINE_NAMED_CID(NS_HOSTOBJECTURIMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_DOMPARSER_CID);
NS_DEFINE_NAMED_CID(NS_DOMSESSIONSTORAGEMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_DOMLOCALSTORAGEMANAGER_CID);
Expand Down Expand Up @@ -823,8 +819,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
#endif
{ &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID, false, nullptr, CreateContentDLF },
{ &kNS_JSPROTOCOLHANDLER_CID, false, nullptr, nsJSProtocolHandler::Create },
{ &kNS_JSURI_CID, false, nullptr, nsJSURIMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_JSURIMUTATOR_CID, false, nullptr, nsJSURIMutatorConstructor },
{ &kNS_JSURI_CID, false, nullptr, nsJSURIConstructor },
{ &kNS_WINDOWCOMMANDTABLE_CID, false, nullptr, CreateWindowCommandTableConstructor },
{ &kNS_WINDOWCONTROLLER_CID, false, nullptr, CreateWindowControllerWithSingletonCommandTable },
{ &kNS_PLUGINDOCLOADERFACTORY_CID, false, nullptr, CreateContentDLF },
Expand All @@ -833,8 +828,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_STYLESHEETSERVICE_CID, false, nullptr, nsStyleSheetServiceConstructor },
{ &kTRANSFORMIIX_NODESET_CID, false, nullptr, txNodeSetAdaptorConstructor },
{ &kNS_XMLSERIALIZER_CID, false, nullptr, nsDOMSerializerConstructor },
{ &kNS_HOSTOBJECTURI_CID, false, nullptr, nsHostObjectURIMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_HOSTOBJECTURIMUTATOR_CID, false, nullptr, nsHostObjectURIMutatorConstructor },
{ &kNS_HOSTOBJECTURI_CID, false, nullptr, nsHostObjectURIConstructor },
{ &kNS_DOMPARSER_CID, false, nullptr, DOMParserConstructor },
{ &kNS_DOMSESSIONSTORAGEMANAGER_CID, false, nullptr, SessionStorageManagerConstructor },
{ &kNS_DOMLOCALSTORAGEMANAGER_CID, false, nullptr, LocalStorageManagerConstructor },
Expand Down
3 changes: 2 additions & 1 deletion modules/libjar/nsJARFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAR)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsZipReaderCache)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsJARProtocolHandler,
nsJARProtocolHandler::GetSingleton)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJARURI)

typedef nsJARURI::Mutator nsJARURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJARURIMutator)
Expand All @@ -34,7 +35,7 @@ static const mozilla::Module::CIDEntry kJARCIDs[] = {
{ &kNS_ZIPREADER_CID, false, nullptr, nsJARConstructor },
{ &kNS_ZIPREADERCACHE_CID, false, nullptr, nsZipReaderCacheConstructor },
{ &kNS_JARPROTOCOLHANDLER_CID, false, nullptr, nsJARProtocolHandlerConstructor },
{ &kNS_JARURI_CID, false, nullptr, nsJARURIMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_JARURI_CID, false, nullptr, nsJARURIConstructor },
{ &kNS_JARURIMUTATOR_CID, false, nullptr, nsJARURIMutatorConstructor },
{ nullptr }
};
Expand Down
16 changes: 2 additions & 14 deletions modules/libjar/nsJARURI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,7 @@ nsJARURI::CreateEntryURL(const nsACString& entryFilename,
// nsISerializable methods:

NS_IMETHODIMP
nsJARURI::Read(nsIObjectInputStream *aStream)
{
NS_NOTREACHED("Use nsIURIMutator.read() instead");
return NS_ERROR_NOT_IMPLEMENTED;
}

nsresult
nsJARURI::ReadPrivate(nsIObjectInputStream *aInputStream)
nsJARURI::Read(nsIObjectInputStream* aInputStream)
{
nsresult rv;

Expand Down Expand Up @@ -263,12 +256,7 @@ nsJARURI::SetSpecInternal(const nsACString& aSpec)
return SetSpecWithBase(aSpec, nullptr);
}

// Queries this list of interfaces. If none match, it queries mURI.
NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsJARURI::Mutator,
nsIURISetters,
nsIURIMutator,
nsIURLMutator,
nsISerializable)
NS_IMPL_ISUPPORTS(nsJARURI::Mutator, nsIURISetters, nsIURIMutator, nsIURLMutator)

NS_IMETHODIMP
nsJARURI::Mutator::SetFileName(const nsACString& aFileName, nsIURIMutator** aMutator)
Expand Down
14 changes: 0 additions & 14 deletions modules/libjar/nsJARURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class nsJARURI final : public nsIJARURI,
nsresult SetQuery(const nsACString &input);
nsresult SetQueryWithEncoding(const nsACString &input, const Encoding* encoding);
bool Deserialize(const mozilla::ipc::URIParams&);
nsresult ReadPrivate(nsIObjectInputStream *aStream);

nsresult SetFileNameInternal(const nsACString& fileName);
nsresult SetFileBaseNameInternal(const nsACString& fileBaseName);
Expand All @@ -125,25 +124,12 @@ class nsJARURI final : public nsIJARURI,
: public nsIURIMutator
, public BaseURIMutator<nsJARURI>
, public nsIURLMutator
, public nsISerializable
{
NS_DECL_ISUPPORTS
NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
NS_DEFINE_NSIMUTATOR_COMMON
NS_DECL_NSIURLMUTATOR

NS_IMETHOD
Write(nsIObjectOutputStream *aOutputStream) override
{
return NS_ERROR_NOT_IMPLEMENTED;
}

MOZ_MUST_USE NS_IMETHOD
Read(nsIObjectInputStream* aStream) override
{
return InitFromInputStream(aStream);
}

explicit Mutator() { }
private:
virtual ~Mutator() { }
Expand Down
Loading

0 comments on commit bf7160f

Please sign in to comment.