diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-10-29 08:08:01 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-10-29 08:08:01 +0800 |
commit | 33f74133e5d7626a2aabaa25c50ab2e9d4425505 (patch) | |
tree | d843be8bbb930d6f6e81113a41a11b97c648cd99 /embed | |
parent | ec20564f0a61b4f1dc58d9ec490d4b66a6543ae0 (diff) | |
download | gsoc2013-epiphany-33f74133e5d7626a2aabaa25c50ab2e9d4425505.tar gsoc2013-epiphany-33f74133e5d7626a2aabaa25c50ab2e9d4425505.tar.gz gsoc2013-epiphany-33f74133e5d7626a2aabaa25c50ab2e9d4425505.tar.bz2 gsoc2013-epiphany-33f74133e5d7626a2aabaa25c50ab2e9d4425505.tar.lz gsoc2013-epiphany-33f74133e5d7626a2aabaa25c50ab2e9d4425505.tar.xz gsoc2013-epiphany-33f74133e5d7626a2aabaa25c50ab2e9d4425505.tar.zst gsoc2013-epiphany-33f74133e5d7626a2aabaa25c50ab2e9d4425505.zip |
We cant cache mDOMDocument, it changes for every document loaded. Remove
2003-10-29 Marco Pesenti Gritti <marco@gnome.org>
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EphyBrowser.h:
* embed/mozilla/EventContext.cpp:
We cant cache mDOMDocument, it changes for
every document loaded.
Remove some unused methods from definition.
Diffstat (limited to 'embed')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 8 | ||||
-rw-r--r-- | embed/mozilla/EphyBrowser.h | 7 | ||||
-rw-r--r-- | embed/mozilla/EventContext.cpp | 6 |
3 files changed, 5 insertions, 16 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 7579d8712..8d1b3cdd0 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -99,7 +99,7 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed) /* This will instantiate an about:blank doc if necessary */ nsCOMPtr<nsIDOMDocument> domDocument; - rv = mDOMWindow->GetDocument (getter_AddRefs (mDOMDocument)); + rv = mDOMWindow->GetDocument (getter_AddRefs (domDocument)); if (NS_FAILED (rv)) return NS_ERROR_FAILURE; mEventListener = new EphyEventListener(); @@ -367,10 +367,8 @@ nsresult EphyBrowser::GetZoom (float *aZoom) nsresult EphyBrowser::GetDocument (nsIDOMDocument **aDOMDocument) { - NS_ENSURE_ARG_POINTER(aDOMDocument); - NS_IF_ADDREF(*aDOMDocument = mDOMDocument); - - return NS_OK; + nsCOMPtr<nsIDOMDocument> domDocument; + return mDOMWindow->GetDocument (aDOMDocument); } nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) diff --git a/embed/mozilla/EphyBrowser.h b/embed/mozilla/EphyBrowser.h index 6cd0b5d57..00d49cce2 100644 --- a/embed/mozilla/EphyBrowser.h +++ b/embed/mozilla/EphyBrowser.h @@ -80,7 +80,6 @@ public: nsresult PushTargetDocument (nsIDOMDocument *domDoc); nsresult PopTargetDocument (); - nsresult GetContentViewer (nsIContentViewer **aViewer); nsresult GetDocument (nsIDOMDocument **aDOMDocument); nsresult GetTargetDocument (nsIDOMDocument **aDOMDocument); nsresult GetDocumentUrl (nsCString &url); @@ -93,18 +92,14 @@ private: nsCOMPtr<nsIWebProgressListener> mProgress; nsCOMPtr<nsIDOMEventReceiver> mEventReceiver; nsCOMPtr<nsIDOMWindow> mDOMWindow; - nsCOMPtr<nsIDOMDocument> mDOMDocument; EphyEventListener *mEventListener; nsresult GetListener (void); nsresult AttachListeners (void); nsresult DetachListeners (void); nsresult SetZoomOnDocshell (float aZoom, nsIDocShell *DocShell); - nsresult GetDocShell (nsIDocShell **aDocShell); - nsresult GetCSSBackground (nsIDOMNode *node, nsAutoString& url); nsresult GetSHistory (nsISHistory **aSHistory); - nsresult GetPIDOMWindow(nsPIDOMWindow **aPIWin); - nsresult GetWebNavigation(nsIWebNavigation **aWebNavigation); + nsresult GetContentViewer (nsIContentViewer **aViewer); }; #endif diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp index dd497f533..b67cd7231 100644 --- a/embed/mozilla/EventContext.cpp +++ b/embed/mozilla/EventContext.cpp @@ -23,7 +23,6 @@ #endif #include "EventContext.h" -#include "nsIContentViewer.h" #include "nsIDOMEventTarget.h" #include "nsIDocument.h" #include "nsIDOMHTMLInputElement.h" @@ -771,11 +770,8 @@ nsresult EventContext::IsPageFramed (nsIDOMNode *node, PRBool *Framed) { nsresult result; - nsCOMPtr<nsIContentViewer> contentViewer; - result = mBrowser->GetContentViewer (getter_AddRefs(contentViewer)); - nsCOMPtr<nsIDOMDocument> mainDocument; - result = contentViewer->GetDOMDocument (getter_AddRefs(mainDocument)); + result = mBrowser->GetDocument (getter_AddRefs(mainDocument)); if (NS_FAILED(result) || !mainDocument) return NS_ERROR_FAILURE; nsCOMPtr<nsIDOMDocument> nodeDocument; |