svnno****@sourc*****
svnno****@sourc*****
Sat Jan 5 13:46:20 JST 2008
Revision: 3329 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3329 Author: kous Date: 2008-01-05 13:46:19 +0900 (Sat, 05 Jan 2008) Log Message: ----------- * module/embed/gecko/kz-mozutils.h: re-unused nsNetUtil.h. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/module/embed/gecko/Makefile.am kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp kazehakase/trunk/module/embed/gecko/kz-mozutils.h Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2008-01-05 03:58:07 UTC (rev 3328) +++ kazehakase/trunk/ChangeLog 2008-01-05 04:46:19 UTC (rev 3329) @@ -1,7 +1,10 @@ 2008-01-05 Kouhei Sutou <kou****@cozmi*****> - * module/embed/gecko/kz-mozutils.h: used nsNetUtil.h. + * module/embed/gecko/kz-mozutils.h: re-unused nsNetUtil.h. + * module/embed/gecko/kz-mozutils.h, + module/embed/gecko/kz-mozhistorysearch.cpp: used nsNetUtil.h. + * module/embed/gecko/kz-gecko-embed.cpp: improved nsIPassword.h detection. Modified: kazehakase/trunk/module/embed/gecko/Makefile.am =================================================================== --- kazehakase/trunk/module/embed/gecko/Makefile.am 2008-01-05 03:58:07 UTC (rev 3328) +++ kazehakase/trunk/module/embed/gecko/Makefile.am 2008-01-05 04:46:19 UTC (rev 3329) @@ -127,6 +127,10 @@ -DG_LOG_DOMAIN=\"Kazehakase-Gecko\" \ -DG_DISABLE_DEPRECATED=1 +if ENABLE_GTKMOZEMBED +gecko_la_CPPFLAGS += -DENABLE_GTKMOZEMBED=1 +endif + EXTRA_DIST= \ gtkmozembed_internal.h \ gtkmozembedprivate.h Modified: kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp 2008-01-05 03:58:07 UTC (rev 3328) +++ kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp 2008-01-05 04:46:19 UTC (rev 3329) @@ -3513,7 +3513,9 @@ result = passwordManager->GetEnumerator(getter_AddRefs(passwordEnumerator)); if (NS_FAILED(result)) return FALSE; -#ifdef HAVE_NSIPASSWORD_H +#ifndef HAVE_NSIPASSWORD_H + return FALSE; +#else PRBool enumResult; for (passwordEnumerator->HasMoreElements(&enumResult) ; enumResult == PR_TRUE ; @@ -3542,9 +3544,9 @@ } *passwords = g_list_reverse (*passwords); -#endif return TRUE; +#endif } static gboolean Modified: kazehakase/trunk/module/embed/gecko/kz-mozutils.h =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-mozutils.h 2008-01-05 03:58:07 UTC (rev 3328) +++ kazehakase/trunk/module/embed/gecko/kz-mozutils.h 2008-01-05 04:46:19 UTC (rev 3329) @@ -36,7 +36,6 @@ #include <nsIRequestObserver.h> #include <nsILoadGroup.h> #include <nsNetCID.h> -#include <nsNetUtil.h> #include <nsCRT.h> #include <nsCOMPtr.h> #define MOZILLA_STRICT_API @@ -95,26 +94,6 @@ } inline nsresult -NS_NewChannel(nsIChannel **result, - nsIURI *uri, - const nsACString &contentType, - const nsACString *contentCharset) -{ - nsresult rv; - - rv = NS_NewChannel(result, uri); - if (NS_SUCCEEDED(rv)) { - nsIChannel *channel = *result; - rv |= channel->SetContentType(contentType); - if (contentCharset && contentCharset->Length()) { - rv |= channel->SetContentCharset(*contentCharset); - } - } - return rv; -} - - -inline nsresult NS_NewChannel(nsIChannel **result, nsIURI *uri, nsILoadGroup *loadGroup = nsnull, @@ -143,6 +122,86 @@ return rv; } +inline nsresult +NS_NewChannel(nsIChannel **result, + nsIURI *uri, + const nsACString &contentType, + const nsACString *contentCharset) +{ + nsresult rv; + + rv = NS_NewChannel(result, uri); + if (NS_SUCCEEDED(rv)) { + nsIChannel *channel = *result; + rv |= channel->SetContentType(contentType); + if (contentCharset && contentCharset->Length()) { + rv |= channel->SetContentCharset(*contentCharset); + } + } + return rv; +} + +#ifdef ENABLE_GTKMOZEMBED +inline nsresult +NS_NewInputStreamChannel(nsIChannel **result, + nsIURI *uri, + nsIInputStream *stream, + const nsACString &contentType, + const nsACString *contentCharset) +{ + nsresult rv; + static NS_DEFINE_CID(kInputStreamChannelCID, NS_INPUTSTREAMCHANNEL_CID); + nsCOMPtr<nsIInputStreamChannel> channel = + do_CreateInstance(kInputStreamChannelCID, &rv); + if (NS_SUCCEEDED(rv)) { + rv |= channel->SetURI(uri); + rv |= channel->SetContentStream(stream); + rv |= channel->SetContentType(contentType); + if (contentCharset && !contentCharset->IsEmpty()) { + rv |= channel->SetContentCharset(*contentCharset); + } + if (NS_SUCCEEDED(rv)) + NS_ADDREF(*result = channel); + } + return rv; +} +#endif + +inline nsresult +NS_NewLocalFileOutputStream(nsIOutputStream **aResult, + nsIFile *aFile, + PRInt32 aIOFlags = -1, + PRInt32 aPerm = -1, + PRInt32 aBehaviorFlags = 0) +{ + nsresult rv; + static NS_DEFINE_CID(kLocalFileOutputStreamCID, NS_LOCALFILEOUTPUTSTREAM_CID); + nsCOMPtr<nsIFileOutputStream> out = + do_CreateInstance(kLocalFileOutputStreamCID, &rv); + if (NS_SUCCEEDED(rv)) { + rv = out->Init(aFile, aIOFlags, aPerm, aBehaviorFlags); + if (NS_SUCCEEDED(rv)) + NS_ADDREF(*aResult = out); + } + return rv; +} + +inline nsresult +NS_NewLoadGroup(nsILoadGroup **result, + nsIRequestObserver *obs) +{ + nsresult rv; + static NS_DEFINE_CID(kLoadGroupCID, NS_LOADGROUP_CID); + nsCOMPtr<nsILoadGroup> group = + do_CreateInstance(kLoadGroupCID, &rv); + if (NS_SUCCEEDED(rv)) { + rv = group->SetGroupObserver(obs); + if (NS_SUCCEEDED(rv)) + NS_ADDREF(*result = group); + } + return rv; +} + inline void ToLowerCase (nsAString &aString) {