From 5eacfcb973dd4c25943673150db48e8217bf35c2 Mon Sep 17 00:00:00 2001 From: Benedict Hsieh Date: Wed, 15 Sep 2010 11:04:48 -0700 Subject: [PATCH] Bug 582840 - Remove nsIWebProgressListener(2) support from TabChild and TabParent. r=Olli.Pettay a=blocking2.0 --HG-- extra : rebase_source : 764765bb56a218ec4b9be106eda1227156bf5181 --- content/base/public/nsIFrameLoader.idl | 8 +- content/base/src/nsFrameLoader.cpp | 28 -- content/base/test/chrome/Makefile.in | 3 - content/base/test/chrome/bug514705.html | 10 - content/base/test/chrome/bug514705_helper.xul | 90 ----- content/base/test/chrome/test_bug514705.xul | 30 -- dom/ipc/PBrowser.ipdl | 21 -- dom/ipc/TabChild.cpp | 148 +------- dom/ipc/TabChild.h | 5 - dom/ipc/TabParent.cpp | 334 +----------------- dom/ipc/TabParent.h | 48 --- toolkit/content/widgets/browser.xml | 2 +- 12 files changed, 6 insertions(+), 721 deletions(-) delete mode 100644 content/base/test/chrome/bug514705.html delete mode 100644 content/base/test/chrome/bug514705_helper.xul delete mode 100644 content/base/test/chrome/test_bug514705.xul diff --git a/content/base/public/nsIFrameLoader.idl b/content/base/public/nsIFrameLoader.idl index d090fa23a99..ca0a7a735d2 100644 --- a/content/base/public/nsIFrameLoader.idl +++ b/content/base/public/nsIFrameLoader.idl @@ -41,12 +41,11 @@ interface nsIDocShell; interface nsIURI; -interface nsIWebProgress; interface nsIFrame; interface nsIChromeFrameMessageManager; interface nsIVariant; -[scriptable, uuid(65d2c9e2-852c-48cf-a95d-9b82f1273c15)] +[scriptable, uuid(50a67436-bb44-11df-8d9a-001e37d2764a)] interface nsIFrameLoader : nsISupports { /** @@ -54,11 +53,6 @@ interface nsIFrameLoader : nsISupports */ readonly attribute nsIDocShell docShell; - /** - * Get the nsIWebProgress from the frame loader, allowing listener registration. - */ - readonly attribute nsIWebProgress webProgress; - /** * Start loading the frame. This method figures out what to load * from the owner content in the frame loader. diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index 356bba439f2..5b96783529b 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -425,34 +425,6 @@ nsFrameLoader::GetDocShell(nsIDocShell **aDocShell) return NS_OK; } -NS_IMETHODIMP -nsFrameLoader::GetWebProgress(nsIWebProgress **aWebProgress) -{ - nsresult rv; - *aWebProgress = nsnull; -#ifdef MOZ_IPC - if (mRemoteFrame) { - if (!mRemoteBrowser) { - TryNewProcess(); - } - if (!mRemoteBrowser) { - return NS_ERROR_UNEXPECTED; - } - *aWebProgress = mRemoteBrowser; - NS_ADDREF(*aWebProgress); - return NS_OK; - } -#endif - - nsCOMPtr shell; - rv = GetDocShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv)) { - nsCOMPtr progress(do_QueryInterface(shell)); - progress.swap(*aWebProgress); - } - return rv; -} - void nsFrameLoader::Finalize() { diff --git a/content/base/test/chrome/Makefile.in b/content/base/test/chrome/Makefile.in index 8b7a7f38f0d..43a7360c715 100644 --- a/content/base/test/chrome/Makefile.in +++ b/content/base/test/chrome/Makefile.in @@ -45,7 +45,6 @@ include $(topsrcdir)/config/rules.mk _TEST_FILES = \ bug421622-referer.sjs \ - bug514705.html \ $(NULL) _CHROME_FILES = \ @@ -54,8 +53,6 @@ _CHROME_FILES = \ test_bug429785.xul \ test_bug430050.xul \ test_bug467123.xul \ - test_bug514705.xul \ - bug514705_helper.xul \ test_title.xul \ title_window.xul \ test_bug549682.xul \ diff --git a/content/base/test/chrome/bug514705.html b/content/base/test/chrome/bug514705.html deleted file mode 100644 index 515670b7ad0..00000000000 --- a/content/base/test/chrome/bug514705.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - bug514705.html - - - -bug514705.html - - diff --git a/content/base/test/chrome/bug514705_helper.xul b/content/base/test/chrome/bug514705_helper.xul deleted file mode 100644 index 5cda8fcb232..00000000000 --- a/content/base/test/chrome/bug514705_helper.xul +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - diff --git a/content/base/test/chrome/test_bug514705.xul b/content/base/test/chrome/test_bug514705.xul deleted file mode 100644 index ba516f06741..00000000000 --- a/content/base/test/chrome/test_bug514705.xul +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index c948f2d8caf..2ba818b285a 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -86,27 +86,6 @@ parent: Event(RemoteDOMEvent aEvent); - NotifyStateChange(PRUint32 stateFlags, nsresult status); - - NotifyProgressChange(PRInt64 curSelfProgress, - PRInt64 maxSelfProgress, - PRInt64 curTotalProgress, - PRInt64 maxTotalProgress); - - NotifyLocationChange(nsCString uri); - - NotifyStatusChange(nsresult status, - nsString message); - - NotifySecurityChange(PRUint32 aState, - PRBool aUseSSLStatusObject, - nsString aTooltip, - nsCString aSecInfoAsString); - - sync RefreshAttempted(nsCString uri, PRInt32 millis, - bool sameURI) returns (bool retval); - - rpc CreateWindow() returns (PBrowser window); sync SyncMessage(nsString aMessage, nsString aJSON) diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 02908239513..26d3fe42f1f 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -142,10 +142,6 @@ TabChild::Init() } webBrowser->SetContainerWindow(this); - nsCOMPtr weak = - do_GetWeakReference(static_cast(this)); - webBrowser->AddWebBrowserListener(weak, NS_GET_IID(nsIWebProgressListener)); - mWebNav = do_QueryInterface(webBrowser); NS_ASSERTION(mWebNav, "nsWebBrowser doesn't implement nsIWebNavigation?"); @@ -155,7 +151,6 @@ TabChild::Init() } NS_INTERFACE_MAP_BEGIN(TabChild) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebProgressListener2) NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome) NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome2) NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow) @@ -163,11 +158,9 @@ NS_INTERFACE_MAP_BEGIN(TabChild) NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIWindowProvider) - NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) - NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener2) - NS_INTERFACE_MAP_ENTRY(nsSupportsWeakReference) NS_INTERFACE_MAP_ENTRY(nsITabChild) NS_INTERFACE_MAP_ENTRY(nsIDialogCreator) + NS_INTERFACE_MAP_ENTRY(nsSupportsWeakReference) NS_INTERFACE_MAP_END NS_IMPL_ADDREF(TabChild) @@ -492,10 +485,6 @@ TabChild::ActorDestroy(ActorDestroyReason why) TabChild::~TabChild() { nsCOMPtr webBrowser = do_QueryInterface(mWebNav); - nsCOMPtr weak = - do_GetWeakReference(static_cast(this)); - webBrowser->RemoveWebBrowserListener(weak, NS_GET_IID(nsIWebProgressListener)); - if (webBrowser) { webBrowser->SetContainerWindow(nsnull); } @@ -510,141 +499,6 @@ TabChild::~TabChild() mTabChildGlobal->mTabChild = nsnull; } -NS_IMETHODIMP -TabChild::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRUint32 aStateFlags, - nsresult aStatus) -{ - SendNotifyStateChange(aStateFlags, aStatus); - return NS_OK; -} - -// Only one of OnProgressChange / OnProgressChange64 will be called. -// According to interface, it should be OnProgressChange64, but looks -// like docLoader only sends the former. -NS_IMETHODIMP -TabChild::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt32 aCurSelfProgress, - PRInt32 aMaxSelfProgress, - PRInt32 aCurTotalProgress, - PRInt32 aMaxTotalProgress) -{ - SendNotifyProgressChange(aCurSelfProgress, aMaxSelfProgress, - aCurTotalProgress, aMaxTotalProgress); - return NS_OK; -} - -NS_IMETHODIMP -TabChild::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsresult aStatus, - const PRUnichar* aMessage) -{ - nsDependentString message(aMessage); - SendNotifyStatusChange(aStatus, message); - return NS_OK; -} - -NS_IMETHODIMP -TabChild::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRUint32 aState) -{ - nsCString secInfoAsString; - if (aState & nsIWebProgressListener::STATE_IS_SECURE) { - nsCOMPtr channel = do_QueryInterface(aRequest); - if (channel) { - nsCOMPtr secInfoSupports; - channel->GetSecurityInfo(getter_AddRefs(secInfoSupports)); - - nsCOMPtr secInfoSerializable = - do_QueryInterface(secInfoSupports); - NS_SerializeToString(secInfoSerializable, secInfoAsString); - } - } - - PRBool useSSLStatusObject = PR_FALSE; - nsAutoString securityTooltip; - nsCOMPtr docShell = do_QueryInterface(aWebProgress); - if (docShell) { - nsCOMPtr secureUI; - docShell->GetSecurityUI(getter_AddRefs(secureUI)); - if (secureUI) { - secureUI->GetTooltipText(securityTooltip); - nsCOMPtr supports; - nsCOMPtr provider = do_QueryInterface(secureUI); - nsresult rv = provider->GetSSLStatus(getter_AddRefs(supports)); - if (NS_SUCCEEDED(rv) && supports) { - /* - * useSSLStatusObject: Security UI internally holds 4 states: secure, mixed, - * broken, no security. In cases of secure, mixed and broken it holds reference - * to a valid SSL status object. But, in case of the 'broken' state it doesn't - * return the SSL status object (returns null), in contrary to the 'mixed' state - * for which it returns. - * - * However, mixed and broken states are both reported to the upper level - * as nsIWebProgressListener::STATE_IS_BROKEN, i.e. states are merged, - * so we cannot determine, if to return the status object or not. - * - * TabParent is extracting the SSL status object from the security info - * serialization (string). SSL status object is always present there - * even security UI implementation doesn't present it. This argument - * tells the parent if the SSL status object is being presented by - * the security UI here, on the child process, and so if it has to be - * presented also on the parent process. - */ - useSSLStatusObject = PR_TRUE; - } - } - } - - SendNotifySecurityChange(aState, useSSLStatusObject, securityTooltip, - secInfoAsString); - return NS_OK; -} - -NS_IMETHODIMP -TabChild::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *aLocation) -{ - NS_ENSURE_ARG_POINTER(aLocation); - nsCString uri; - aLocation->GetSpec(uri); - SendNotifyLocationChange(uri); - return NS_OK; -} - -NS_IMETHODIMP -TabChild::OnProgressChange64(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt64 aCurSelfProgress, - PRInt64 aMaxSelfProgress, - PRInt64 aCurTotalProgress, - PRInt64 aMaxTotalProgress) -{ - SendNotifyProgressChange(aCurSelfProgress, aMaxSelfProgress, - aCurTotalProgress, aMaxTotalProgress); - return NS_OK; -} - -NS_IMETHODIMP -TabChild::OnRefreshAttempted(nsIWebProgress *aWebProgress, - nsIURI *aURI, PRInt32 aMillis, - PRBool aSameURL, PRBool *aRefreshAllowed) -{ - NS_ENSURE_ARG_POINTER(aURI); - nsCString uri; - aURI->GetSpec(uri); - bool sameURL = aSameURL; - bool refreshAllowed; - SendRefreshAttempted(uri, aMillis, sameURL, &refreshAllowed); - *aRefreshAllowed = refreshAllowed; - return NS_OK; -} - bool TabChild::RecvLoadURL(const nsCString& uri) { diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index d5be3086125..91bb1a9dd9a 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -48,8 +48,6 @@ #include "nsIWebBrowserChrome2.h" #include "nsIEmbeddingSiteWindow2.h" #include "nsIWebBrowserChromeFocus.h" -#include "nsIWebProgressListener.h" -#include "nsIWebProgressListener2.h" #include "nsIDOMEventListener.h" #include "nsIDOMEventTarget.h" #include "nsIInterfaceRequestor.h" @@ -145,7 +143,6 @@ protected: class TabChild : public PBrowserChild, public nsFrameScriptExecutor, - public nsIWebProgressListener2, public nsIWebBrowserChrome2, public nsIEmbeddingSiteWindow2, public nsIWebBrowserChromeFocus, @@ -162,8 +159,6 @@ public: nsresult Init(); NS_DECL_ISUPPORTS - NS_DECL_NSIWEBPROGRESSLISTENER - NS_DECL_NSIWEBPROGRESSLISTENER2 NS_DECL_NSIWEBBROWSERCHROME NS_DECL_NSIWEBBROWSERCHROME2 NS_DECL_NSIEMBEDDINGSITEWINDOW diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 55b153e9ee3..b9023fc89fc 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -58,7 +58,6 @@ #include "TabChild.h" #include "nsIDOMEvent.h" #include "nsIPrivateDOMEvent.h" -#include "nsIWebProgressListener2.h" #include "nsFrameLoader.h" #include "nsNetUtil.h" #include "jsarray.h" @@ -89,10 +88,10 @@ using mozilla::dom::ContentParent; namespace mozilla { namespace dom { -NS_IMPL_ISUPPORTS5(TabParent, nsITabParent, nsIWebProgress, nsIAuthPromptProvider, nsISSLStatusProvider, nsISecureBrowserUI) +NS_IMPL_ISUPPORTS4(TabParent, nsITabParent, nsIAuthPromptProvider, nsISSLStatusProvider, nsISecureBrowserUI) TabParent::TabParent() - : mSecurityState(nsIWebProgressListener::STATE_IS_INSECURE) + : mSecurityState(0) { } @@ -137,269 +136,6 @@ TabParent::RecvEvent(const RemoteDOMEvent& aEvent) return true; } -bool -TabParent::RecvNotifyProgressChange(const PRInt64& aProgress, - const PRInt64& aProgressMax, - const PRInt64& aTotalProgress, - const PRInt64& aMaxTotalProgress) -{ - /* - * First notify any listeners of the new progress info... - * - * Operate the elements from back to front so that if items get - * get removed from the list it won't affect our iteration - */ - nsCOMPtr listener; - PRUint32 count = mListenerInfoList.Length(); - - while (count-- > 0) { - TabParentListenerInfo *info = &mListenerInfoList[count]; - if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_PROGRESS)) { - continue; - } - - listener = do_QueryReferent(info->mWeakListener); - if (!listener) { - // the listener went away. gracefully pull it out of the list. - mListenerInfoList.RemoveElementAt(count); - continue; - } - - nsCOMPtr listener2 = - do_QueryReferent(info->mWeakListener); - if (listener2) { - listener2->OnProgressChange64(this, nsnull, aProgress, aProgressMax, - aTotalProgress, aMaxTotalProgress); - } else { - listener->OnProgressChange(this, nsnull, PRInt32(aProgress), - PRInt32(aProgressMax), - PRInt32(aTotalProgress), - PRInt32(aMaxTotalProgress)); - } - } - - return true; -} - -bool -TabParent::RecvNotifyStateChange(const PRUint32& aStateFlags, - const nsresult& aStatus) -{ - /* - * First notify any listeners of the new state info... - * - * Operate the elements from back to front so that if items get - * get removed from the list it won't affect our iteration - */ - nsCOMPtr listener; - PRUint32 count = mListenerInfoList.Length(); - - while (count-- > 0) { - TabParentListenerInfo *info = &mListenerInfoList[count]; - - // The flags used in listener registration are shifted over - // 16 bits from the ones sent in the notification, so we shift - // to see if the listener is interested in this change. - // Note that the flags are not changed in the notification we - // send along. Flags are defined in nsIWebProgressListener and - // nsIWebProgress. - // See nsDocLoader for another example of this. - if (!(info->mNotifyMask & (aStateFlags >> NOTIFY_FLAG_SHIFT))) { - continue; - } - - listener = do_QueryReferent(info->mWeakListener); - if (!listener) { - // the listener went away. gracefully pull it out of the list. - mListenerInfoList.RemoveElementAt(count); - continue; - } - - listener->OnStateChange(this, nsnull, aStateFlags, aStatus); - } - - return true; - } - -bool -TabParent::RecvNotifyLocationChange(const nsCString& aUri) -{ - nsCOMPtr uri; - nsresult rv = NS_NewURI(getter_AddRefs(uri), aUri); - if (NS_FAILED(rv)) { - return false; - } - - /* - * First notify any listeners of the new state info... - * - * Operate the elements from back to front so that if items get - * get removed from the list it won't affect our iteration - */ - nsCOMPtr listener; - PRUint32 count = mListenerInfoList.Length(); - - while (count-- > 0) { - TabParentListenerInfo *info = &mListenerInfoList[count]; - if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_LOCATION)) { - continue; - } - - listener = do_QueryReferent(info->mWeakListener); - if (!listener) { - // the listener went away. gracefully pull it out of the list. - mListenerInfoList.RemoveElementAt(count); - continue; - } - - listener->OnLocationChange(this, nsnull, uri); - } - - return true; -} - -bool -TabParent::RecvNotifyStatusChange(const nsresult& status, - const nsString& message) -{ - /* - * First notify any listeners of the new state info... - * - * Operate the elements from back to front so that if items get - * get removed from the list it won't affect our iteration - */ - nsCOMPtr listener; - PRUint32 count = mListenerInfoList.Length(); - - while (count-- > 0) { - TabParentListenerInfo *info = &mListenerInfoList[count]; - if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_STATUS)) { - continue; - } - - listener = do_QueryReferent(info->mWeakListener); - if (!listener) { - // the listener went away. gracefully pull it out of the list. - mListenerInfoList.RemoveElementAt(count); - continue; - } - - listener->OnStatusChange(this, nsnull, status, message.BeginReading()); - } - - return true; -} - -bool -TabParent::RecvNotifySecurityChange(const PRUint32& aState, - const PRBool& aUseSSLStatusObject, - const nsString& aTooltip, - const nsCString& aSecInfoAsString) -{ - /* - * First notify any listeners of the new state info... - * - * Operate the elements from back to front so that if items get - * get removed from the list it won't affect our iteration - */ - - mSecurityState = aState; - mSecurityTooltipText = aTooltip; - - if (!aSecInfoAsString.IsEmpty()) { - nsCOMPtr secInfoSupports; - nsresult rv = NS_DeserializeObject(aSecInfoAsString, getter_AddRefs(secInfoSupports)); - - if (NS_SUCCEEDED(rv)) { - nsCOMPtr idInfo = do_QueryInterface(secInfoSupports); - if (idInfo) { - PRBool isEV; - if (NS_SUCCEEDED(idInfo->GetIsExtendedValidation(&isEV)) && isEV) - mSecurityState |= nsIWebProgressListener::STATE_IDENTITY_EV_TOPLEVEL; - } - } - - mSecurityStatusObject = nsnull; - if (aUseSSLStatusObject) - { - nsCOMPtr sslStatusProvider = - do_QueryInterface(secInfoSupports); - if (sslStatusProvider) - sslStatusProvider->GetSSLStatus(getter_AddRefs(mSecurityStatusObject)); - } - } - - nsCOMPtr listener; - PRUint32 count = mListenerInfoList.Length(); - - while (count-- > 0) { - TabParentListenerInfo *info = &mListenerInfoList[count]; - if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_SECURITY)) { - continue; - } - - listener = do_QueryReferent(info->mWeakListener); - if (!listener) { - // the listener went away. gracefully pull it out of the list. - mListenerInfoList.RemoveElementAt(count); - continue; - } - - listener->OnSecurityChange(this, nsnull, mSecurityState); - } - - return true; -} - -bool -TabParent::RecvRefreshAttempted(const nsCString& aURI, const PRInt32& aMillis, - const bool& aSameURI, bool* refreshAllowed) -{ - nsCOMPtr uri; - nsresult rv = NS_NewURI(getter_AddRefs(uri), aURI); - if (NS_FAILED(rv)) { - return false; - } - /* - * First notify any listeners of the new state info... - * - * Operate the elements from back to front so that if items get - * get removed from the list it won't affect our iteration - */ - - nsCOMPtr listener; - PRUint32 count = mListenerInfoList.Length(); - - *refreshAllowed = true; - while (count-- > 0) { - TabParentListenerInfo *info = &mListenerInfoList[count]; - if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_REFRESH)) { - continue; - } - - listener = do_QueryReferent(info->mWeakListener); - if (!listener) { - // the listener went away. gracefully pull it out of the list. - mListenerInfoList.RemoveElementAt(count); - continue; - } - - nsCOMPtr listener2 = - do_QueryReferent(info->mWeakListener); - if (!listener2) { - continue; - } - - // some listeners don't seem to set this at all... - PRBool allowed = true; - listener2->OnRefreshAttempted(this, uri, - aMillis, aSameURI, &allowed); - *refreshAllowed = allowed && *refreshAllowed; - } - - return true; -} - bool TabParent::AnswerCreateWindow(PBrowserParent** retval) { @@ -458,6 +194,7 @@ NS_IMETHODIMP TabParent::GetState(PRUint32 *aState) { NS_ENSURE_ARG(aState); + NS_WARNING("SecurityState not valid here"); *aState = mSecurityState; return NS_OK; } @@ -628,71 +365,6 @@ TabParent::ReceiveMessage(const nsString& aMessage, return true; } -// nsIWebProgress -nsresult -TabParent::AddProgressListener(nsIWebProgressListener* aListener, - PRUint32 aNotifyMask) -{ - if (GetListenerInfo(aListener)) { - // The listener is already registered! - return NS_ERROR_FAILURE; - } - - nsWeakPtr listener = do_GetWeakReference(aListener); - if (!listener) { - return NS_ERROR_INVALID_ARG; - } - - TabParentListenerInfo info(listener, aNotifyMask); - - if (!mListenerInfoList.AppendElement(info)) - return NS_ERROR_FAILURE; - - return NS_OK; -} - -NS_IMETHODIMP -TabParent::RemoveProgressListener(nsIWebProgressListener *aListener) -{ - nsAutoPtr info(GetListenerInfo(aListener)); - - return info && mListenerInfoList.RemoveElement(*info) ? - NS_OK : NS_ERROR_FAILURE; -} - -TabParentListenerInfo * -TabParent::GetListenerInfo(nsIWebProgressListener *aListener) -{ - PRUint32 i, count; - TabParentListenerInfo *info; - - nsCOMPtr listener1 = do_QueryInterface(aListener); - count = mListenerInfoList.Length(); - for (i = 0; i < count; ++i) { - info = &mListenerInfoList[i]; - - if (info) { - nsCOMPtr listener2 = do_QueryReferent(info->mWeakListener); - if (listener1 == listener2) { - return info; - } - } - } - return nsnull; -} - -NS_IMETHODIMP -TabParent::GetDOMWindow(nsIDOMWindow **aResult) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -TabParent::GetIsLoadingDocument(PRBool *aIsLoadingDocument) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - // nsIAuthPromptProvider // This method is largely copied from nsDocShell::GetAuthPrompt diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index 1c8cb8dc748..e58449f68ed 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -48,8 +48,6 @@ #include "nsCOMPtr.h" #include "nsITabParent.h" #include "nsIBrowserDOMWindow.h" -#include "nsIWebProgress.h" -#include "nsIWebProgressListener.h" #include "nsWeakReference.h" #include "nsIDialogParamBlock.h" #include "nsIAuthPromptProvider.h" @@ -66,34 +64,11 @@ struct JSObject; namespace mozilla { namespace dom { -struct TabParentListenerInfo -{ - TabParentListenerInfo(nsIWeakReference *aListener, unsigned long aNotifyMask) - : mWeakListener(aListener), mNotifyMask(aNotifyMask) - { - } - - TabParentListenerInfo(const TabParentListenerInfo& obj) - : mWeakListener(obj.mWeakListener), mNotifyMask(obj.mNotifyMask) - { - } - - nsWeakPtr mWeakListener; - - PRUint32 mNotifyMask; -}; - -inline -bool operator==(const TabParentListenerInfo& lhs, const TabParentListenerInfo& rhs) -{ - return &lhs == &rhs; -} class ContentDialogParent : public PContentDialogParent {}; class TabParent : public PBrowserParent , public nsITabParent - , public nsIWebProgress , public nsIAuthPromptProvider , public nsISecureBrowserUI , public nsISSLStatusProvider @@ -110,24 +85,6 @@ public: virtual bool RecvMoveFocus(const bool& aForward); virtual bool RecvEvent(const RemoteDOMEvent& aEvent); - virtual bool RecvNotifyProgressChange(const PRInt64& aProgress, - const PRInt64& aProgressMax, - const PRInt64& aTotalProgress, - const PRInt64& aMaxTotalProgress); - virtual bool RecvNotifyStateChange(const PRUint32& aStateFlags, - const nsresult& aStatus); - virtual bool RecvNotifyLocationChange(const nsCString& aUri); - virtual bool RecvNotifyStatusChange(const nsresult& status, - const nsString& message); - virtual bool RecvNotifySecurityChange(const PRUint32& aState, - const PRBool& aUseSSLStatusObject, - const nsString& aTooltip, - const nsCString& aSecInfoAsString); - - virtual bool RecvRefreshAttempted(const nsCString& aURI, - const PRInt32& aMillis, - const bool& aSameURI, - bool* aAllowRefresh); virtual bool AnswerCreateWindow(PBrowserParent** retval); virtual bool RecvSyncMessage(const nsString& aMessage, @@ -206,7 +163,6 @@ public: JSBool GetGlobalJSObject(JSContext* cx, JSObject** globalp); NS_DECL_ISUPPORTS - NS_DECL_NSIWEBPROGRESS NS_DECL_NSIAUTHPROMPTPROVIDER NS_DECL_NSISECUREBROWSERUI NS_DECL_NSISSLSTATUSPROVIDER @@ -218,15 +174,11 @@ protected: const nsString& aJSON, nsTArray* aJSONRetVal = nsnull); - TabParentListenerInfo* GetListenerInfo(nsIWebProgressListener *aListener); - void ActorDestroy(ActorDestroyReason why); nsIDOMElement* mFrameElement; nsCOMPtr mBrowserDOMWindow; - nsTArray mListenerInfoList; - struct DelayedDialogData { DelayedDialogData(PContentDialogParent* aDialog, PRUint32 aType, diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index cc195574265..40c903c5aef 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -318,7 +318,7 @@ + onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);"/> null