Re: Asynchronous use of SwHTMLParser - is this needed
On Thu, Apr 19, 2012 at 05:06:43PM -0400, Kohei Yoshida kohei.yosh...@gmail.com wrote: My question is, do we need to keep this asynchronicity of SwHTMLParser, or is it okay to change it into a synchronous call like the rest of SvParser uses? I would be surprised if this would be really required, all the sw filters I know of are synchronous ones. Miklos ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Asynchronous use of SwHTMLParser - is this needed
On 20/04/12 09:01, Miklos Vajna wrote: On Thu, Apr 19, 2012 at 05:06:43PM -0400, Kohei Yoshida kohei.yosh...@gmail.com wrote: My question is, do we need to keep this asynchronicity of SwHTMLParser, or is it okay to change it into a synchronous call like the rest of SvParser uses? I would be surprised if this would be really required, all the sw filters I know of are synchronous ones. then you haven't heard of these ones: filter/source/config/fragments/filters/HTML.xcu:prop oor:name=FlagsvalueIMPORT EXPORT ASYNCHRON PREFERRED/value/prop filter/source/config/fragments/filters/HTML__StarWriter_.xcu:prop oor:name=FlagsvalueIMPORT EXPORT ALIEN ASYNCHRON/value/prop filter/source/config/fragments/filters/writer_web_HTML_help.xcu:prop oor:name=FlagsvalueIMPORT INTERNAL NOTINFILEDIALOG NOTINCHOOSER ASYNCHRON READONLY/value/prop filter/source/config/fragments/filters/writerglobal8_HTML.xcu:prop oor:name=FlagsvalueEXPORT ALIEN ASYNCHRON NOTINCHOOSER/value/prop quite what the advantage of that is i don't know; presumably it makes Writer a better Web browser somehow? I'm working on removing SvRefBase from SvParser to make its life cycle a little more easier to understand. I've checked the call sites of all of its derived classes, and in most of those call sites, we could easily replace it with scoped_ptr. The only exception is the SwHTMLParser, where its use involves asynchronous call to parse HTML input. This makes a bit non-trivial to manage its life cycle. would wrapping a shared_ptr around it work? ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Asynchronous use of SwHTMLParser - is this needed
Hi Kohei, On Thursday, 2012-04-19 17:06:43 -0400, Kohei Yoshida wrote: My question is, do we need to keep this asynchronicity of SwHTMLParser, or is it okay to change it into a synchronous call like the rest of SvParser uses? IIRC the intention was to not make the user wait until timeout if a site can't be connected or doesn't serve the document. I'd say we should keep that. Eike -- LibreOffice Calc developer. Number formatter stricken i18n transpositionizer. GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD pgpRZEUp0V3EY.pgp Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Asynchronous use of SwHTMLParser - is this needed
On Fri, 2012-04-20 at 13:03 +0200, Eike Rathke wrote: Hi Kohei, On Thursday, 2012-04-19 17:06:43 -0400, Kohei Yoshida wrote: My question is, do we need to keep this asynchronicity of SwHTMLParser, or is it okay to change it into a synchronous call like the rest of SvParser uses? IIRC the intention was to not make the user wait until timeout if a site can't be connected or doesn't serve the document. I'd say we should keep that. Ok. That makes sense. Unfortunately, keeping this behavior makes removal of SvRefBase from SvParser non-trivial. I'll put my work on hold for now. I might come back to give it another try later. If someone is interested, here is my work-in-progress patch. http://people.freedesktop.org/~kohei/my-attempt-to-remove-svrefbase-from-svparser.diff plus e1520a9d6a9f9bcfcaa332d54892040fe54776c2 a4bc804627b8b21506e9b86fa54d2f7d2525e43e which were committed earlier then reverted due to a crasher these changes caused. Best, Kohei -- Kohei Yoshida, LibreOffice hacker, Calc ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Asynchronous use of SwHTMLParser - is this needed
On Fri, 2012-04-20 at 12:39 +0200, Michael Stahl wrote: I'm working on removing SvRefBase from SvParser to make its life cycle a little more easier to understand. I've checked the call sites of all of its derived classes, and in most of those call sites, we could easily replace it with scoped_ptr. The only exception is the SwHTMLParser, where its use involves asynchronous call to parse HTML input. This makes a bit non-trivial to manage its life cycle. would wrapping a shared_ptr around it work? Well, it might work, but not without untangling the ref-count manipulation that SvParser does during the anync call. http://opengrok.libreoffice.org/xref/core/svtools/source/svrtf/svparser.cxx#596 I haven't wrapped my head around the logic behind these ref-count changes here, so I'm not 100% sure... Kohei -- Kohei Yoshida, LibreOffice hacker, Calc ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice