Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Backed out 3 changesets (bug 1442242) for fatal error LNK1120: 1 unre…
Browse files Browse the repository at this point in the history
…solved externals bustages on a CLOSED TREE

Backed out changeset 9f37df3c62e1 (bug 1442242)
Backed out changeset 65b8727bfe76 (bug 1442242)
Backed out changeset 88130a542fb3 (bug 1442242)
  • Loading branch information
nerli1 committed Mar 20, 2018
1 parent 4399b47 commit 65ab607
Show file tree
Hide file tree
Showing 22 changed files with 90 additions and 178 deletions.
3 changes: 1 addition & 2 deletions dom/file/nsHostObjectURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class nsHostObjectURI final
, public nsIURIWithBlobImpl
, public nsSupportsWeakReference
{
private:
public:
nsHostObjectURI(nsIPrincipal* aPrincipal,
mozilla::dom::BlobImpl* aBlobImpl)
: mozilla::net::nsSimpleURI()
Expand All @@ -42,7 +42,6 @@ class nsHostObjectURI final
// For use only from deserialization
nsHostObjectURI() : mozilla::net::nsSimpleURI() {}

public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIURIWITHBLOBIMPL
NS_DECL_NSIURIWITHPRINCIPAL
Expand Down
26 changes: 11 additions & 15 deletions dom/jsurl/nsJSProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1191,31 +1191,28 @@ nsJSProtocolHandler::NewURI(const nsACString &aSpec,
nsIURI *aBaseURI,
nsIURI **result)
{
nsresult rv = NS_OK;
nsresult rv;

// javascript: URLs (currently) have no additional structure beyond that
// provided by standard URLs, so there is no "outer" object given to
// CreateInstance.

NS_MutateURI mutator(new nsJSURI::Mutator());
nsCOMPtr<nsIURI> base(aBaseURI);
mutator.Apply(NS_MutatorMethod(&nsIJSURIMutator::SetBase, base));
nsCOMPtr<nsIURI> url = new nsJSURI(aBaseURI);
NS_MutateURI mutator(url);
if (!aCharset || !nsCRT::strcasecmp("UTF-8", aCharset)) {
mutator.SetSpec(aSpec);
mutator.SetSpec(aSpec);
} else {
nsAutoCString utf8Spec;
rv = EnsureUTF8Spec(PromiseFlatCString(aSpec), aCharset, utf8Spec);
if (NS_FAILED(rv)) {
return rv;
}
nsAutoCString utf8Spec;
rv = EnsureUTF8Spec(PromiseFlatCString(aSpec), aCharset, utf8Spec);
if (NS_SUCCEEDED(rv)) {
if (utf8Spec.IsEmpty()) {
mutator.SetSpec(aSpec);
mutator.SetSpec(aSpec);
} else {
mutator.SetSpec(utf8Spec);
mutator.SetSpec(utf8Spec);
}
}
}

nsCOMPtr<nsIURI> url;
rv = mutator.Finalize(url);
if (NS_FAILED(rv)) {
return rv;
Expand Down Expand Up @@ -1394,8 +1391,7 @@ nsJSURI::StartClone(mozilla::net::nsSimpleURI::RefHandlingEnum refHandlingMode,
NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsJSURI::Mutator,
nsIURISetters,
nsIURIMutator,
nsISerializable,
nsIJSURIMutator)
nsISerializable)

NS_IMETHODIMP
nsJSURI::Mutate(nsIURIMutator** aMutator)
Expand Down
17 changes: 5 additions & 12 deletions dom/jsurl/nsJSProtocolHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "nsISerializable.h"
#include "nsIClassInfo.h"
#include "nsSimpleURI.h"
#include "nsINestedURI.h"

#define NS_JSPROTOCOLHANDLER_CID \
{ /* bfc310d2-38a0-11d3-8cd3-0060b0fc14a3 */ \
Expand Down Expand Up @@ -69,13 +68,18 @@ class nsJSProtocolHandler : public nsIProtocolHandler
nsCOMPtr<nsITextToSubURI> mTextToSubURI;
};


class nsJSURI final
: public mozilla::net::nsSimpleURI
{
public:
using mozilla::net::nsSimpleURI::Read;
using mozilla::net::nsSimpleURI::Write;

nsJSURI() {}

explicit nsJSURI(nsIURI* aBaseURI) : mBaseURI(aBaseURI) {}

nsIURI* GetBaseURI() const
{
return mBaseURI;
Expand All @@ -101,9 +105,6 @@ class nsJSURI final
//NS_IMETHOD QueryInterface( const nsIID& aIID, void** aInstancePtr ) override;

protected:
nsJSURI() {}
explicit nsJSURI(nsIURI* aBaseURI) : mBaseURI(aBaseURI) {}

virtual ~nsJSURI() {}

virtual nsresult EqualsInternal(nsIURI* other,
Expand All @@ -120,7 +121,6 @@ class nsJSURI final
: public nsIURIMutator
, public BaseURIMutator<nsJSURI>
, public nsISerializable
, public nsIJSURIMutator
{
NS_DECL_ISUPPORTS
NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
Expand All @@ -138,13 +138,6 @@ class nsJSURI final
return InitFromInputStream(aStream);
}

MOZ_MUST_USE NS_IMETHOD
SetBase(nsIURI* aBaseURI) override
{
mURI = new nsJSURI(aBaseURI);
return NS_OK;
}

explicit Mutator() { }
private:
virtual ~Mutator() { }
Expand Down
3 changes: 3 additions & 0 deletions image/decoders/icon/nsIconModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
{ 0x99, 0x5, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }

NS_GENERIC_FACTORY_CONSTRUCTOR(nsIconProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMozIconURI)
typedef nsMozIconURI::Mutator nsMozIconURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMozIconURIMutator)

NS_DEFINE_NAMED_CID(NS_ICONPROTOCOL_CID);
NS_DEFINE_NAMED_CID(NS_MOZICONURI_CID);
NS_DEFINE_NAMED_CID(NS_MOZICONURIMUTATOR_CID);

static const mozilla::Module::CIDEntry kIconCIDs[] = {
{ &kNS_ICONPROTOCOL_CID, false, nullptr, nsIconProtocolHandlerConstructor },
{ &kNS_MOZICONURI_CID, false, nullptr, nsMozIconURIConstructor },
{ &kNS_MOZICONURIMUTATOR_CID, false, nullptr, nsMozIconURIMutatorConstructor },
{ nullptr }
};
Expand Down
4 changes: 3 additions & 1 deletion image/decoders/icon/nsIconURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class nsMozIconURI final
NS_DECL_NSIIPCSERIALIZABLEURI
NS_DECL_NSINESTEDURI

protected:
// nsMozIconURI
nsMozIconURI();

protected:
virtual ~nsMozIconURI();
nsCOMPtr<nsIURL> mIconURL; // a URL that we want the icon for
uint32_t mSize; // the # of pixels in a row that we want for this image.
Expand Down
9 changes: 0 additions & 9 deletions modules/libjar/nsIJARURI.idl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,3 @@ interface nsIJARURI : nsIURL {
*/
nsIJARURI cloneWithJARFile(in nsIURI jarFile);
};

[builtinclass, uuid(d66df117-eda7-4324-b4e4-1f670ff6718e)]
interface nsIJARURIMutator : nsISupports
{
/**
* Will initalize a URI using the passed spec, baseURI and charset.
*/
void setSpecBaseCharset(in AUTF8String aSpec, in nsIURI aBase, in string aCharset);
};
20 changes: 15 additions & 5 deletions modules/libjar/nsJARProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,21 @@ nsJARProtocolHandler::NewURI(const nsACString &aSpec,
nsIURI *aBaseURI,
nsIURI **result)
{
nsCOMPtr<nsIURI> base(aBaseURI);
return NS_MutateURI(new nsJARURI::Mutator())
.Apply(NS_MutatorMethod(&nsIJARURIMutator::SetSpecBaseCharset,
nsCString(aSpec), base, aCharset))
.Finalize(result);
nsresult rv = NS_OK;

RefPtr<nsJARURI> jarURI = new nsJARURI();
if (!jarURI)
return NS_ERROR_OUT_OF_MEMORY;

rv = jarURI->Init(aCharset);
NS_ENSURE_SUCCESS(rv, rv);

rv = jarURI->SetSpecWithBase(aSpec, aBaseURI);
if (NS_FAILED(rv))
return rv;

NS_ADDREF(*result = jarURI);
return rv;
}

NS_IMETHODIMP
Expand Down
3 changes: 1 addition & 2 deletions modules/libjar/nsJARURI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsJARURI::Mutator,
nsIURISetters,
nsIURIMutator,
nsIURLMutator,
nsISerializable,
nsIJARURIMutator)
nsISerializable)

NS_IMETHODIMP
nsJARURI::Mutator::SetFileName(const nsACString& aFileName, nsIURIMutator** aMutator)
Expand Down
32 changes: 4 additions & 28 deletions modules/libjar/nsJARURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,19 @@ class nsJARURI final : public nsIJARURI,
NS_DECLARE_STATIC_IID_ACCESSOR(NS_THIS_JARURI_IMPL_CID)

// nsJARURI
nsJARURI();

nsresult Init(const char *charsetHint);
nsresult FormatSpec(const nsACString &entryPath, nsACString &result,
bool aIncludeScheme = true);
nsresult CreateEntryURL(const nsACString& entryFilename,
const char* charset,
nsIURL** url);
nsresult SetSpecWithBase(const nsACString& aSpec, nsIURI* aBaseURL);

protected:
nsJARURI();
virtual ~nsJARURI();
nsresult SetJAREntry(const nsACString &entryPath);
nsresult Init(const char *charsetHint);
nsresult SetSpecWithBase(const nsACString& aSpec, nsIURI* aBaseURL);

// enum used in a few places to specify how .ref attribute should be handled
enum RefHandlingEnum {
Expand Down Expand Up @@ -125,7 +126,6 @@ class nsJARURI final : public nsIJARURI,
, public BaseURIMutator<nsJARURI>
, public nsIURLMutator
, public nsISerializable
, public nsIJARURIMutator
{
NS_DECL_ISUPPORTS
NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
Expand All @@ -144,30 +144,6 @@ class nsJARURI final : public nsIJARURI,
return InitFromInputStream(aStream);
}

NS_IMETHOD
SetSpecBaseCharset(const nsACString& aSpec,
nsIURI* aBaseURI,
const char* aCharset) override
{
RefPtr<nsJARURI> uri;
if (mURI) {
mURI.swap(uri);
} else {
uri = new nsJARURI();
}

nsresult rv = uri->Init(aCharset);
NS_ENSURE_SUCCESS(rv, rv);

rv = uri->SetSpecWithBase(aSpec, aBaseURI);
if (NS_FAILED(rv)) {
return rv;
}

mURI.swap(uri);
return NS_OK;
}

explicit Mutator() { }
private:
virtual ~Mutator() { }
Expand Down
5 changes: 0 additions & 5 deletions netwerk/base/nsIFileURL.idl
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ interface nsIFileURL : nsIURL
[scriptable, builtinclass, uuid(a588b6f2-d2b9-4024-84c7-be3368546b57)]
interface nsIFileURLMutator : nsISupports
{
/*
* - Marks the inner URI implementation as one that supports nsIFileURL.
*/
[must_use, noscript] void markFileURL();

/*
* - Setter clones the nsIFile object (allowing the caller to safely modify
* the nsIFile object after setting it on this interface).
Expand Down
29 changes: 0 additions & 29 deletions netwerk/base/nsINestedURI.idl
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,3 @@ interface nsINestedURI : nsISupports
*/
readonly attribute nsIURI innermostURI;
};

[scriptable, builtinclass, uuid(ca3d6c03-4eee-4271-a97a-d16c0a0b2c5c)]
interface nsINestedURIMutator : nsISupports
{
/*
* - Creates a new URI with the given innerURI.
*/
[must_use, noscript] void init(in nsIURI innerURI);
};

[scriptable, builtinclass, uuid(c6357a3b-c2bb-4b4b-9278-513377398a38)]
interface nsINestedAboutURIMutator : nsISupports
{
/*
* - Creates a new URI with the given innerURI and base.
*/
[must_use, noscript] void initWithBase(in nsIURI innerURI, in nsIURI baseURI);
};

[scriptable, builtinclass, uuid(3bd44535-08ea-478f-99b9-85fa1084e820)]
interface nsIJSURIMutator : nsISupports
{
/*
* - Inits the URI by setting the base URI
* - It is the caller's responsibility to also call SetSpec afterwards,
* otherwise we will return an incomplete URI (with only a base)
*/
[must_use, noscript] void setBase(in nsIURI aBaseURI);
};
11 changes: 3 additions & 8 deletions netwerk/base/nsIURIMutator.idl
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ class BaseURIMutator
// in order to avoid code duplication
// Class type T should be the type of the class that implements nsIURI
protected:
virtual T* Create()
{
return new T();
}

MOZ_MUST_USE nsresult InitFromURI(T* aURI)
{
nsCOMPtr<nsIURI> clone;
Expand All @@ -50,7 +45,7 @@ protected:

MOZ_MUST_USE nsresult InitFromInputStream(nsIObjectInputStream* aStream)
{
RefPtr<T> uri = Create();
RefPtr<T> uri = new T();
nsresult rv = uri->ReadPrivate(aStream);
if (NS_FAILED(rv)) {
return rv;
Expand All @@ -61,7 +56,7 @@ protected:

MOZ_MUST_USE nsresult InitFromIPCParams(const mozilla::ipc::URIParams& aParams)
{
RefPtr<T> uri = Create();
RefPtr<T> uri = new T();
bool ret = uri->Deserialize(aParams);
if (!ret) {
return NS_ERROR_FAILURE;
Expand All @@ -78,7 +73,7 @@ protected:
// This only works because all other Init methods create a new object
mURI.swap(uri);
} else {
uri = Create();
uri = new T();
}

rv = uri->SetSpecInternal(aSpec);
Expand Down
3 changes: 1 addition & 2 deletions netwerk/base/nsSimpleNestedURI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ nsSimpleNestedURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsSimpleNestedURI::Mutator,
nsIURISetters,
nsIURIMutator,
nsISerializable,
nsINestedURIMutator)
nsISerializable)

NS_IMETHODIMP
nsSimpleNestedURI::Mutate(nsIURIMutator** aMutator)
Expand Down
Loading

0 comments on commit 65ab607

Please sign in to comment.