зеркало из https://github.com/mozilla/pjs.git
Dropping 'Impl' from class names to keep things more sane. rs=peterv@propagandism.org
This commit is contained in:
Родитель
7b72974f45
Коммит
b7a9a380c8
|
@ -1627,10 +1627,10 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
|||
// nsIControllers. These objects prevent their global
|
||||
// object's script object from being garbage collected,
|
||||
// which means JS continues to hold an owning reference
|
||||
// to the GlobalWindowImpl, which owns the document,
|
||||
// to the nsGlobalWindow, which owns the document,
|
||||
// which owns this content. That's a cycle, so we break
|
||||
// it here. (It might be better to break this by releasing
|
||||
// mDocument in GlobalWindowImpl::SetDocShell, but I'm not
|
||||
// mDocument in nsGlobalWindow::SetDocShell, but I'm not
|
||||
// sure whether that would fix all possible cycles through
|
||||
// mControllers.)
|
||||
if (!aDocument && mSlots) {
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
// permissive to least permissive so that it's safe to push state in
|
||||
// all situations. Pushing popup state onto the stack never makes the
|
||||
// current popup state less permissive (see
|
||||
// GlobalWindowImpl::PushPopupControlState()).
|
||||
// nsGlobalWindow::PushPopupControlState()).
|
||||
enum PopupControlState {
|
||||
openAllowed = 0, // open that window without worries
|
||||
openControlled, // it's a popup, but allow it
|
||||
|
@ -72,7 +72,7 @@ enum OpenAllowValue {
|
|||
|
||||
class nsIDocShell;
|
||||
class nsIFocusController;
|
||||
struct nsTimeoutImpl;
|
||||
struct nsTimeout;
|
||||
|
||||
#define NS_PIDOMWINDOW_IID \
|
||||
{ 0x7e12a2d6, 0x9a2a, 0x4907, \
|
||||
|
@ -147,7 +147,7 @@ protected:
|
|||
nsCOMPtr<nsIDOMDocument> mDocument; // strong
|
||||
nsIDOMElement *mFrameElement; // weak
|
||||
nsCOMPtr<nsIURI> mOpenerScriptURL; // strong; used to determine whether to clear scope
|
||||
nsTimeoutImpl *mRunningTimeout;
|
||||
nsTimeout *mRunningTimeout;
|
||||
|
||||
PRUint32 mMutationBits;
|
||||
|
||||
|
|
|
@ -51,36 +51,36 @@
|
|||
//
|
||||
// Basic (virtual) BarProp class implementation
|
||||
//
|
||||
BarPropImpl::BarPropImpl() : mBrowserChrome(nsnull)
|
||||
nsBarProp::nsBarProp() : mBrowserChrome(nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
BarPropImpl::~BarPropImpl()
|
||||
nsBarProp::~nsBarProp()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// QueryInterface implementation for BarPropImpl
|
||||
NS_INTERFACE_MAP_BEGIN(BarPropImpl)
|
||||
// QueryInterface implementation for BarProp
|
||||
NS_INTERFACE_MAP_BEGIN(nsBarProp)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMBarProp)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BarProp)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ADDREF(BarPropImpl)
|
||||
NS_IMPL_RELEASE(BarPropImpl)
|
||||
NS_IMPL_ADDREF(nsBarProp)
|
||||
NS_IMPL_RELEASE(nsBarProp)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
BarPropImpl::SetWebBrowserChrome(nsIWebBrowserChrome* aBrowserChrome)
|
||||
nsBarProp::SetWebBrowserChrome(nsIWebBrowserChrome* aBrowserChrome)
|
||||
{
|
||||
mBrowserChrome = aBrowserChrome;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
BarPropImpl::GetVisibleByFlag(PRBool *aVisible, PRUint32 aChromeFlag)
|
||||
nsBarProp::GetVisibleByFlag(PRBool *aVisible, PRUint32 aChromeFlag)
|
||||
{
|
||||
NS_ENSURE_TRUE(mBrowserChrome, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -96,7 +96,7 @@ BarPropImpl::GetVisibleByFlag(PRBool *aVisible, PRUint32 aChromeFlag)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
BarPropImpl::SetVisibleByFlag(PRBool aVisible, PRUint32 aChromeFlag)
|
||||
nsBarProp::SetVisibleByFlag(PRBool aVisible, PRUint32 aChromeFlag)
|
||||
{
|
||||
NS_ENSURE_TRUE(mBrowserChrome, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -127,145 +127,153 @@ BarPropImpl::SetVisibleByFlag(PRBool aVisible, PRUint32 aChromeFlag)
|
|||
// MenubarProp class implementation
|
||||
//
|
||||
|
||||
MenubarPropImpl::MenubarPropImpl()
|
||||
nsMenubarProp::nsMenubarProp()
|
||||
{
|
||||
}
|
||||
|
||||
MenubarPropImpl::~MenubarPropImpl()
|
||||
nsMenubarProp::~nsMenubarProp()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MenubarPropImpl::GetVisible(PRBool *aVisible)
|
||||
nsMenubarProp::GetVisible(PRBool *aVisible)
|
||||
{
|
||||
return BarPropImpl::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_MENUBAR);
|
||||
return nsBarProp::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_MENUBAR);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MenubarPropImpl::SetVisible(PRBool aVisible)
|
||||
nsMenubarProp::SetVisible(PRBool aVisible)
|
||||
{
|
||||
return BarPropImpl::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_MENUBAR);
|
||||
return nsBarProp::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_MENUBAR);
|
||||
}
|
||||
|
||||
//
|
||||
// ToolbarProp class implementation
|
||||
//
|
||||
|
||||
ToolbarPropImpl::ToolbarPropImpl()
|
||||
nsToolbarProp::nsToolbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
ToolbarPropImpl::~ToolbarPropImpl()
|
||||
nsToolbarProp::~nsToolbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ToolbarPropImpl::GetVisible(PRBool *aVisible)
|
||||
nsToolbarProp::GetVisible(PRBool *aVisible)
|
||||
{
|
||||
return BarPropImpl::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_TOOLBAR);
|
||||
return nsBarProp::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_TOOLBAR);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ToolbarPropImpl::SetVisible(PRBool aVisible)
|
||||
nsToolbarProp::SetVisible(PRBool aVisible)
|
||||
{
|
||||
return BarPropImpl::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_TOOLBAR);
|
||||
return nsBarProp::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_TOOLBAR);
|
||||
}
|
||||
|
||||
//
|
||||
// LocationbarProp class implementation
|
||||
//
|
||||
|
||||
LocationbarPropImpl::LocationbarPropImpl()
|
||||
nsLocationbarProp::nsLocationbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
LocationbarPropImpl::~LocationbarPropImpl()
|
||||
nsLocationbarProp::~nsLocationbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationbarPropImpl::GetVisible(PRBool *aVisible)
|
||||
nsLocationbarProp::GetVisible(PRBool *aVisible)
|
||||
{
|
||||
return BarPropImpl::GetVisibleByFlag(aVisible, nsIWebBrowserChrome::CHROME_LOCATIONBAR);
|
||||
return
|
||||
nsBarProp::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_LOCATIONBAR);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationbarPropImpl::SetVisible(PRBool aVisible)
|
||||
nsLocationbarProp::SetVisible(PRBool aVisible)
|
||||
{
|
||||
return BarPropImpl::SetVisibleByFlag(aVisible, nsIWebBrowserChrome::CHROME_LOCATIONBAR);
|
||||
return
|
||||
nsBarProp::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_LOCATIONBAR);
|
||||
}
|
||||
|
||||
//
|
||||
// PersonalbarProp class implementation
|
||||
//
|
||||
|
||||
PersonalbarPropImpl::PersonalbarPropImpl()
|
||||
nsPersonalbarProp::nsPersonalbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
PersonalbarPropImpl::~PersonalbarPropImpl()
|
||||
nsPersonalbarProp::~nsPersonalbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PersonalbarPropImpl::GetVisible(PRBool *aVisible)
|
||||
nsPersonalbarProp::GetVisible(PRBool *aVisible)
|
||||
{
|
||||
return BarPropImpl::GetVisibleByFlag(aVisible, nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR);
|
||||
return
|
||||
nsBarProp::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PersonalbarPropImpl::SetVisible(PRBool aVisible)
|
||||
nsPersonalbarProp::SetVisible(PRBool aVisible)
|
||||
{
|
||||
return BarPropImpl::SetVisibleByFlag(aVisible, nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR);
|
||||
return
|
||||
nsBarProp::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR);
|
||||
}
|
||||
|
||||
//
|
||||
// StatusbarProp class implementation
|
||||
//
|
||||
|
||||
StatusbarPropImpl::StatusbarPropImpl()
|
||||
nsStatusbarProp::nsStatusbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
StatusbarPropImpl::~StatusbarPropImpl()
|
||||
nsStatusbarProp::~nsStatusbarProp()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StatusbarPropImpl::GetVisible(PRBool *aVisible)
|
||||
nsStatusbarProp::GetVisible(PRBool *aVisible)
|
||||
{
|
||||
return BarPropImpl::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_STATUSBAR);
|
||||
return nsBarProp::GetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_STATUSBAR);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StatusbarPropImpl::SetVisible(PRBool aVisible)
|
||||
nsStatusbarProp::SetVisible(PRBool aVisible)
|
||||
{
|
||||
return BarPropImpl::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_STATUSBAR);
|
||||
return nsBarProp::SetVisibleByFlag(aVisible,
|
||||
nsIWebBrowserChrome::CHROME_STATUSBAR);
|
||||
}
|
||||
|
||||
//
|
||||
// ScrollbarsProp class implementation
|
||||
//
|
||||
|
||||
ScrollbarsPropImpl::ScrollbarsPropImpl(GlobalWindowImpl *aWindow)
|
||||
nsScrollbarsProp::nsScrollbarsProp(nsGlobalWindow *aWindow)
|
||||
{
|
||||
mDOMWindow = aWindow;
|
||||
nsISupports *supwin = NS_STATIC_CAST(nsIScriptGlobalObject *, aWindow);
|
||||
mDOMWindowWeakref = do_GetWeakReference(supwin);
|
||||
}
|
||||
|
||||
ScrollbarsPropImpl::~ScrollbarsPropImpl()
|
||||
nsScrollbarsProp::~nsScrollbarsProp()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScrollbarsPropImpl::GetVisible(PRBool *aVisible)
|
||||
nsScrollbarsProp::GetVisible(PRBool *aVisible)
|
||||
{
|
||||
*aVisible = PR_TRUE; // one assumes
|
||||
|
||||
|
@ -291,7 +299,7 @@ ScrollbarsPropImpl::GetVisible(PRBool *aVisible)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScrollbarsPropImpl::SetVisible(PRBool aVisible)
|
||||
nsScrollbarsProp::SetVisible(PRBool aVisible)
|
||||
{
|
||||
/* Scrollbars, unlike the other barprops, implement visibility directly
|
||||
rather than handing off to the superclass (and from there to the
|
||||
|
|
|
@ -49,14 +49,15 @@
|
|||
#include "nsIDOMBarProp.h"
|
||||
#include "nsIWeakReference.h"
|
||||
|
||||
class GlobalWindowImpl;
|
||||
class nsGlobalWindow;
|
||||
class nsIWebBrowserChrome;
|
||||
|
||||
// Script "BarProp" object
|
||||
class BarPropImpl : public nsIDOMBarProp {
|
||||
class nsBarProp : public nsIDOMBarProp
|
||||
{
|
||||
public:
|
||||
BarPropImpl();
|
||||
virtual ~BarPropImpl();
|
||||
nsBarProp();
|
||||
virtual ~nsBarProp();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
@ -71,60 +72,65 @@ protected:
|
|||
};
|
||||
|
||||
// Script "menubar" object
|
||||
class MenubarPropImpl : public BarPropImpl {
|
||||
class nsMenubarProp : public nsBarProp
|
||||
{
|
||||
public:
|
||||
MenubarPropImpl();
|
||||
virtual ~MenubarPropImpl();
|
||||
nsMenubarProp();
|
||||
virtual ~nsMenubarProp();
|
||||
|
||||
NS_DECL_NSIDOMBARPROP
|
||||
};
|
||||
|
||||
// Script "toolbar" object
|
||||
class ToolbarPropImpl : public BarPropImpl {
|
||||
class nsToolbarProp : public nsBarProp
|
||||
{
|
||||
public:
|
||||
ToolbarPropImpl();
|
||||
virtual ~ToolbarPropImpl();
|
||||
nsToolbarProp();
|
||||
virtual ~nsToolbarProp();
|
||||
|
||||
NS_DECL_NSIDOMBARPROP
|
||||
};
|
||||
|
||||
// Script "locationbar" object
|
||||
class LocationbarPropImpl : public BarPropImpl {
|
||||
class nsLocationbarProp : public nsBarProp
|
||||
{
|
||||
public:
|
||||
LocationbarPropImpl();
|
||||
virtual ~LocationbarPropImpl();
|
||||
nsLocationbarProp();
|
||||
virtual ~nsLocationbarProp();
|
||||
|
||||
NS_DECL_NSIDOMBARPROP
|
||||
};
|
||||
|
||||
// Script "personalbar" object
|
||||
class PersonalbarPropImpl : public BarPropImpl {
|
||||
class nsPersonalbarProp : public nsBarProp
|
||||
{
|
||||
public:
|
||||
PersonalbarPropImpl();
|
||||
virtual ~PersonalbarPropImpl();
|
||||
nsPersonalbarProp();
|
||||
virtual ~nsPersonalbarProp();
|
||||
|
||||
NS_DECL_NSIDOMBARPROP
|
||||
};
|
||||
|
||||
// Script "statusbar" object
|
||||
class StatusbarPropImpl : public BarPropImpl {
|
||||
class nsStatusbarProp : public nsBarProp
|
||||
{
|
||||
public:
|
||||
StatusbarPropImpl();
|
||||
virtual ~StatusbarPropImpl();
|
||||
nsStatusbarProp();
|
||||
virtual ~nsStatusbarProp();
|
||||
|
||||
NS_DECL_NSIDOMBARPROP
|
||||
};
|
||||
|
||||
// Script "scrollbars" object
|
||||
class ScrollbarsPropImpl : public BarPropImpl {
|
||||
class nsScrollbarsProp : public nsBarProp {
|
||||
public:
|
||||
ScrollbarsPropImpl(GlobalWindowImpl *aWindow);
|
||||
virtual ~ScrollbarsPropImpl();
|
||||
nsScrollbarsProp(nsGlobalWindow *aWindow);
|
||||
virtual ~nsScrollbarsProp();
|
||||
|
||||
NS_DECL_NSIDOMBARPROP
|
||||
|
||||
private:
|
||||
GlobalWindowImpl *mDOMWindow;
|
||||
nsGlobalWindow *mDOMWindow;
|
||||
nsCOMPtr<nsIWeakReference> mDOMWindowWeakref;
|
||||
/* Note the odd double reference to the owning global window.
|
||||
Since the corresponding DOM window nominally owns this object,
|
||||
|
|
|
@ -452,7 +452,7 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
// The Window class lets you QI into interfaces that are not in the
|
||||
// flattened set (i.e. nsIXPCScriptable::CLASSINFO_INTERFACES_ONLY
|
||||
// is not set), because of this make sure all scriptable interfaces
|
||||
// that are implemented by GlobalWindowImpl can securely be exposed
|
||||
// that are implemented by nsGlobalWindow can securely be exposed
|
||||
// to JS.
|
||||
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ nsDOMScriptObjectFactory::Observe(nsISupports *aSubject,
|
|||
}
|
||||
}
|
||||
|
||||
GlobalWindowImpl::ShutDown();
|
||||
nsGlobalWindow::ShutDown();
|
||||
nsDOMClassInfo::ShutDown();
|
||||
nsJSEnvironment::ShutDown();
|
||||
|
||||
|
|
|
@ -51,16 +51,18 @@ NS_INTERFACE_MAP_END
|
|||
NS_IMPL_ADDREF(nsDOMWindowUtils)
|
||||
NS_IMPL_RELEASE(nsDOMWindowUtils)
|
||||
|
||||
nsDOMWindowUtils::nsDOMWindowUtils(GlobalWindowImpl *aWindow) :
|
||||
mWindow(aWindow) {
|
||||
nsDOMWindowUtils::nsDOMWindowUtils(nsGlobalWindow *aWindow)
|
||||
: mWindow(aWindow)
|
||||
{
|
||||
}
|
||||
|
||||
nsDOMWindowUtils::~nsDOMWindowUtils() {
|
||||
nsDOMWindowUtils::~nsDOMWindowUtils()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetImageAnimationMode(PRUint16 *aMode) {
|
||||
|
||||
nsDOMWindowUtils::GetImageAnimationMode(PRUint16 *aMode)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aMode);
|
||||
*aMode = 0;
|
||||
if (mWindow) {
|
||||
|
@ -78,8 +80,8 @@ nsDOMWindowUtils::GetImageAnimationMode(PRUint16 *aMode) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::SetImageAnimationMode(PRUint16 aMode) {
|
||||
|
||||
nsDOMWindowUtils::SetImageAnimationMode(PRUint16 aMode)
|
||||
{
|
||||
if (mWindow) {
|
||||
nsIDocShell *docShell = mWindow->GetDocShell();
|
||||
if (docShell) {
|
||||
|
|
|
@ -40,17 +40,17 @@
|
|||
|
||||
#include "nsIDOMWindowUtils.h"
|
||||
|
||||
class GlobalWindowImpl;
|
||||
class nsGlobalWindow;
|
||||
|
||||
class nsDOMWindowUtils : public nsIDOMWindowUtils,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
nsDOMWindowUtils(GlobalWindowImpl *aWindow);
|
||||
nsDOMWindowUtils(nsGlobalWindow *aWindow);
|
||||
~nsDOMWindowUtils();
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMWINDOWUTILS
|
||||
|
||||
protected:
|
||||
nsRefPtr<GlobalWindowImpl> mWindow;
|
||||
nsRefPtr<nsGlobalWindow> mWindow;
|
||||
};
|
||||
|
|
|
@ -84,8 +84,8 @@ nsFocusController::~nsFocusController(void)
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS4(nsFocusController, nsIFocusController,
|
||||
nsIDOMFocusListener, nsIDOMEventListener, nsSupportsWeakReference)
|
||||
NS_IMPL_ISUPPORTS4(nsFocusController, nsIFocusController, nsIDOMFocusListener,
|
||||
nsIDOMEventListener, nsSupportsWeakReference)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFocusController::Create(nsIFocusController** aResult)
|
||||
|
@ -186,7 +186,8 @@ nsFocusController::UpdateCommands(const nsAString& aEventName)
|
|||
if (domDoc) {
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
|
||||
|
||||
nsCOMPtr<nsIDOMWindowInternal> window(do_QueryInterface(doc->GetScriptGlobalObject()));
|
||||
nsCOMPtr<nsIDOMWindowInternal> window =
|
||||
do_QueryInterface(doc->GetScriptGlobalObject());
|
||||
if (window)
|
||||
window->UpdateCommands(aEventName);
|
||||
}
|
||||
|
@ -198,8 +199,9 @@ nsFocusController::UpdateCommands(const nsAString& aEventName)
|
|||
NS_IMETHODIMP
|
||||
nsFocusController::GetControllers(nsIControllers** aResult)
|
||||
{
|
||||
//XXX: we should fix this so there's a generic interface that describes controllers,
|
||||
// so this code would have no special knowledge of what object might have controllers.
|
||||
// XXX: we should fix this so there's a generic interface that
|
||||
// describes controllers, so this code would have no special
|
||||
// knowledge of what object might have controllers.
|
||||
if (mCurrentElement) {
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
|
@ -208,16 +210,19 @@ nsFocusController::GetControllers(nsIControllers** aResult)
|
|||
return xulElement->GetControllers(aResult);
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIDOMNSHTMLTextAreaElement> htmlTextArea(do_QueryInterface(mCurrentElement));
|
||||
nsCOMPtr<nsIDOMNSHTMLTextAreaElement> htmlTextArea =
|
||||
do_QueryInterface(mCurrentElement);
|
||||
if (htmlTextArea)
|
||||
return htmlTextArea->GetControllers(aResult);
|
||||
|
||||
nsCOMPtr<nsIDOMNSHTMLInputElement> htmlInputElement(do_QueryInterface(mCurrentElement));
|
||||
nsCOMPtr<nsIDOMNSHTMLInputElement> htmlInputElement =
|
||||
do_QueryInterface(mCurrentElement);
|
||||
if (htmlInputElement)
|
||||
return htmlInputElement->GetControllers(aResult);
|
||||
}
|
||||
else if (mCurrentWindow) {
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow(do_QueryInterface(mCurrentWindow));
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow =
|
||||
do_QueryInterface(mCurrentWindow);
|
||||
if (domWindow)
|
||||
return domWindow->GetControllers(aResult);
|
||||
}
|
||||
|
@ -365,21 +370,24 @@ nsFocusController::Blur(nsIDOMEvent* aEvent)
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsFocusController::GetParentWindowFromDocument(nsIDOMDocument* aDocument, nsIDOMWindowInternal** aWindow)
|
||||
nsFocusController::GetParentWindowFromDocument(nsIDOMDocument* aDocument,
|
||||
nsIDOMWindowInternal** aWindow)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aWindow);
|
||||
|
||||
nsCOMPtr<nsIDocument> objectOwner = do_QueryInterface(aDocument);
|
||||
if(!objectOwner) return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(objectOwner->GetScriptGlobalObject());
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow =
|
||||
do_QueryInterface(objectOwner->GetScriptGlobalObject());
|
||||
*aWindow = domWindow;
|
||||
NS_IF_ADDREF(*aWindow);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFocusController::GetControllerForCommand(const char * aCommand, nsIController** _retval)
|
||||
nsFocusController::GetControllerForCommand(const char * aCommand,
|
||||
nsIController** _retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = nsnull;
|
||||
|
@ -406,21 +414,22 @@ nsFocusController::GetControllerForCommand(const char * aCommand, nsIController*
|
|||
currentWindow = do_QueryInterface(domWindow);
|
||||
}
|
||||
else if (mCurrentWindow) {
|
||||
GlobalWindowImpl *win =
|
||||
NS_STATIC_CAST(GlobalWindowImpl*,
|
||||
NS_STATIC_CAST(nsIDOMWindowInternal*, mCurrentWindow));
|
||||
nsGlobalWindow *win =
|
||||
NS_STATIC_CAST(nsGlobalWindow *,
|
||||
NS_STATIC_CAST(nsIDOMWindowInternal *, mCurrentWindow));
|
||||
currentWindow = win->GetPrivateParent();
|
||||
}
|
||||
else return NS_OK;
|
||||
|
||||
while(currentWindow) {
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(currentWindow);
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow(do_QueryInterface(currentWindow));
|
||||
if(domWindow) {
|
||||
nsCOMPtr<nsIControllers> controllers2;
|
||||
domWindow->GetControllers(getter_AddRefs(controllers2));
|
||||
if(controllers2) {
|
||||
nsCOMPtr<nsIController> controller;
|
||||
controllers2->GetControllerForCommand(aCommand, getter_AddRefs(controller));
|
||||
controllers2->GetControllerForCommand(aCommand,
|
||||
getter_AddRefs(controller));
|
||||
if(controller) {
|
||||
*_retval = controller;
|
||||
NS_ADDREF(*_retval);
|
||||
|
@ -428,9 +437,9 @@ nsFocusController::GetControllerForCommand(const char * aCommand, nsIController*
|
|||
}
|
||||
}
|
||||
}
|
||||
GlobalWindowImpl *win =
|
||||
NS_STATIC_CAST(GlobalWindowImpl*,
|
||||
NS_STATIC_CAST(nsIDOMWindowInternal*, currentWindow));
|
||||
nsGlobalWindow *win =
|
||||
NS_STATIC_CAST(nsGlobalWindow *,
|
||||
NS_STATIC_CAST(nsIDOMWindowInternal *, currentWindow));
|
||||
currentWindow = win->GetPrivateParent();
|
||||
}
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -96,34 +96,34 @@ class nsPresContext;
|
|||
class nsIDOMEvent;
|
||||
class nsIScrollableView;
|
||||
|
||||
typedef struct nsTimeoutImpl nsTimeoutImpl;
|
||||
typedef struct nsTimeout nsTimeout;
|
||||
|
||||
class BarPropImpl;
|
||||
class LocationImpl;
|
||||
class NavigatorImpl;
|
||||
class ScreenImpl;
|
||||
class HistoryImpl;
|
||||
class nsBarProp;
|
||||
class nsLocation;
|
||||
class nsNavigator;
|
||||
class nsScreen;
|
||||
class nsHistory;
|
||||
class nsIDocShellLoadInfo;
|
||||
|
||||
//*****************************************************************************
|
||||
// GlobalWindowImpl: Global Object for Scripting
|
||||
// nsGlobalWindow: Global Object for Scripting
|
||||
//*****************************************************************************
|
||||
// Beware that all scriptable interfaces implemented by
|
||||
// GlobalWindowImpl will be reachable from JS, if you make this class
|
||||
// nsGlobalWindow will be reachable from JS, if you make this class
|
||||
// implement new interfaces you better know what you're
|
||||
// doing. Security wise this is very sensitive code. --
|
||||
// jst@netscape.com
|
||||
|
||||
|
||||
class GlobalWindowImpl : public nsIScriptGlobalObject,
|
||||
public nsPIDOMWindow,
|
||||
public nsIDOMJSWindow,
|
||||
public nsIScriptObjectPrincipal,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIDOM3EventTarget,
|
||||
public nsIDOMViewCSS,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIInterfaceRequestor
|
||||
class nsGlobalWindow : public nsIScriptGlobalObject,
|
||||
public nsPIDOMWindow,
|
||||
public nsIDOMJSWindow,
|
||||
public nsIScriptObjectPrincipal,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIDOM3EventTarget,
|
||||
public nsIDOMViewCSS,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIInterfaceRequestor
|
||||
{
|
||||
public:
|
||||
// public methods
|
||||
|
@ -208,14 +208,14 @@ public:
|
|||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
|
||||
// Object Management
|
||||
GlobalWindowImpl();
|
||||
nsGlobalWindow();
|
||||
|
||||
static void ShutDown();
|
||||
static PRBool IsCallerChrome();
|
||||
|
||||
protected:
|
||||
// Object Management
|
||||
virtual ~GlobalWindowImpl();
|
||||
virtual ~nsGlobalWindow();
|
||||
void CleanUp();
|
||||
void ClearControllers();
|
||||
|
||||
|
@ -236,11 +236,10 @@ protected:
|
|||
|
||||
// Timeout Functions
|
||||
nsresult SetTimeoutOrInterval(PRBool aIsInterval, PRInt32* aReturn);
|
||||
void RunTimeout(nsTimeoutImpl *aTimeout);
|
||||
void RunTimeout(nsTimeout *aTimeout);
|
||||
nsresult ClearTimeoutOrInterval();
|
||||
void ClearAllTimeouts();
|
||||
void InsertTimeoutIntoList(nsTimeoutImpl **aInsertionPoint,
|
||||
nsTimeoutImpl *aTimeout);
|
||||
void InsertTimeoutIntoList(nsTimeout **aInsertionPoint, nsTimeout *aTimeout);
|
||||
static void TimerCallback(nsITimer *aTimer, void *aClosure);
|
||||
|
||||
// Helper Functions
|
||||
|
@ -313,20 +312,20 @@ protected:
|
|||
nsCOMPtr<nsIControllers> mControllers;
|
||||
nsCOMPtr<nsIEventListenerManager> mListenerManager;
|
||||
JSObject* mJSObject;
|
||||
nsRefPtr<NavigatorImpl> mNavigator;
|
||||
nsRefPtr<ScreenImpl> mScreen;
|
||||
nsRefPtr<HistoryImpl> mHistory;
|
||||
nsRefPtr<nsNavigator> mNavigator;
|
||||
nsRefPtr<nsScreen> mScreen;
|
||||
nsRefPtr<nsHistory> mHistory;
|
||||
nsRefPtr<nsDOMWindowList> mFrames;
|
||||
nsRefPtr<LocationImpl> mLocation;
|
||||
nsRefPtr<BarPropImpl> mMenubar;
|
||||
nsRefPtr<BarPropImpl> mToolbar;
|
||||
nsRefPtr<BarPropImpl> mLocationbar;
|
||||
nsRefPtr<BarPropImpl> mPersonalbar;
|
||||
nsRefPtr<BarPropImpl> mStatusbar;
|
||||
nsRefPtr<BarPropImpl> mScrollbars;
|
||||
nsRefPtr<nsLocation> mLocation;
|
||||
nsRefPtr<nsBarProp> mMenubar;
|
||||
nsRefPtr<nsBarProp> mToolbar;
|
||||
nsRefPtr<nsBarProp> mLocationbar;
|
||||
nsRefPtr<nsBarProp> mPersonalbar;
|
||||
nsRefPtr<nsBarProp> mStatusbar;
|
||||
nsRefPtr<nsBarProp> mScrollbars;
|
||||
nsCOMPtr<nsIWeakReference> mWindowUtils;
|
||||
nsTimeoutImpl* mTimeouts;
|
||||
nsTimeoutImpl** mTimeoutInsertionPoint;
|
||||
nsTimeout* mTimeouts;
|
||||
nsTimeout** mTimeoutInsertionPoint;
|
||||
PRUint32 mTimeoutPublicIdCounter;
|
||||
PRUint32 mTimeoutFiringDepth;
|
||||
nsString mStatus;
|
||||
|
@ -355,10 +354,10 @@ protected:
|
|||
};
|
||||
|
||||
/*
|
||||
* nsGlobalChromeWindow inherits from GlobalWindowImpl. It is the global
|
||||
* nsGlobalChromeWindow inherits from nsGlobalWindow. It is the global
|
||||
* object created for a Chrome Window only.
|
||||
*/
|
||||
class nsGlobalChromeWindow : public GlobalWindowImpl,
|
||||
class nsGlobalChromeWindow : public nsGlobalWindow,
|
||||
public nsIDOMChromeWindow
|
||||
{
|
||||
public:
|
||||
|
@ -378,9 +377,9 @@ protected:
|
|||
* Timeout struct that holds information about each JavaScript
|
||||
* timeout.
|
||||
*/
|
||||
struct nsTimeoutImpl
|
||||
struct nsTimeout
|
||||
{
|
||||
nsTimeoutImpl()
|
||||
nsTimeout()
|
||||
{
|
||||
#ifdef DEBUG_jst
|
||||
{
|
||||
|
@ -392,10 +391,10 @@ struct nsTimeoutImpl
|
|||
|
||||
memset(this, 0, sizeof(*this));
|
||||
|
||||
MOZ_COUNT_CTOR(nsTimeoutImpl);
|
||||
MOZ_COUNT_CTOR(nsTimeout);
|
||||
}
|
||||
|
||||
~nsTimeoutImpl()
|
||||
~nsTimeout()
|
||||
{
|
||||
#ifdef DEBUG_jst
|
||||
{
|
||||
|
@ -405,14 +404,14 @@ struct nsTimeoutImpl
|
|||
}
|
||||
#endif
|
||||
|
||||
MOZ_COUNT_DTOR(nsTimeoutImpl);
|
||||
MOZ_COUNT_DTOR(nsTimeout);
|
||||
}
|
||||
|
||||
void Release(nsIScriptContext* aContext);
|
||||
void AddRef();
|
||||
|
||||
// Window for which this timeout fires
|
||||
GlobalWindowImpl *mWindow;
|
||||
nsGlobalWindow *mWindow;
|
||||
|
||||
// The JS expression to evaluate or function to call, if !mExpr
|
||||
JSString *mExpr;
|
||||
|
@ -454,7 +453,7 @@ struct nsTimeoutImpl
|
|||
|
||||
// Pointer to the next timeout in the linked list of scheduled
|
||||
// timeouts
|
||||
nsTimeoutImpl *mNext;
|
||||
nsTimeout *mNext;
|
||||
|
||||
// The popup state at timeout creation time if not created from
|
||||
// another timeout
|
||||
|
@ -466,15 +465,15 @@ private:
|
|||
};
|
||||
|
||||
//*****************************************************************************
|
||||
// NavigatorImpl: Script "navigator" object
|
||||
// nsNavigator: Script "navigator" object
|
||||
//*****************************************************************************
|
||||
|
||||
class NavigatorImpl : public nsIDOMNavigator,
|
||||
public nsIDOMJSNavigator
|
||||
class nsNavigator : public nsIDOMNavigator,
|
||||
public nsIDOMJSNavigator
|
||||
{
|
||||
public:
|
||||
NavigatorImpl(nsIDocShell *aDocShell);
|
||||
virtual ~NavigatorImpl();
|
||||
nsNavigator(nsIDocShell *aDocShell);
|
||||
virtual ~nsNavigator();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMNAVIGATOR
|
||||
|
@ -485,8 +484,8 @@ public:
|
|||
nsresult RefreshMIMEArray();
|
||||
|
||||
protected:
|
||||
nsRefPtr<MimeTypeArrayImpl> mMimeTypes;
|
||||
nsRefPtr<PluginArrayImpl> mPlugins;
|
||||
nsRefPtr<nsMimeTypeArray> mMimeTypes;
|
||||
nsRefPtr<nsPluginArray> mPlugins;
|
||||
nsIDocShell* mDocShell; // weak reference
|
||||
|
||||
static jsval sPrefInternal_id;
|
||||
|
@ -495,15 +494,15 @@ protected:
|
|||
class nsIURI;
|
||||
|
||||
//*****************************************************************************
|
||||
// LocationImpl: Script "location" object
|
||||
// nsLocation: Script "location" object
|
||||
//*****************************************************************************
|
||||
|
||||
class LocationImpl : public nsIDOMLocation,
|
||||
public nsIDOMNSLocation
|
||||
class nsLocation : public nsIDOMLocation,
|
||||
public nsIDOMNSLocation
|
||||
{
|
||||
public:
|
||||
LocationImpl(nsIDocShell *aDocShell);
|
||||
virtual ~LocationImpl();
|
||||
nsLocation(nsIDocShell *aDocShell);
|
||||
virtual ~nsLocation();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
|
|
@ -62,17 +62,17 @@
|
|||
//
|
||||
// History class implementation
|
||||
//
|
||||
HistoryImpl::HistoryImpl(nsIDocShell* aDocShell) : mDocShell(aDocShell)
|
||||
nsHistory::nsHistory(nsIDocShell* aDocShell) : mDocShell(aDocShell)
|
||||
{
|
||||
}
|
||||
|
||||
HistoryImpl::~HistoryImpl()
|
||||
nsHistory::~nsHistory()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// QueryInterface implementation for HistoryImpl
|
||||
NS_INTERFACE_MAP_BEGIN(HistoryImpl)
|
||||
// QueryInterface implementation for nsHistory
|
||||
NS_INTERFACE_MAP_BEGIN(nsHistory)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMHistory)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHistory)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHistory)
|
||||
|
@ -80,18 +80,18 @@ NS_INTERFACE_MAP_BEGIN(HistoryImpl)
|
|||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ADDREF(HistoryImpl)
|
||||
NS_IMPL_RELEASE(HistoryImpl)
|
||||
NS_IMPL_ADDREF(nsHistory)
|
||||
NS_IMPL_RELEASE(nsHistory)
|
||||
|
||||
|
||||
void
|
||||
HistoryImpl::SetDocShell(nsIDocShell *aDocShell)
|
||||
nsHistory::SetDocShell(nsIDocShell *aDocShell)
|
||||
{
|
||||
mDocShell = aDocShell; // Weak Reference
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::GetLength(PRInt32* aLength)
|
||||
nsHistory::GetLength(PRInt32* aLength)
|
||||
{
|
||||
nsCOMPtr<nsISHistory> sHistory;
|
||||
|
||||
|
@ -102,7 +102,7 @@ HistoryImpl::GetLength(PRInt32* aLength)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::GetCurrent(nsAString& aCurrent)
|
||||
nsHistory::GetCurrent(nsAString& aCurrent)
|
||||
{
|
||||
PRInt32 curIndex=0;
|
||||
nsCAutoString curURL;
|
||||
|
@ -131,7 +131,7 @@ HistoryImpl::GetCurrent(nsAString& aCurrent)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::GetPrevious(nsAString& aPrevious)
|
||||
nsHistory::GetPrevious(nsAString& aPrevious)
|
||||
{
|
||||
PRInt32 curIndex;
|
||||
nsCAutoString prevURL;
|
||||
|
@ -160,7 +160,7 @@ HistoryImpl::GetPrevious(nsAString& aPrevious)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::GetNext(nsAString& aNext)
|
||||
nsHistory::GetNext(nsAString& aNext)
|
||||
{
|
||||
PRInt32 curIndex;
|
||||
nsCAutoString nextURL;
|
||||
|
@ -189,7 +189,7 @@ HistoryImpl::GetNext(nsAString& aNext)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::Back()
|
||||
nsHistory::Back()
|
||||
{
|
||||
nsCOMPtr<nsISHistory> sHistory;
|
||||
|
||||
|
@ -205,7 +205,7 @@ HistoryImpl::Back()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::Forward()
|
||||
nsHistory::Forward()
|
||||
{
|
||||
nsCOMPtr<nsISHistory> sHistory;
|
||||
|
||||
|
@ -221,7 +221,7 @@ HistoryImpl::Forward()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::Go(PRInt32 aDelta)
|
||||
nsHistory::Go(PRInt32 aDelta)
|
||||
{
|
||||
nsCOMPtr<nsISHistory> session_history;
|
||||
|
||||
|
@ -247,7 +247,7 @@ HistoryImpl::Go(PRInt32 aDelta)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::Go()
|
||||
nsHistory::Go()
|
||||
{
|
||||
nsCOMPtr<nsIXPCNativeCallContext> ncc;
|
||||
nsresult rv = nsContentUtils::XPConnect()->
|
||||
|
@ -307,7 +307,7 @@ HistoryImpl::Go()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HistoryImpl::Item(PRUint32 aIndex, nsAString& aReturn)
|
||||
nsHistory::Item(PRUint32 aIndex, nsAString& aReturn)
|
||||
{
|
||||
aReturn.Truncate();
|
||||
|
||||
|
@ -338,8 +338,8 @@ HistoryImpl::Item(PRUint32 aIndex, nsAString& aReturn)
|
|||
}
|
||||
|
||||
nsresult
|
||||
HistoryImpl::GetSessionHistoryFromDocShell(nsIDocShell * aDocShell,
|
||||
nsISHistory ** aReturn)
|
||||
nsHistory::GetSessionHistoryFromDocShell(nsIDocShell * aDocShell,
|
||||
nsISHistory ** aReturn)
|
||||
{
|
||||
|
||||
NS_ENSURE_TRUE(aDocShell, NS_ERROR_FAILURE);
|
||||
|
|
|
@ -47,12 +47,12 @@
|
|||
class nsIDocShell;
|
||||
|
||||
// Script "History" object
|
||||
class HistoryImpl : public nsIDOMHistory,
|
||||
public nsIDOMNSHistory
|
||||
class nsHistory : public nsIDOMHistory,
|
||||
public nsIDOMNSHistory
|
||||
{
|
||||
public:
|
||||
HistoryImpl(nsIDocShell* aDocShell);
|
||||
virtual ~HistoryImpl();
|
||||
nsHistory(nsIDocShell* aDocShell);
|
||||
virtual ~nsHistory();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
|
|
@ -107,18 +107,18 @@ GetDocumentCharacterSetForURI(const nsAString& aHref, nsACString& aCharset)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
LocationImpl::LocationImpl(nsIDocShell *aDocShell)
|
||||
nsLocation::nsLocation(nsIDocShell *aDocShell)
|
||||
{
|
||||
mDocShell = aDocShell; // Weak Reference
|
||||
}
|
||||
|
||||
LocationImpl::~LocationImpl()
|
||||
nsLocation::~nsLocation()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// QueryInterface implementation for LocationImpl
|
||||
NS_INTERFACE_MAP_BEGIN(LocationImpl)
|
||||
// QueryInterface implementation for nsLocation
|
||||
NS_INTERFACE_MAP_BEGIN(nsLocation)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSLocation)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMLocation)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMLocation)
|
||||
|
@ -126,17 +126,17 @@ NS_INTERFACE_MAP_BEGIN(LocationImpl)
|
|||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ADDREF(LocationImpl)
|
||||
NS_IMPL_RELEASE(LocationImpl)
|
||||
NS_IMPL_ADDREF(nsLocation)
|
||||
NS_IMPL_RELEASE(nsLocation)
|
||||
|
||||
void
|
||||
LocationImpl::SetDocShell(nsIDocShell *aDocShell)
|
||||
nsLocation::SetDocShell(nsIDocShell *aDocShell)
|
||||
{
|
||||
mDocShell = aDocShell; // Weak Reference
|
||||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
||||
nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
||||
{
|
||||
*aLoadInfo = nsnull;
|
||||
|
||||
|
@ -206,19 +206,21 @@ LocationImpl::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
|||
// anything that would allow a relative uri.
|
||||
|
||||
nsresult
|
||||
LocationImpl::FindUsableBaseURI(nsIURI * aBaseURI, nsIDocShell * aParent, nsIURI ** aUsableURI)
|
||||
nsLocation::FindUsableBaseURI(nsIURI * aBaseURI, nsIDocShell * aParent,
|
||||
nsIURI ** aUsableURI)
|
||||
{
|
||||
if (!aBaseURI || !aParent)
|
||||
return NS_ERROR_FAILURE;
|
||||
NS_ENSURE_ARG_POINTER(aUsableURI);
|
||||
|
||||
|
||||
*aUsableURI = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIDocShell> parentDS = aParent;
|
||||
nsCOMPtr<nsIURI> baseURI = aBaseURI;
|
||||
nsCOMPtr<nsIIOService> ioService(do_GetService(NS_IOSERVICE_CONTRACTID, &rv));
|
||||
nsCOMPtr<nsIIOService> ioService =
|
||||
do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
|
||||
|
||||
while(NS_SUCCEEDED(rv) && baseURI && ioService) {
|
||||
while(NS_SUCCEEDED(rv) && baseURI) {
|
||||
// Check if the current base uri supports relative uris.
|
||||
// We make this check by looking at the protocol flags of
|
||||
// the protocol handler. If the protocol flags has URI_NORELATIVE,
|
||||
|
@ -260,7 +262,7 @@ LocationImpl::FindUsableBaseURI(nsIURI * aBaseURI, nsIDocShell * aParent, nsIURI
|
|||
|
||||
|
||||
nsresult
|
||||
LocationImpl::GetURI(nsIURI** aURI, PRBool aGetInnermostURI)
|
||||
nsLocation::GetURI(nsIURI** aURI, PRBool aGetInnermostURI)
|
||||
{
|
||||
*aURI = nsnull;
|
||||
|
||||
|
@ -298,7 +300,7 @@ LocationImpl::GetURI(nsIURI** aURI, PRBool aGetInnermostURI)
|
|||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::GetWritableURI(nsIURI** aURI)
|
||||
nsLocation::GetWritableURI(nsIURI** aURI)
|
||||
{
|
||||
*aURI = nsnull;
|
||||
|
||||
|
@ -313,7 +315,7 @@ LocationImpl::GetWritableURI(nsIURI** aURI)
|
|||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::SetURI(nsIURI* aURI)
|
||||
nsLocation::SetURI(nsIURI* aURI)
|
||||
{
|
||||
if (mDocShell) {
|
||||
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
|
||||
|
@ -331,7 +333,7 @@ LocationImpl::SetURI(nsIURI* aURI)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetHash(nsAString& aHash)
|
||||
nsLocation::GetHash(nsAString& aHash)
|
||||
{
|
||||
aHash.SetLength(0);
|
||||
|
||||
|
@ -374,7 +376,7 @@ LocationImpl::GetHash(nsAString& aHash)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetHash(const nsAString& aHash)
|
||||
nsLocation::SetHash(const nsAString& aHash)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult result = NS_OK;
|
||||
|
@ -402,7 +404,7 @@ LocationImpl::SetHash(const nsAString& aHash)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetHost(nsAString& aHost)
|
||||
nsLocation::GetHost(nsAString& aHost)
|
||||
{
|
||||
aHost.Truncate();
|
||||
|
||||
|
@ -425,7 +427,7 @@ LocationImpl::GetHost(nsAString& aHost)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetHost(const nsAString& aHost)
|
||||
nsLocation::SetHost(const nsAString& aHost)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult result;
|
||||
|
@ -441,7 +443,7 @@ LocationImpl::SetHost(const nsAString& aHost)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetHostname(nsAString& aHostname)
|
||||
nsLocation::GetHostname(nsAString& aHostname)
|
||||
{
|
||||
aHostname.Truncate();
|
||||
|
||||
|
@ -464,7 +466,7 @@ LocationImpl::GetHostname(nsAString& aHostname)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetHostname(const nsAString& aHostname)
|
||||
nsLocation::SetHostname(const nsAString& aHostname)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult result;
|
||||
|
@ -480,7 +482,7 @@ LocationImpl::SetHostname(const nsAString& aHostname)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetHref(nsAString& aHref)
|
||||
nsLocation::GetHref(nsAString& aHref)
|
||||
{
|
||||
aHref.Truncate();
|
||||
|
||||
|
@ -503,7 +505,7 @@ LocationImpl::GetHref(nsAString& aHref)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetHref(const nsAString& aHref)
|
||||
nsLocation::SetHref(const nsAString& aHref)
|
||||
{
|
||||
if (!aHref.IsEmpty() && aHref.First() == PRUnichar('#')) {
|
||||
// Special-case anchor loads so that we don't stop content
|
||||
|
@ -547,8 +549,8 @@ LocationImpl::SetHref(const nsAString& aHref)
|
|||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
||||
PRBool aReplace)
|
||||
nsLocation::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
||||
PRBool aReplace)
|
||||
{
|
||||
nsCOMPtr<nsIURI> base;
|
||||
|
||||
|
@ -563,8 +565,8 @@ LocationImpl::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
|||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::SetHrefWithBase(const nsAString& aHref,
|
||||
nsIURI* aBase, PRBool aReplace)
|
||||
nsLocation::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
||||
PRBool aReplace)
|
||||
{
|
||||
nsresult result;
|
||||
nsCOMPtr<nsIURI> newUri, baseURI;
|
||||
|
@ -638,7 +640,7 @@ LocationImpl::SetHrefWithBase(const nsAString& aHref,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetPathname(nsAString& aPathname)
|
||||
nsLocation::GetPathname(nsAString& aPathname)
|
||||
{
|
||||
aPathname.Truncate();
|
||||
|
||||
|
@ -662,7 +664,7 @@ LocationImpl::GetPathname(nsAString& aPathname)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetPathname(const nsAString& aPathname)
|
||||
nsLocation::SetPathname(const nsAString& aPathname)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult result = NS_OK;
|
||||
|
@ -678,7 +680,7 @@ LocationImpl::SetPathname(const nsAString& aPathname)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetPort(nsAString& aPort)
|
||||
nsLocation::GetPort(nsAString& aPort)
|
||||
{
|
||||
aPort.SetLength(0);
|
||||
|
||||
|
@ -702,7 +704,7 @@ LocationImpl::GetPort(nsAString& aPort)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetPort(const nsAString& aPort)
|
||||
nsLocation::SetPort(const nsAString& aPort)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult result = NS_OK;
|
||||
|
@ -732,7 +734,7 @@ LocationImpl::SetPort(const nsAString& aPort)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetProtocol(nsAString& aProtocol)
|
||||
nsLocation::GetProtocol(nsAString& aProtocol)
|
||||
{
|
||||
aProtocol.SetLength(0);
|
||||
|
||||
|
@ -756,7 +758,7 @@ LocationImpl::GetProtocol(nsAString& aProtocol)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetProtocol(const nsAString& aProtocol)
|
||||
nsLocation::SetProtocol(const nsAString& aProtocol)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult result = NS_OK;
|
||||
|
@ -772,7 +774,7 @@ LocationImpl::SetProtocol(const nsAString& aProtocol)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::GetSearch(nsAString& aSearch)
|
||||
nsLocation::GetSearch(nsAString& aSearch)
|
||||
{
|
||||
aSearch.SetLength(0);
|
||||
|
||||
|
@ -798,7 +800,7 @@ LocationImpl::GetSearch(nsAString& aSearch)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::SetSearch(const nsAString& aSearch)
|
||||
nsLocation::SetSearch(const nsAString& aSearch)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult result = NS_OK;
|
||||
|
@ -815,7 +817,7 @@ LocationImpl::SetSearch(const nsAString& aSearch)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::Reload(PRBool aForceget)
|
||||
nsLocation::Reload(PRBool aForceget)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell));
|
||||
|
@ -843,7 +845,7 @@ LocationImpl::Reload(PRBool aForceget)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::Reload()
|
||||
nsLocation::Reload()
|
||||
{
|
||||
nsCOMPtr<nsIXPCNativeCallContext> ncc;
|
||||
nsresult rv = nsContentUtils::XPConnect()->
|
||||
|
@ -899,7 +901,7 @@ LocationImpl::Reload()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::Replace(const nsAString& aUrl)
|
||||
nsLocation::Replace(const nsAString& aUrl)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -931,7 +933,7 @@ LocationImpl::Replace(const nsAString& aUrl)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::Assign(const nsAString& aUrl)
|
||||
nsLocation::Assign(const nsAString& aUrl)
|
||||
{
|
||||
nsAutoString oldHref;
|
||||
nsresult result = NS_OK;
|
||||
|
@ -952,13 +954,13 @@ LocationImpl::Assign(const nsAString& aUrl)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocationImpl::ToString(nsAString& aReturn)
|
||||
nsLocation::ToString(nsAString& aReturn)
|
||||
{
|
||||
return GetHref(aReturn);
|
||||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::GetSourceDocument(JSContext* cx, nsIDocument** aDocument)
|
||||
nsLocation::GetSourceDocument(JSContext* cx, nsIDocument** aDocument)
|
||||
{
|
||||
// XXX Code duplicated from nsHTMLDocument
|
||||
// XXX Tom said this reminded him of the "Six Degrees of
|
||||
|
@ -991,7 +993,7 @@ LocationImpl::GetSourceDocument(JSContext* cx, nsIDocument** aDocument)
|
|||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL)
|
||||
nsLocation::GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nsresult rv = GetSourceDocument(cx, getter_AddRefs(doc));
|
||||
|
@ -1005,7 +1007,7 @@ LocationImpl::GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL)
|
|||
}
|
||||
|
||||
nsresult
|
||||
LocationImpl::GetSourceURL(JSContext* cx, nsIURI** sourceURL)
|
||||
nsLocation::GetSourceURL(JSContext* cx, nsIURI** sourceURL)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nsresult rv = GetSourceDocument(cx, getter_AddRefs(doc));
|
||||
|
|
|
@ -47,33 +47,33 @@
|
|||
#include "nsIFile.h"
|
||||
|
||||
|
||||
MimeTypeArrayImpl::MimeTypeArrayImpl(nsIDOMNavigator* navigator)
|
||||
nsMimeTypeArray::nsMimeTypeArray(nsIDOMNavigator* navigator)
|
||||
{
|
||||
mNavigator = navigator;
|
||||
mMimeTypeCount = 0;
|
||||
mMimeTypeArray = nsnull;
|
||||
}
|
||||
|
||||
MimeTypeArrayImpl::~MimeTypeArrayImpl()
|
||||
nsMimeTypeArray::~nsMimeTypeArray()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
// QueryInterface implementation for MimeTypeArrayImpl
|
||||
NS_INTERFACE_MAP_BEGIN(MimeTypeArrayImpl)
|
||||
// QueryInterface implementation for nsMimeTypeArray
|
||||
NS_INTERFACE_MAP_BEGIN(nsMimeTypeArray)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMimeTypeArray)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MimeTypeArray)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ADDREF(MimeTypeArrayImpl)
|
||||
NS_IMPL_RELEASE(MimeTypeArrayImpl)
|
||||
NS_IMPL_ADDREF(nsMimeTypeArray)
|
||||
NS_IMPL_RELEASE(nsMimeTypeArray)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
MimeTypeArrayImpl::GetLength(PRUint32* aLength)
|
||||
nsMimeTypeArray::GetLength(PRUint32* aLength)
|
||||
{
|
||||
if (mMimeTypeArray == nsnull) {
|
||||
nsresult rv = GetMimeTypes();
|
||||
|
@ -85,7 +85,7 @@ MimeTypeArrayImpl::GetLength(PRUint32* aLength)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MimeTypeArrayImpl::Item(PRUint32 aIndex, nsIDOMMimeType** aReturn)
|
||||
nsMimeTypeArray::Item(PRUint32 aIndex, nsIDOMMimeType** aReturn)
|
||||
{
|
||||
if (mMimeTypeArray == nsnull) {
|
||||
nsresult rv = GetMimeTypes();
|
||||
|
@ -101,8 +101,7 @@ MimeTypeArrayImpl::Item(PRUint32 aIndex, nsIDOMMimeType** aReturn)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MimeTypeArrayImpl::NamedItem(const nsAString& aName,
|
||||
nsIDOMMimeType** aReturn)
|
||||
nsMimeTypeArray::NamedItem(const nsAString& aName, nsIDOMMimeType** aReturn)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
*aReturn = nsnull;
|
||||
|
@ -160,23 +159,23 @@ MimeTypeArrayImpl::NamedItem(const nsAString& aName,
|
|||
}
|
||||
|
||||
// If we got here, we support this type! Say so.
|
||||
nsCOMPtr<nsIDOMMimeType> helperImpl = new HelperMimeTypeImpl(aName);
|
||||
if (!helperImpl) {
|
||||
nsCOMPtr<nsIDOMMimeType> helper = new nsHelperMimeType(aName);
|
||||
if (!helper) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
MimeTypeElementImpl* entry = new MimeTypeElementImpl(nsnull, helperImpl);
|
||||
nsCOMPtr<nsIDOMMimeType> entry = new nsMimeType(nsnull, helper);
|
||||
if (!entry) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(entry, aReturn);
|
||||
entry.swap(*aReturn);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void MimeTypeArrayImpl::Clear()
|
||||
void nsMimeTypeArray::Clear()
|
||||
{
|
||||
if (mMimeTypeArray != nsnull) {
|
||||
for (PRUint32 i = 0; i < mMimeTypeCount; i++) {
|
||||
|
@ -188,13 +187,13 @@ void MimeTypeArrayImpl::Clear()
|
|||
mMimeTypeCount = 0;
|
||||
}
|
||||
|
||||
nsresult MimeTypeArrayImpl::Refresh()
|
||||
nsresult nsMimeTypeArray::Refresh()
|
||||
{
|
||||
Clear();
|
||||
return GetMimeTypes();
|
||||
}
|
||||
|
||||
nsresult MimeTypeArrayImpl::GetMimeTypes()
|
||||
nsresult nsMimeTypeArray::GetMimeTypes()
|
||||
{
|
||||
NS_PRECONDITION(!mMimeTypeArray && mMimeTypeCount==0,
|
||||
"already initialized");
|
||||
|
@ -241,38 +240,37 @@ nsresult MimeTypeArrayImpl::GetMimeTypes()
|
|||
return rv;
|
||||
}
|
||||
|
||||
MimeTypeElementImpl::MimeTypeElementImpl(nsIDOMPlugin* aPlugin,
|
||||
nsIDOMMimeType* aMimeType)
|
||||
nsMimeType::nsMimeType(nsIDOMPlugin* aPlugin, nsIDOMMimeType* aMimeType)
|
||||
{
|
||||
mPlugin = aPlugin;
|
||||
mMimeType = aMimeType;
|
||||
}
|
||||
|
||||
MimeTypeElementImpl::~MimeTypeElementImpl()
|
||||
nsMimeType::~nsMimeType()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// QueryInterface implementation for MimeTypeElementImpl
|
||||
NS_INTERFACE_MAP_BEGIN(MimeTypeElementImpl)
|
||||
// QueryInterface implementation for nsMimeType
|
||||
NS_INTERFACE_MAP_BEGIN(nsMimeType)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMimeType)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MimeType)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ADDREF(MimeTypeElementImpl)
|
||||
NS_IMPL_RELEASE(MimeTypeElementImpl)
|
||||
NS_IMPL_ADDREF(nsMimeType)
|
||||
NS_IMPL_RELEASE(nsMimeType)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
MimeTypeElementImpl::GetDescription(nsAString& aDescription)
|
||||
nsMimeType::GetDescription(nsAString& aDescription)
|
||||
{
|
||||
return mMimeType->GetDescription(aDescription);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MimeTypeElementImpl::GetEnabledPlugin(nsIDOMPlugin** aEnabledPlugin)
|
||||
nsMimeType::GetEnabledPlugin(nsIDOMPlugin** aEnabledPlugin)
|
||||
{
|
||||
*aEnabledPlugin = mPlugin;
|
||||
NS_IF_ADDREF(*aEnabledPlugin);
|
||||
|
@ -280,43 +278,43 @@ MimeTypeElementImpl::GetEnabledPlugin(nsIDOMPlugin** aEnabledPlugin)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MimeTypeElementImpl::GetSuffixes(nsAString& aSuffixes)
|
||||
nsMimeType::GetSuffixes(nsAString& aSuffixes)
|
||||
{
|
||||
return mMimeType->GetSuffixes(aSuffixes);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MimeTypeElementImpl::GetType(nsAString& aType)
|
||||
nsMimeType::GetType(nsAString& aType)
|
||||
{
|
||||
return mMimeType->GetType(aType);
|
||||
}
|
||||
|
||||
// QueryInterface implementation for HelperMimeTypeImpl
|
||||
NS_IMPL_ISUPPORTS1(HelperMimeTypeImpl, nsIDOMMimeType)
|
||||
// QueryInterface implementation for nsHelperMimeType
|
||||
NS_IMPL_ISUPPORTS1(nsHelperMimeType, nsIDOMMimeType)
|
||||
|
||||
NS_IMETHODIMP
|
||||
HelperMimeTypeImpl::GetDescription(nsAString& aDescription)
|
||||
nsHelperMimeType::GetDescription(nsAString& aDescription)
|
||||
{
|
||||
aDescription.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HelperMimeTypeImpl::GetEnabledPlugin(nsIDOMPlugin** aEnabledPlugin)
|
||||
nsHelperMimeType::GetEnabledPlugin(nsIDOMPlugin** aEnabledPlugin)
|
||||
{
|
||||
*aEnabledPlugin = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HelperMimeTypeImpl::GetSuffixes(nsAString& aSuffixes)
|
||||
nsHelperMimeType::GetSuffixes(nsAString& aSuffixes)
|
||||
{
|
||||
aSuffixes.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HelperMimeTypeImpl::GetType(nsAString& aType)
|
||||
nsHelperMimeType::GetType(nsAString& aType)
|
||||
{
|
||||
aType = mType;
|
||||
return NS_OK;
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
|
||||
class nsIDOMNavigator;
|
||||
|
||||
class MimeTypeArrayImpl : public nsIDOMMimeTypeArray
|
||||
class nsMimeTypeArray : public nsIDOMMimeTypeArray
|
||||
{
|
||||
public:
|
||||
MimeTypeArrayImpl(nsIDOMNavigator* navigator);
|
||||
virtual ~MimeTypeArrayImpl();
|
||||
nsMimeTypeArray(nsIDOMNavigator* navigator);
|
||||
virtual ~nsMimeTypeArray();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
@ -68,11 +68,11 @@ protected:
|
|||
nsIDOMMimeType** mMimeTypeArray;
|
||||
};
|
||||
|
||||
class MimeTypeElementImpl : public nsIDOMMimeType
|
||||
class nsMimeType : public nsIDOMMimeType
|
||||
{
|
||||
public:
|
||||
MimeTypeElementImpl(nsIDOMPlugin* aPlugin, nsIDOMMimeType* aMimeType);
|
||||
virtual ~MimeTypeElementImpl();
|
||||
nsMimeType(nsIDOMPlugin* aPlugin, nsIDOMMimeType* aMimeType);
|
||||
virtual ~nsMimeType();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
@ -86,14 +86,17 @@ protected:
|
|||
nsCOMPtr<nsIDOMMimeType> mMimeType;
|
||||
};
|
||||
|
||||
class HelperMimeTypeImpl : public nsIDOMMimeType
|
||||
class nsHelperMimeType : public nsIDOMMimeType
|
||||
{
|
||||
public:
|
||||
HelperMimeTypeImpl(const nsAString& aType)
|
||||
nsHelperMimeType(const nsAString& aType)
|
||||
: mType(aType)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~HelperMimeTypeImpl() {}
|
||||
virtual ~nsHelperMimeType()
|
||||
{
|
||||
}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
|
||||
static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
|
||||
|
||||
PluginArrayImpl::PluginArrayImpl(NavigatorImpl* navigator,
|
||||
nsIDocShell *aDocShell)
|
||||
nsPluginArray::nsPluginArray(nsNavigator* navigator,
|
||||
nsIDocShell *aDocShell)
|
||||
{
|
||||
nsresult rv;
|
||||
mNavigator = navigator; // don't ADDREF here, needed for parent of script object.
|
||||
|
@ -64,7 +64,7 @@ PluginArrayImpl::PluginArrayImpl(NavigatorImpl* navigator,
|
|||
mDocShell = aDocShell;
|
||||
}
|
||||
|
||||
PluginArrayImpl::~PluginArrayImpl()
|
||||
nsPluginArray::~nsPluginArray()
|
||||
{
|
||||
if (mPluginArray != nsnull) {
|
||||
for (PRUint32 i = 0; i < mPluginCount; i++) {
|
||||
|
@ -74,19 +74,19 @@ PluginArrayImpl::~PluginArrayImpl()
|
|||
}
|
||||
}
|
||||
|
||||
// QueryInterface implementation for PluginArrayImpl
|
||||
NS_INTERFACE_MAP_BEGIN(PluginArrayImpl)
|
||||
// QueryInterface implementation for nsPluginArray
|
||||
NS_INTERFACE_MAP_BEGIN(nsPluginArray)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMPluginArray)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMPluginArray)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMJSPluginArray)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(PluginArray)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_ADDREF(PluginArrayImpl)
|
||||
NS_IMPL_RELEASE(PluginArrayImpl)
|
||||
NS_IMPL_ADDREF(nsPluginArray)
|
||||
NS_IMPL_RELEASE(nsPluginArray)
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginArrayImpl::GetLength(PRUint32* aLength)
|
||||
nsPluginArray::GetLength(PRUint32* aLength)
|
||||
{
|
||||
if (mPluginHost && NS_SUCCEEDED(mPluginHost->GetPluginCount(aLength)))
|
||||
return NS_OK;
|
||||
|
@ -94,7 +94,7 @@ PluginArrayImpl::GetLength(PRUint32* aLength)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginArrayImpl::Item(PRUint32 aIndex, nsIDOMPlugin** aReturn)
|
||||
nsPluginArray::Item(PRUint32 aIndex, nsIDOMPlugin** aReturn)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aReturn, "null arg");
|
||||
|
||||
|
@ -115,8 +115,7 @@ PluginArrayImpl::Item(PRUint32 aIndex, nsIDOMPlugin** aReturn)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginArrayImpl::NamedItem(const nsAString& aName,
|
||||
nsIDOMPlugin** aReturn)
|
||||
nsPluginArray::NamedItem(const nsAString& aName, nsIDOMPlugin** aReturn)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aReturn, "null arg");
|
||||
|
||||
|
@ -144,7 +143,7 @@ PluginArrayImpl::NamedItem(const nsAString& aName,
|
|||
}
|
||||
|
||||
nsresult
|
||||
PluginArrayImpl::GetPluginHost(nsIPluginHost** aPluginHost)
|
||||
nsPluginArray::GetPluginHost(nsIPluginHost** aPluginHost)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPluginHost);
|
||||
|
||||
|
@ -165,13 +164,13 @@ PluginArrayImpl::GetPluginHost(nsIPluginHost** aPluginHost)
|
|||
}
|
||||
|
||||
void
|
||||
PluginArrayImpl::SetDocShell(nsIDocShell* aDocShell)
|
||||
nsPluginArray::SetDocShell(nsIDocShell* aDocShell)
|
||||
{
|
||||
mDocShell = aDocShell;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginArrayImpl::Refresh(PRBool aReloadDocuments)
|
||||
nsPluginArray::Refresh(PRBool aReloadDocuments)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
|
@ -225,7 +224,7 @@ PluginArrayImpl::Refresh(PRBool aReloadDocuments)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginArrayImpl::Refresh()
|
||||
nsPluginArray::Refresh()
|
||||
{
|
||||
nsCOMPtr<nsIXPCNativeCallContext> ncc;
|
||||
nsresult rv = nsContentUtils::XPConnect()->
|
||||
|
@ -259,7 +258,7 @@ PluginArrayImpl::Refresh()
|
|||
}
|
||||
|
||||
nsresult
|
||||
PluginArrayImpl::GetPlugins()
|
||||
nsPluginArray::GetPlugins()
|
||||
{
|
||||
nsresult rv = GetLength(&mPluginCount);
|
||||
if (rv == NS_OK) {
|
||||
|
@ -267,9 +266,10 @@ PluginArrayImpl::GetPlugins()
|
|||
if (mPluginArray != nsnull) {
|
||||
rv = mPluginHost->GetPlugins(mPluginCount, mPluginArray);
|
||||
if (rv == NS_OK) {
|
||||
// need to wrap each of these with a PluginElementImpl, which is scriptable.
|
||||
// need to wrap each of these with a nsPluginElement, which
|
||||
// is scriptable.
|
||||
for (PRUint32 i = 0; i < mPluginCount; i++) {
|
||||
nsIDOMPlugin* wrapper = new PluginElementImpl(mPluginArray[i]);
|
||||
nsIDOMPlugin* wrapper = new nsPluginElement(mPluginArray[i]);
|
||||
NS_IF_ADDREF(wrapper);
|
||||
mPluginArray[i] = wrapper;
|
||||
}
|
||||
|
@ -283,14 +283,14 @@ PluginArrayImpl::GetPlugins()
|
|||
|
||||
//
|
||||
|
||||
PluginElementImpl::PluginElementImpl(nsIDOMPlugin* plugin)
|
||||
nsPluginElement::nsPluginElement(nsIDOMPlugin* plugin)
|
||||
{
|
||||
mPlugin = plugin; // don't AddRef, see PluginArrayImpl::Item.
|
||||
mPlugin = plugin; // don't AddRef, see nsPluginArray::Item.
|
||||
mMimeTypeCount = 0;
|
||||
mMimeTypeArray = nsnull;
|
||||
}
|
||||
|
||||
PluginElementImpl::~PluginElementImpl()
|
||||
nsPluginElement::~nsPluginElement()
|
||||
{
|
||||
NS_IF_RELEASE(mPlugin);
|
||||
|
||||
|
@ -302,44 +302,44 @@ PluginElementImpl::~PluginElementImpl()
|
|||
}
|
||||
|
||||
|
||||
// QueryInterface implementation for PluginElementImpl
|
||||
NS_INTERFACE_MAP_BEGIN(PluginElementImpl)
|
||||
// QueryInterface implementation for nsPluginElement
|
||||
NS_INTERFACE_MAP_BEGIN(nsPluginElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMPlugin)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Plugin)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ADDREF(PluginElementImpl)
|
||||
NS_IMPL_RELEASE(PluginElementImpl)
|
||||
NS_IMPL_ADDREF(nsPluginElement)
|
||||
NS_IMPL_RELEASE(nsPluginElement)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginElementImpl::GetDescription(nsAString& aDescription)
|
||||
nsPluginElement::GetDescription(nsAString& aDescription)
|
||||
{
|
||||
return mPlugin->GetDescription(aDescription);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginElementImpl::GetFilename(nsAString& aFilename)
|
||||
nsPluginElement::GetFilename(nsAString& aFilename)
|
||||
{
|
||||
return mPlugin->GetFilename(aFilename);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginElementImpl::GetName(nsAString& aName)
|
||||
nsPluginElement::GetName(nsAString& aName)
|
||||
{
|
||||
return mPlugin->GetName(aName);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginElementImpl::GetLength(PRUint32* aLength)
|
||||
nsPluginElement::GetLength(PRUint32* aLength)
|
||||
{
|
||||
return mPlugin->GetLength(aLength);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginElementImpl::Item(PRUint32 aIndex, nsIDOMMimeType** aReturn)
|
||||
nsPluginElement::Item(PRUint32 aIndex, nsIDOMMimeType** aReturn)
|
||||
{
|
||||
if (mMimeTypeArray == nsnull) {
|
||||
nsresult rv = GetMimeTypes();
|
||||
|
@ -356,8 +356,7 @@ PluginElementImpl::Item(PRUint32 aIndex, nsIDOMMimeType** aReturn)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginElementImpl::NamedItem(const nsAString& aName,
|
||||
nsIDOMMimeType** aReturn)
|
||||
nsPluginElement::NamedItem(const nsAString& aName, nsIDOMMimeType** aReturn)
|
||||
{
|
||||
if (mMimeTypeArray == nsnull) {
|
||||
nsresult rv = GetMimeTypes();
|
||||
|
@ -382,7 +381,7 @@ PluginElementImpl::NamedItem(const nsAString& aName,
|
|||
}
|
||||
|
||||
nsresult
|
||||
PluginElementImpl::GetMimeTypes()
|
||||
nsPluginElement::GetMimeTypes()
|
||||
{
|
||||
nsresult rv = mPlugin->GetLength(&mMimeTypeCount);
|
||||
if (rv == NS_OK) {
|
||||
|
@ -394,7 +393,7 @@ PluginElementImpl::GetMimeTypes()
|
|||
rv = mPlugin->Item(i, getter_AddRefs(mimeType));
|
||||
if (rv != NS_OK)
|
||||
break;
|
||||
mimeType = new MimeTypeElementImpl(this, mimeType);
|
||||
mimeType = new nsMimeType(this, mimeType);
|
||||
NS_IF_ADDREF(mMimeTypeArray[i] = mimeType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,16 +43,16 @@
|
|||
#include "nsIPluginHost.h"
|
||||
#include "nsIURL.h"
|
||||
|
||||
class NavigatorImpl;
|
||||
class nsNavigator;
|
||||
class nsIDocShell;
|
||||
class nsIPluginHost;
|
||||
|
||||
class PluginArrayImpl : public nsIDOMPluginArray,
|
||||
public nsIDOMJSPluginArray
|
||||
class nsPluginArray : public nsIDOMPluginArray,
|
||||
public nsIDOMJSPluginArray
|
||||
{
|
||||
public:
|
||||
PluginArrayImpl(NavigatorImpl* navigator, nsIDocShell *aDocShell);
|
||||
virtual ~PluginArrayImpl();
|
||||
nsPluginArray(nsNavigator* navigator, nsIDocShell *aDocShell);
|
||||
virtual ~nsPluginArray();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
@ -71,18 +71,18 @@ public:
|
|||
void SetDocShell(nsIDocShell* aDocShell);
|
||||
|
||||
protected:
|
||||
NavigatorImpl* mNavigator;
|
||||
nsNavigator* mNavigator;
|
||||
nsCOMPtr<nsIPluginHost> mPluginHost;
|
||||
PRUint32 mPluginCount;
|
||||
nsIDOMPlugin** mPluginArray;
|
||||
nsIDocShell* mDocShell; // weak reference
|
||||
};
|
||||
|
||||
class PluginElementImpl : public nsIDOMPlugin
|
||||
class nsPluginElement : public nsIDOMPlugin
|
||||
{
|
||||
public:
|
||||
PluginElementImpl(nsIDOMPlugin* plugin);
|
||||
virtual ~PluginElementImpl();
|
||||
nsPluginElement(nsIDOMPlugin* plugin);
|
||||
virtual ~nsPluginElement();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
|
|
@ -52,36 +52,37 @@
|
|||
//
|
||||
// Screen class implementation
|
||||
//
|
||||
ScreenImpl::ScreenImpl(nsIDocShell* aDocShell)
|
||||
nsScreen::nsScreen(nsIDocShell* aDocShell)
|
||||
: mDocShell(aDocShell)
|
||||
{
|
||||
}
|
||||
|
||||
ScreenImpl::~ScreenImpl()
|
||||
nsScreen::~nsScreen()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// QueryInterface implementation for ScreenImpl
|
||||
NS_INTERFACE_MAP_BEGIN(ScreenImpl)
|
||||
// QueryInterface implementation for nsScreen
|
||||
NS_INTERFACE_MAP_BEGIN(nsScreen)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMScreen)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Screen)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ADDREF(ScreenImpl)
|
||||
NS_IMPL_RELEASE(ScreenImpl)
|
||||
NS_IMPL_ADDREF(nsScreen)
|
||||
NS_IMPL_RELEASE(nsScreen)
|
||||
|
||||
|
||||
NS_IMETHODIMP ScreenImpl::SetDocShell(nsIDocShell* aDocShell)
|
||||
NS_IMETHODIMP
|
||||
nsScreen::SetDocShell(nsIDocShell* aDocShell)
|
||||
{
|
||||
mDocShell = aDocShell; // Weak Reference
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetTop(PRInt32* aTop)
|
||||
nsScreen::GetTop(PRInt32* aTop)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetRect(rect);
|
||||
|
@ -93,7 +94,7 @@ ScreenImpl::GetTop(PRInt32* aTop)
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetLeft(PRInt32* aLeft)
|
||||
nsScreen::GetLeft(PRInt32* aLeft)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetRect(rect);
|
||||
|
@ -105,7 +106,7 @@ ScreenImpl::GetLeft(PRInt32* aLeft)
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetWidth(PRInt32* aWidth)
|
||||
nsScreen::GetWidth(PRInt32* aWidth)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetRect(rect);
|
||||
|
@ -116,7 +117,7 @@ ScreenImpl::GetWidth(PRInt32* aWidth)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetHeight(PRInt32* aHeight)
|
||||
nsScreen::GetHeight(PRInt32* aHeight)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetRect(rect);
|
||||
|
@ -127,7 +128,7 @@ ScreenImpl::GetHeight(PRInt32* aHeight)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetPixelDepth(PRInt32* aPixelDepth)
|
||||
nsScreen::GetPixelDepth(PRInt32* aPixelDepth)
|
||||
{
|
||||
nsIDeviceContext* context = GetDeviceContext();
|
||||
|
||||
|
@ -146,13 +147,13 @@ ScreenImpl::GetPixelDepth(PRInt32* aPixelDepth)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetColorDepth(PRInt32* aColorDepth)
|
||||
nsScreen::GetColorDepth(PRInt32* aColorDepth)
|
||||
{
|
||||
return GetPixelDepth(aColorDepth);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetAvailWidth(PRInt32* aAvailWidth)
|
||||
nsScreen::GetAvailWidth(PRInt32* aAvailWidth)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetAvailRect(rect);
|
||||
|
@ -163,7 +164,7 @@ ScreenImpl::GetAvailWidth(PRInt32* aAvailWidth)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetAvailHeight(PRInt32* aAvailHeight)
|
||||
nsScreen::GetAvailHeight(PRInt32* aAvailHeight)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetAvailRect(rect);
|
||||
|
@ -174,7 +175,7 @@ ScreenImpl::GetAvailHeight(PRInt32* aAvailHeight)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetAvailLeft(PRInt32* aAvailLeft)
|
||||
nsScreen::GetAvailLeft(PRInt32* aAvailLeft)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetAvailRect(rect);
|
||||
|
@ -185,7 +186,7 @@ ScreenImpl::GetAvailLeft(PRInt32* aAvailLeft)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ScreenImpl::GetAvailTop(PRInt32* aAvailTop)
|
||||
nsScreen::GetAvailTop(PRInt32* aAvailTop)
|
||||
{
|
||||
nsRect rect;
|
||||
nsresult rv = GetAvailRect(rect);
|
||||
|
@ -196,7 +197,7 @@ ScreenImpl::GetAvailTop(PRInt32* aAvailTop)
|
|||
}
|
||||
|
||||
nsIDeviceContext*
|
||||
ScreenImpl::GetDeviceContext()
|
||||
nsScreen::GetDeviceContext()
|
||||
{
|
||||
if(!mDocShell)
|
||||
return nsnull;
|
||||
|
@ -219,7 +220,7 @@ ScreenImpl::GetDeviceContext()
|
|||
}
|
||||
|
||||
nsresult
|
||||
ScreenImpl::GetRect(nsRect& aRect)
|
||||
nsScreen::GetRect(nsRect& aRect)
|
||||
{
|
||||
nsIDeviceContext *context = GetDeviceContext();
|
||||
|
||||
|
@ -244,7 +245,7 @@ ScreenImpl::GetRect(nsRect& aRect)
|
|||
}
|
||||
|
||||
nsresult
|
||||
ScreenImpl::GetAvailRect(nsRect& aRect)
|
||||
nsScreen::GetAvailRect(nsRect& aRect)
|
||||
{
|
||||
nsIDeviceContext *context = GetDeviceContext();
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@ class nsIDeviceContext;
|
|||
struct nsRect;
|
||||
|
||||
// Script "screen" object
|
||||
class ScreenImpl : public nsIDOMScreen
|
||||
class nsScreen : public nsIDOMScreen
|
||||
{
|
||||
public:
|
||||
ScreenImpl( nsIDocShell* aDocShell );
|
||||
virtual ~ScreenImpl();
|
||||
nsScreen(nsIDocShell* aDocShell);
|
||||
virtual ~nsScreen();
|
||||
|
||||
NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
|
||||
|
||||
|
|
|
@ -423,7 +423,7 @@ Shutdown()
|
|||
nsImageLoadingContent::Shutdown();
|
||||
nsStyleSet::FreeGlobals();
|
||||
|
||||
GlobalWindowImpl::ShutDown();
|
||||
nsGlobalWindow::ShutDown();
|
||||
nsDOMClassInfo::ShutDown();
|
||||
nsTextControlFrame::ShutDown();
|
||||
nsXBLWindowKeyHandler::ShutDown();
|
||||
|
|
Загрузка…
Ссылка в новой задаче