aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-11-23 20:12:24 +0800
committerChristian Persch <chpe@src.gnome.org>2003-11-23 20:12:24 +0800
commit6241e9eb954ea19d4c77b937118b745809e5d32f (patch)
tree3f840138a141586d55e691bfbb933a8d3fb764e4 /embed
parentebe99cfcc81d91f6ae68137cf03d5997f231c748 (diff)
downloadgsoc2013-epiphany-6241e9eb954ea19d4c77b937118b745809e5d32f.tar
gsoc2013-epiphany-6241e9eb954ea19d4c77b937118b745809e5d32f.tar.gz
gsoc2013-epiphany-6241e9eb954ea19d4c77b937118b745809e5d32f.tar.bz2
gsoc2013-epiphany-6241e9eb954ea19d4c77b937118b745809e5d32f.tar.lz
gsoc2013-epiphany-6241e9eb954ea19d4c77b937118b745809e5d32f.tar.xz
gsoc2013-epiphany-6241e9eb954ea19d4c77b937118b745809e5d32f.tar.zst
gsoc2013-epiphany-6241e9eb954ea19d4c77b937118b745809e5d32f.zip
Make it compile with mozilla 1.4 and 1.4.1 again.
2003-11-23 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/mozilla-embed-single.cpp: Make it compile with mozilla 1.4 and 1.4.1 again.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 3df1860ad..8b41666e6 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -53,12 +53,15 @@
#include <nsIFontEnumerator.h>
#include <nsISupportsPrimitives.h>
#include <nsReadableUtils.h>
-#include <nsICookie2.h>
#include <nsICookieManager.h>
#include <nsIPassword.h>
#include <nsIPasswordManager.h>
#include <nsIPassword.h>
+#if MOZILLA_SNAPSHOT > 9
+#include <nsICookie2.h>
+#else
#include <nsICookie.h>
+#endif
#if MOZILLA_SNAPSHOT > 12
#include <nsICookieManager.h>
#else
@@ -589,7 +592,7 @@ impl_get_font_list (EphyEmbedSingle *shell,
}
static EphyCookie *
-mozilla_cookie_to_ephy_cookie (nsICookie2 *keks)
+mozilla_cookie_to_ephy_cookie (nsICookie *keks)
{
EphyCookie *cookie;
@@ -610,14 +613,6 @@ mozilla_cookie_to_ephy_cookie (nsICookie2 *keks)
keks->GetIsSecure (&isSecure);
cookie->is_secure = isSecure != PR_FALSE;
- PRUint64 dateTime;
- keks->GetExpires (&dateTime);
- cookie->expires = dateTime;
-
- PRInt64 expiry;
- keks->GetExpiry (&expiry);
- cookie->real_expires = expiry;
-
nsCookieStatus status;
keks->GetStatus (&status);
cookie->p3p_state = status;
@@ -626,9 +621,27 @@ mozilla_cookie_to_ephy_cookie (nsICookie2 *keks)
keks->GetPolicy (&policy);
cookie->p3p_policy = policy;
- PRBool isSession;
- keks->GetIsSession (&isSession);
- cookie->is_session = isSession != PR_FALSE;
+ PRUint64 dateTime;
+ keks->GetExpires (&dateTime);
+ cookie->expires = dateTime;
+
+#if MOZILLA_SNAPSHOT > 9
+ nsCOMPtr<nsICookie2> keks2 = do_QueryInterface (keks);
+ if (keks2)
+ {
+
+ PRBool isSession;
+ keks2->GetIsSession (&isSession);
+ cookie->is_session = isSession != PR_FALSE;
+
+ if (!isSession)
+ {
+ PRInt64 expiry;
+ keks2->GetExpiry (&expiry);
+ cookie->real_expires = expiry;
+ }
+ }
+#endif
return cookie;
}
@@ -654,14 +667,9 @@ impl_list_cookies (EphyCookieManager *manager)
result = cookieEnumerator->GetNext (getter_AddRefs(keks));
if (NS_FAILED (result) || !keks) continue;
- nsCOMPtr<nsICookie2> keks2 = do_QueryInterface (keks, &result);
- if (NS_FAILED (result) || !keks2) continue;
+ EphyCookie *cookie = mozilla_cookie_to_ephy_cookie (keks);
- EphyCookie *cookie = mozilla_cookie_to_ephy_cookie (keks2);
- if (cookie != NULL)
- {
- cookies = g_list_prepend (cookies, cookie);
- }
+ cookies = g_list_prepend (cookies, cookie);
}
return cookies;
@@ -675,7 +683,7 @@ impl_remove_cookie (EphyCookieManager *manager,
nsCOMPtr<nsICookieManager> cookieManager =
do_GetService (NS_COOKIEMANAGER_CONTRACTID, &rv);
if (NS_FAILED (rv) || !cookieManager) return;
-g_print ("here!\n");
+
cookieManager->Remove (nsDependentCString(cookie->domain),
nsDependentCString(cookie->name),
nsDependentCString(cookie->path),