svnno****@sourc*****
svnno****@sourc*****
Sun Feb 24 17:20:18 JST 2008
Revision: 3395 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3395 Author: pal_gene Date: 2008-02-24 17:20:18 +0900 (Sun, 24 Feb 2008) Log Message: ----------- *Fixup broken protocol handler in history-search: modified: module/embed/gecko/kz-mozhistorysearch.cpp modified: module/embed/gecko/kz-mozutils.h Modified Paths: -------------- kazehakase/trunk/module/embed/gecko/kz-mozhistorysearch.cpp kazehakase/trunk/module/embed/gecko/kz-mozutils.h Modified: kazehakase/trunk/module/embed/gecko/kz-mozhistorysearch.cpp =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-mozhistorysearch.cpp 2008-02-24 08:20:14 UTC (rev 3394) +++ kazehakase/trunk/module/embed/gecko/kz-mozhistorysearch.cpp 2008-02-24 08:20:18 UTC (rev 3395) @@ -94,7 +94,7 @@ NS_IMETHODIMP KzMozHistorySearchProtocolHandler::GetScheme(nsACString &result) { - result = "history-search"; + result = NS_LITERAL_CSTRING("history-search"); return NS_OK; } @@ -165,7 +165,7 @@ rv = NS_NewFileURI(getter_AddRefs(cssURI), cssFile); if (NS_FAILED(rv)) return rv; - rv = NS_NewChannel(result, uri, nsCString("text/css"), nsnull); + rv = NS_NewChannel(result, cssURI, NS_LITERAL_CSTRING("text/css"), nsnull); return rv; } @@ -182,16 +182,16 @@ gchar *filename = g_strndup(text.get() + 7, length - 7); - nsCOMPtr<nsILocalFile> cssFile; + nsCOMPtr<nsILocalFile> imgFile; rv = NS_NewNativeLocalFile(nsCString(filename), PR_TRUE, - getter_AddRefs(cssFile)); + getter_AddRefs(imgFile)); g_free (filename); - nsCOMPtr<nsIURI> cssURI; - rv = NS_NewFileURI(getter_AddRefs(cssURI), cssFile); + nsCOMPtr<nsIURI> imgURI; + rv = NS_NewFileURI(getter_AddRefs(imgURI), imgFile); if (NS_FAILED(rv)) return rv; - rv = NS_NewChannel(result, uri, nsCString("image/png"), nsnull); + rv = NS_NewChannel(result, imgURI, NS_LITERAL_CSTRING("image/png"), nsnull); return rv; } @@ -239,10 +239,13 @@ stream->Write (html, strlen(html), &bytesWritten); g_free(html); } - - rv = NS_NewChannel(result, uri, nsCString("text/html"), nsnull); + + nsCOMPtr<nsIInputStream> iStream; + rv = sStream->NewInputStream(0, getter_AddRefs(iStream)); if (NS_FAILED(rv)) return rv; - + + rv = NS_NewInputStreamChannel(result, uri, iStream, nsCString("text/html"), nsnull); + return rv; } Modified: kazehakase/trunk/module/embed/gecko/kz-mozutils.h =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-mozutils.h 2008-02-24 08:20:14 UTC (rev 3394) +++ kazehakase/trunk/module/embed/gecko/kz-mozutils.h 2008-02-24 08:20:18 UTC (rev 3395) @@ -141,7 +141,6 @@ return rv; } -#ifdef ENABLE_GTKMOZEMBED inline nsresult NS_NewInputStreamChannel(nsIChannel **result, nsIURI *uri, @@ -171,7 +170,6 @@ } return rv; } -#endif inline nsresult NS_NewLocalFileOutputStream(nsIOutputStream **aResult,