aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EphyBrowser.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-10-28 01:29:36 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-10-28 01:29:36 +0800
commit7b0fe9305597ff7bd10c4dc468ae00eab155ca36 (patch)
tree5b8a213e75b8c49a7246abed3ac9e65393517d9d /embed/mozilla/EphyBrowser.cpp
parent03518bcc5c5aa9a9149315e932f84a0aee2d44ce (diff)
downloadgsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.gz
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.bz2
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.lz
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.xz
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.zst
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.zip
Solving the wrapper mess THE END
2003-10-27 Marco Pesenti Gritti <marco@gnome.org> * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: Solving the wrapper mess THE END An about:blank document is created syncronously on _init, which means there are no more race conditions ! Mozilla api is CRACK.
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r--embed/mozilla/EphyBrowser.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index f23f7163a..812ba9b53 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -90,18 +90,20 @@ EphyBrowser::~EphyBrowser ()
nsresult EphyBrowser::Init (GtkMozEmbed *mozembed)
{
+ nsresult rv;
+
mGtkMozEmbed = mozembed;
gtk_moz_embed_get_nsIWebBrowser (mozembed,
getter_AddRefs(mWebBrowser));
if (!mWebBrowser) return NS_ERROR_FAILURE;
- return mWebBrowser->GetContentDOMWindow (getter_AddRefs (mDOMWindow));
-}
+ mWebBrowser->GetContentDOMWindow (getter_AddRefs (mDOMWindow));
-nsresult EphyBrowser::InitDocument ()
-{
- nsresult rv;
+ /* This will instantiate an about:blank doc if necessary */
+ nsCOMPtr<nsIDOMDocument> domDocument;
+ rv = mDOMWindow->GetDocument (getter_AddRefs (mDOMDocument));
+ if (NS_FAILED (rv)) return NS_ERROR_FAILURE;
mEventListener = new EphyEventListener();
@@ -368,7 +370,8 @@ nsresult EphyBrowser::GetZoom (float *aZoom)
nsresult EphyBrowser::GetDocument (nsIDOMDocument **aDOMDocument)
{
- return mDOMWindow->GetDocument (aDOMDocument);
+ NS_ENSURE_ARG_POINTER(aDOMDocument);
+ NS_IF_ADDREF(*aDOMDocument = mDOMDocument);
}
nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument)