svnno****@sourc*****
svnno****@sourc*****
Tue Feb 19 15:46:35 JST 2008
Revision: 3362 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3362 Author: ikezoe Date: 2008-02-19 15:46:34 +0900 (Tue, 19 Feb 2008) Log Message: ----------- * module/embed/gecko/kz-mozutils.h: Support for xulrunner-1.9. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/module/embed/gecko/kz-mozutils.h Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2008-02-19 06:42:34 UTC (rev 3361) +++ kazehakase/trunk/ChangeLog 2008-02-19 06:46:34 UTC (rev 3362) @@ -5,6 +5,7 @@ module/embed/gecko/gtkmozembed/EmbedWindowCreator.cpp, module/embed/gecko/gtkmozembed/EmbedStream.cpp: Use static_cast instead of NS_STATIC_CAST. + * module/embed/gecko/kz-mozutils.h: Support for xulrunner-1.9. 2008-02-07 Kouhei Sutou <kou****@cozmi*****> Modified: kazehakase/trunk/module/embed/gecko/kz-mozutils.h =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-mozutils.h 2008-02-19 06:42:34 UTC (rev 3361) +++ kazehakase/trunk/module/embed/gecko/kz-mozutils.h 2008-02-19 06:46:34 UTC (rev 3362) @@ -150,18 +150,24 @@ const nsACString *contentCharset) { nsresult rv; - static NS_DEFINE_CID(kInputStreamChannelCID, NS_INPUTSTREAMCHANNEL_CID); - nsCOMPtr<nsIInputStreamChannel> channel = - do_CreateInstance(kInputStreamChannelCID, &rv); + nsCOMPtr<nsIInputStreamChannel> isc = + do_CreateInstance(NS_INPUTSTREAMCHANNEL_CONTRACTID, &rv); + if (NS_FAILED(rv)) + return rv; + rv |= isc->SetURI(uri); + rv |= isc->SetContentStream(stream); + if (NS_FAILED(rv)) + return rv; + nsCOMPtr<nsIChannel> chan = do_QueryInterface(isc, &rv); + if (NS_FAILED(rv)) + return rv; + if (!contentType.IsEmpty()) + rv |= chan->SetContentType(contentType); + if (contentCharset && !contentCharset->IsEmpty()) + rv |= chan->SetContentCharset(*contentCharset); 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); + *result = nsnull; + chan.swap(*result); } return rv; }