aboutsummaryrefslogtreecommitdiffstats
path: root/embed/xulrunner
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2007-09-13 05:02:16 +0800
committerChristian Persch <chpe@src.gnome.org>2007-09-13 05:02:16 +0800
commit43a2183069dc76f819eb517fef731eb734b2f8f3 (patch)
treeb4ca6d35baa5fc22fe139d1eadaf675c9846389b /embed/xulrunner
parent97c6ff6f592c835873a11ebc216f407dd365b90d (diff)
downloadgsoc2013-epiphany-43a2183069dc76f819eb517fef731eb734b2f8f3.tar
gsoc2013-epiphany-43a2183069dc76f819eb517fef731eb734b2f8f3.tar.gz
gsoc2013-epiphany-43a2183069dc76f819eb517fef731eb734b2f8f3.tar.bz2
gsoc2013-epiphany-43a2183069dc76f819eb517fef731eb734b2f8f3.tar.lz
gsoc2013-epiphany-43a2183069dc76f819eb517fef731eb734b2f8f3.tar.xz
gsoc2013-epiphany-43a2183069dc76f819eb517fef731eb734b2f8f3.tar.zst
gsoc2013-epiphany-43a2183069dc76f819eb517fef731eb734b2f8f3.zip
Port to frozen string API by using nsINetUtil
svn path=/trunk/; revision=7410
Diffstat (limited to 'embed/xulrunner')
-rw-r--r--embed/xulrunner/embed/EphyAboutModule.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/embed/xulrunner/embed/EphyAboutModule.cpp b/embed/xulrunner/embed/EphyAboutModule.cpp
index 4a9548f29..78ce93bec 100644
--- a/embed/xulrunner/embed/EphyAboutModule.cpp
+++ b/embed/xulrunner/embed/EphyAboutModule.cpp
@@ -1,8 +1,8 @@
/*
* Copyright © 2001 Matt Aubury, Philip Langdale
* Copyright © 2004 Crispin Flowerday
- * Copyright © 2005 Christian Persch
* Copyright © 2005 Adam Hooper
+ * Copyright © 2005, 2007 Christian Persch
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,17 +29,15 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-// we need nsEscape which depends on internal strings :(((
-#define MOZILLA_INTERNAL_API 1
-#include <nsString.h>
+#include <nsStringGlue.h>
#include <nsAutoPtr.h>
#include <nsCOMPtr.h>
-#include <nsEscape.h>
#include <nsIChannel.h>
#include <nsIInputStreamChannel.h>
#include <nsIInputStream.h>
#include <nsIIOService.h>
+#include <nsINetUtil.h>
#include <nsIOutputStream.h>
#include <nsIScriptSecurityManager.h>
#include <nsIStorageStream.h>
@@ -156,7 +154,10 @@ EphyAboutModule::ParseURL(const char *aURL,
char **params = g_strsplit (query, "&", -1);
if (!params) return NS_ERROR_FAILURE;
- for (PRUint32 i = 0; params[i] != NULL; ++i)
+ nsCOMPtr<nsINetUtil> netUtil (do_GetService (NS_NETUTIL_CONTRACTID));
+ if (!netUtil) return NS_ERROR_FAILURE;
+
+ for (PRUint32 i = 0; params[i] != NULL; ++i)
{
char *param = params[i];
@@ -165,18 +166,18 @@ EphyAboutModule::ParseURL(const char *aURL,
switch (param[0])
{
case 'e':
- aCode.Assign (nsUnescape (param + 2));
+ netUtil->UnescapeString (nsDependentCString (param + 2), 0, aCode);
break;
case 'u':
aRawOriginURL.Assign (param + 2);
- aOriginURL.Assign (nsUnescape (param + 2));
+ netUtil->UnescapeString (nsDependentCString (param + 2), 0, aOriginURL);
break;
case 'c':
- aOriginCharset.Assign (nsUnescape (param + 2));
+ netUtil->UnescapeString (nsDependentCString (param + 2), 0, aOriginCharset);
break;
/* The next one is not used in neterror but recover: */
case 't':
- aTitle.Assign (nsUnescape (param + 2));
+ netUtil->UnescapeString (nsDependentCString (param + 2), 0, aTitle);
break;
case 'd':
/* we don't need mozilla's description parameter */