mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 908530 part 1. Make Link::GetURI return a raw pointer so we don't have to include nsIURI.h in Link.h. r=khuey
This commit is contained in:
parent
253a8c8d80
commit
12e653e224
@ -111,27 +111,20 @@ Link::LinkState() const
|
||||
return nsEventStates();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
nsIURI*
|
||||
Link::GetURI() const
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri(mCachedURI);
|
||||
|
||||
// If we have this URI cached, use it.
|
||||
if (uri) {
|
||||
return uri.forget();
|
||||
if (mCachedURI) {
|
||||
return mCachedURI;
|
||||
}
|
||||
|
||||
// Otherwise obtain it.
|
||||
Link *self = const_cast<Link *>(this);
|
||||
Element *element = self->mElement;
|
||||
uri = element->GetHrefURI();
|
||||
mCachedURI = element->GetHrefURI();
|
||||
|
||||
// We want to cache the URI if we have it
|
||||
if (uri) {
|
||||
mCachedURI = uri;
|
||||
}
|
||||
|
||||
return uri.forget();
|
||||
return mCachedURI;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -20,9 +20,9 @@ namespace dom {
|
||||
|
||||
class Element;
|
||||
|
||||
#define MOZILLA_DOM_LINK_IMPLEMENTATION_IID \
|
||||
{ 0x7EA57721, 0xE373, 0x458E, \
|
||||
{0x8F, 0x44, 0xF8, 0x96, 0x56, 0xB4, 0x14, 0xF5 } }
|
||||
#define MOZILLA_DOM_LINK_IMPLEMENTATION_IID \
|
||||
{ 0xb25edee6, 0xdd35, 0x4f8b, \
|
||||
{ 0xab, 0x90, 0x66, 0xd0, 0xbd, 0x3c, 0x22, 0xd5 } }
|
||||
|
||||
class Link : public nsISupports
|
||||
{
|
||||
@ -45,8 +45,8 @@ public:
|
||||
/**
|
||||
* @return the URI this link is for, if available.
|
||||
*/
|
||||
already_AddRefed<nsIURI> GetURI() const;
|
||||
virtual already_AddRefed<nsIURI> GetURIExternal() const {
|
||||
nsIURI* GetURI() const;
|
||||
virtual nsIURI* GetURIExternal() const {
|
||||
return GetURI();
|
||||
}
|
||||
|
||||
@ -111,11 +111,11 @@ protected:
|
||||
*/
|
||||
bool HasURI() const
|
||||
{
|
||||
if (mCachedURI)
|
||||
if (HasCachedURI()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> uri(GetURI());
|
||||
return !!uri;
|
||||
return !!GetURI();
|
||||
}
|
||||
|
||||
nsIURI* GetCachedURI() const { return mCachedURI; }
|
||||
|
@ -329,7 +329,8 @@ HTMLLinkElement::GetStyleSheetURL(bool* aIsInline)
|
||||
if (href.IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return Link::GetURI();
|
||||
nsCOMPtr<nsIURI> uri = Link::GetURI();
|
||||
return uri.forget();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -101,8 +101,8 @@ Link::ResetLinkState(bool aNotify, bool aHasHref)
|
||||
NS_NOTREACHED("Unexpected call to Link::ResetLinkState");
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
Link::GetURI() const
|
||||
nsIURI*
|
||||
Link::GetURI() const
|
||||
{
|
||||
NS_NOTREACHED("Unexpected call to Link::GetURI");
|
||||
return nullptr; // suppress compiler warning
|
||||
|
Loading…
Reference in New Issue
Block a user