IRC Log Viewer » #firebreath » 2012-09-24

IRC Nick Time (GMT-7) Message
JuanDaugherty 00:09 is X11 supposed to be a universal type for createNpapiPlugin?
rkjnsn 03:09 Is it possible to use a functor instead of a member function pointer in JSAPIAuto?
The goal is to be able to wrap a functor into a JSAPI object that can be returned to Javascript.
My thought was to create a JSAPIAuto derived class templated on a functor type, which one constructs with the desired functor. When Javascript does a default invoke on the object, the functor would be called with the appropriate conversions.
One could then create a templated wrap_functor function that would deduce the correct functor type and construct the object.
JuanDaugherty 05:09 it appears that if you have serious existing plugin which works a mime type, you are essentially forced to fork FB
or not use it all
of course rewriting everything in FB context and seriously adding the FB project (PRAW) are ways to address, but I wanted to adapt and
integrate the existing code set to FB with little or no change to FB
that's turning out to be difficult or impossible in my case
*adding to
*rewriting from scratch
JuanDaugherty 10:09 are you not supposed to access npp functions directly in fb?
taxilian 10:09 ideally you should never have to access any NPAPI functions directly in FB
as far as NPP functions go, though, you don't generally *ever* call those
but if you want to provide a custom implementation, I've told you how to do that twice
you just need to provide your own class that extends NpapiPluginWin and then return an instance of that from the appropriate factory method
and in reference to your earlier comment, there are *lots* of major plugins that use firebreath that don't fork the project
JuanDaugherty 10:09 createNpapiPlugin, but i had no luck with it
taxilian 10:09 that's a very specific error report, thanks =]
if you could give me some details on what didn't work, I might be able to help you figure it out
JuanDaugherty 10:09 i don't know where to start
it's not that stuff doesn't work as such
for example
cancel that
the issue is I have a production level app that I'm trying to adapt to your fw.
which is apparently tho opposite of the use case you build for
taxilian 10:09 so far you have mentioned exactly two features that you use that FireBreath doesn't support; I fail to see how that justifies the abuse you've been spouting about how poorly FireBreath supports a "serious plugin"
particularly since the nature of an open source framework is that when such issues are encountered you can fix it, submit a pull request, (yeah yeah, PRAW I know)
and then the community maintains it
If you had spent half the time coding the fix that you've spent complaining about the lack you could have already added support in FireBreath for both features and it would work just fine
JuanDaugherty 10:09 right, let's move on, I'm fairly far along on this and committed to committing my client to your project
what I'm contributing to FB is that this commercial product will use it. I understand if my comment ticked you off.
taxilian 10:09 ticked off is far too strong a word; it's just that I have been trying to do everything I reasonably can to help you get things working, but I haven't really felt like you've reciprocated in any particularly strong way
JuanDaugherty 10:09 in general, I want to have access the fb equivalents in my PluginCore derivative so I can hook that up to the existing code
taxilian 10:09 and forgive me if one more commercial product using my framework isn't something I start jumping up and down in excitement about; it's great and all, but there are already quite a few of those, including mine
JuanDaugherty 10:09 find myself blocked in that
taxilian 10:09 what specifically do you need access to?
JuanDaugherty 10:09 npp functions for example, at this point accessing them directly but prefer not to do that
taxilian 10:09 are you trying to override the implementation or call them?
JuanDaugherty 10:09 call them to extend
taxilian 10:09 … so override (extend) the implementation?
JuanDaugherty 10:09 a few. most to just use as it
taxilian 10:09 I'm really confused. Are you sure you don't mean the NPN functions?
I can't think of any reason that you would ever want to call the NPP functions on any plugin
those are the functions given by your plugin to the browser
JuanDaugherty 10:09 sorry I thought I said that
taxilian 10:09 you've been saying NPP
that's why I was confused
JuanDaugherty 10:09 my bad
taxilian 10:09 the NPN functions you can get to
though generally anything you need to call on that there is a better way to do it through the FireBreath
basically NPN functions are going to be used through the BrowserHost
And if for whatever reason you need to access the NPAPI ones directly you can cast the BrowserHostPtr to a NpapiBrowserHostPtr and then you can access any of them
However, seems like you said you needed to support ActiveX; you'll want to avoid doing anything that requires accessing Npapi stuff directly if that's what you need or you'll have to write it twice
JuanDaugherty 10:09 I couldn't understand how BrowserHost was both, nor why m_host was protected
*how I could use
*how I could use BrowserHost as both
taxilian 10:09 BrowserHost is an abstract base class
depending on which browser you are on, it will actually be either a NpapiBrowserHost or an ActiveXBrowserHost
both implement the interface, thus anything on that class should work on either configuration
m_host should have been private with a protected accessor, but I decided that too late to change it and it's not an important enough change to break backwards compatibility
JuanDaugherty 11:09 ah, so how should I access, your preferred way?
*access it
taxilian 11:09 what do you want to do?
it's not always a 1:1 mapping between npapi and firebreath, mainly because it isn't a 1:1 between npapi and activex
JuanDaugherty 11:09 get the stuff like the npn functions, or rather their fb abstractions
taxilian 11:09 which ones?
JuanDaugherty 11:09 yes I understand that
taxilian 11:09 I mean, NPN_CreateObject you'll never call
nor MemFree or Release
what are you trying to do?
JuanDaugherty 11:09 MemFree and MemAlloc are ones I need, Ive tried to explain that I'm adapting an existing codeset to your fw
taxilian 11:09 you'll have to rewrite that part
to use JSAPIAuto
you won't touch a NPVariant
but when you're done it'll work on ie or npapi
JuanDaugherty 11:09 OK what about GetURL?
or WriteStream?
taxilian 11:09 that one is a bit more tricky; GetURL you'll need to use BrowserStreams; look at SimpleStreamsHelper.h. there is an example of m_host->AsyncGet in FBTestPlugin
WriteStream… what are you doing with it?
JuanDaugherty 11:09 so here's the conflict
I want the minimal adaptation to your fw and you want me to maximal rewrite of this codeset for it. Is there no compromise?
taxilian 11:09 not in the things you've described, no. if you want to use NPAPI memory management and NPObjects directly there isn't much point in using FireBreath
JuanDaugherty 11:09 I would rather not use them directly, but you've been very clear and I appreciate your support.
taxilian 11:09 the problem is that hte more complicated the source plugin, the harder it will be to port it.
I've ported several; some are really easy, others much harder
I haven't come up with any solution to make it easier; I dont' think there is one
JuanDaugherty 11:09 the point of using your fw is that it obviates a port
taxilian 11:09 to another platform or to IE?
JuanDaugherty 11:09 which ever
you intend to be the major plugin fw don't you? SFAICT you are now.
taxilian 11:09 as you say, we basically are
JuanDaugherty 11:09 but chrome, ff, and ie are all I'm signed up for
taxilian 11:09 if you need to port to ActiveX then the memory management stuff is unavoidable; you can port it to FireBreath and it'll work everywhere, or you can port to ActiveX and maintain two different versions
and believe me, activex is far more of a pain than firebreath
JuanDaugherty 11:09 the prior product supported opera, but I think that's not a concern at this point
the prior product used an ocx
taxilian 11:09 so the main purpose of FireBreath is to provide a unified API; so you don't have to implement an OCX and a NPAPI plugin, you just make a FireBreath plugin and it works for both
not really any way to do that without the abstraction that is a bit of a pain to port to if your original API is complicated
but it'll probably be 1/2 the code when you're done
and far easier to maintain. Of course, that isn't really your problem, so I understand why that's frustrating
JuanDaugherty 11:09 I'd back out but i'm far too committed, I still think it's the right decision for the client though, I'm mostly done with my approach and I have no intention of doing a complete rewrite
taxilian 11:09 if you're using npapi stuff for memory management directly you will regret it before you finish the project
it's totally up to you; I'm just letting you know
JuanDaugherty 11:09 it would be the wrong thing to do anyway from a practical standpoint, as it's a 20 year old proven codeset
no I got it, nothing you said was a surprise but hearing it confirms, thx
why would that be, the prior codeset uses it and works with current browsers?
taxilian 11:09 because the prior project was two different "plugins". one npapi plugin and one activex control
what you're suggesting is not to use firebreath, but rather to basically build two plugins into the same .dll
if you're going to do that, then just combine the two other plugins
why use firebreath? that's like saying "I'm going to use UPS because I don't trust the postal service" and then having ups send it to the post office so it can go out on priority mail
JuanDaugherty 11:09 huh, I though that's how FB worked, 1 dll for all browsers on Windows
taxilian 11:09 it is
JuanDaugherty 11:09 *thought
taxilian 11:09 but it's not just 1 dll, it's 1 plugin
with an adapter for both
you're removing the adapter
what is the point of firebreath if you're doing that?
JuanDaugherty 11:09 how am I doing that?
removing the adapter
taxilian 11:09 well, I still don't know the full scope of what you're doing
if you're using NPN_MemAlloc and you actually need to, then there are two possibilities:
JuanDaugherty 11:09 at this point I'm still pretty much coloring within the FB lines
taxilian 11:09 1) you're allocating memory to use with NPVariants, which means you're totally bypassing FireBreath's adapters
or 2) you're using it to allocate memory when there is absolutely no reason for you to use that instead of just using malloc / free
so I guess I'm making the assumption that you know what the point of using npapi's memory management stuff is; specifically, to manage memory in a manner that it can be passed back to the browser and maanaged there
JuanDaugherty 11:09 there's an abstraction mem alloc/free that's adapter oriented?
taxilian 11:09 no; you don't *need* one
you just use new / delete, malloc / free
the only reason you need memalloc/memfree is if you're allocating memory for use by the browser
but FireBreath does all of that for you if you're using the normal abstraction layer
JuanDaugherty 11:09 OK, this has been great. Doxygen documentation generated from sources is one thing, but it's no substitute for expository prose documentation
this convo has filled that gap
taxilian 11:09 feel free to post it on the wiki somewhere ;-)
JuanDaugherty 11:09 sorry if I seemed brusque, but that's my persona, I mean no disrespect
taxilian 11:09 It's my fault as well; you just seem to know enough about NPAPI that I assumed you would understand the memory management paradigm
JuanDaugherty 11:09 well what you've described is the opposite of the NPN approach but then as you stated fb is distinct from that
taxilian 11:09 actually even with the NPN approach the only time you need to use NPAPI MemAlloc or MemFree is if you're going to send the memory to the browser
so to allocate a NPObject or a string
tha'ts really it
JuanDaugherty 11:09 I don't specialize, I'm a generalist, I've done some mozilla dev, but this is my first and probably my last plugin work
taxilian 11:09 if you use it for anything else you're just using a less efficient malloc (less efficient only because you're passing it through a few extra layers of stack, but still)
for which you'll always be greatful =] I'm also a generalist, but circumstances have ended up giving me a specialty in plugins
JuanDaugherty 11:09 been using your pkg less than a month
seriously a little more than a week
taxilian 11:09 well, I'm glad we're starting to feel on the same page =] it'll be a lot less frustrating, I suspect =]
JuanDaugherty 11:09 at the point where I'm familiar with everything at a first line by line level in the end sourcs, a few days
end source as opposed to the gen thing, other platforms, etc.
about the memalloc, the preexisting code set reads a potentially large number of pages of document using the npn mem and other functions
like you it seems to also combine some of those with AX
taxilian 11:09 so they have their own abstraction that is used for either browser?
JuanDaugherty 11:09 no, the code set had become unwieldy with condition compilation for the different end binaries and products
I think the did a cleanup for Mac and didn't want to do dos themselves
taxilian 11:09 understandable; if it were me, I would avoid premature optimization and just use standard C++ memory management until it is shown there is a problem
JuanDaugherty 11:09 optimization isn't an issue, it's already fast
but yeah, doing regular c++ mm fits in with what I've done already
so thanks again for your help and your excellent free software
1 more thing, jsapi is for external scripting, not plugin internals, no?
taxilian 11:09 generally that's the intent, yes
though there is no reason you couldn't use it interally, it's not terribly efficient
JuanDaugherty 11:09 just wanted to make sure I wasn't overlooking something relevant to this job
mattbemis 12:09 Great product...wish our team had hardcore c++ devs.
taxilian 12:09 glad it's helpful
mattbemis 12:09 anyone know of a good consulting shop to assist us in our development with firebreath?
taxilian 12:09 not a shop. I sometimes take side projects, but my time is pretty limited
mattbemis 12:09 this is a large project...probably too big for a side project.
we want to replace our silverlight -> wcf localhost communications with javascript calls to firebreath to do scanning
our wcf is filled with generics and the /clr build of firebreath 1.6 seems to not work with boost exceptions compat issues.
taxilian 12:09 what kind of scanning?
mattbemis 12:09 document scanning (our company is
we use firebreath to detect session id on terminal services and citrix. lol one call only...
taxilian 12:09 the plugin part doesn't seem like it'd be all that bad
mattbemis 12:09 our wcf services all use async callbacks
and .NET generics
taxilian 12:09 interfacing with .net could be a pain
mattbemis 12:09 I looked into rewriting them to use non generics, but that seemed like too much work.
taxilian 12:09 I dont' know of anyone who has gotten that to work w/ firebreath
mattbemis 12:09 :)
ticket 82
made me hopeful
1.5.2 seemed to work with /clr
taxilian 12:09 interesting
I'd forgotten about that
mattbemis 12:09 :)
do you know anyone that takes on larger side projects?
lemme joine this from pidgin...i am through the web page right now.
bemis1 12:09 hey
taxilian 12:09 welcome back
I don't know anyone who does that, except for occasional people who pop in here, and they generally are already doing a larger side project
bemis1 12:09 in our lab and our beta sites silverlight -> wcf works great.
in the wild though...antivirus, other apps seem to interfere and cause enough support calls to warrent this change.
taxilian 12:09 wcf is over TCP, no?
bemis1 12:09 yeah.
taxilian 12:09 most likely your issue, then, is that you need to only bind to
antivirus programs dont' seem to block that
bemis1 12:09 :)
taxilian 12:09 I've done some pretty extensive testing and never seen one that did
when I was working at Facebook
bemis1 12:09 clientaccesspolicy
needs to be hosted on port 80
taxilian 12:09 seriously? wow
yeah, that won't work, then
bemis1 12:09 that is a silverlight policy...not ours.
taxilian 12:09 I believe you
bemis1 12:09 it is amazing how many vendors run on localhost:80
even some AV software.
taxilian 12:09 yeah; they should know better, but don't seem to
rkjnsn_work 12:09 Is there anyway to view irc logs of a certain time range without trying to guess keywords to search for that might have been mentioned?
taxilian 12:09 unfortunately, no
bemis1 12:09 google site:firebreath <keywords>
i think the logs are kept in public view.
taxilian 12:09 the person who was writing that log viewer dropped out
bemis1 12:09 ah.
taxilian 12:09 hmm.
but I could give you the URL to the logs themselves
if I can remember it
bemis1 12:09 I think it is on the site.
rkjnsn_work 12:09 bemis1: That only lets you search. I just want to see the raw logs.
JuanDaugherty 12:09 doesnt that functionality come with the Atlassian product?
taxilian 12:09 no
rkjnsn_work 12:09 Thanks.
JuanDaugherty 12:09 is there an event that corresponds to the NewStream call?
taxilian 12:09 yes; go look at SimpleStreamHelper
it's the best example we have
JuanDaugherty 12:09 got it was just doing
rkjnsn_work 12:09 On another note, any thoughts on the best way to create a function that wraps an arbitrary functor into a JSAPI object?
JuanDaugherty 12:09 it's part of the fw though isn't it, did you mean there was a sample app using it someplace?
both apparently
taxilian 12:09 rkjnsn_work: you can extend JSAPIFunction
I have been meaning to create a template-driven helper for that, but havne't had time
but there are examples in NPJavascriptObject
for addEventListener and removeEventListener
JuanDaugherty 12:09 FBTestPlugin is supposed to be setup with prepXXXX?
taxilian 12:09 prep2010 examples
by default it will prep to the buildex/ directory
JuanDaugherty 12:09 so you don't move like with a project?
taxilian 12:09 you can if you want; the main advantage to moving a project out of the fb root is to be able ot better seperate things in source control
JuanDaugherty 13:09 the not founds are OK on windows?
taxilian 13:09 yes
JuanDaugherty 13:09 ah
JuanDaugherty 13:09 so the streaming function in the fw is two files, the i/f and impl. and works with all fb supported browsers?
taxilian 13:09 should
rkjnsn_work 17:09 Okay, let me make sure I understand what I am reading... JSFunction is designed to take a JSAPI object and turn one of its methods into a full-blown function object.
So, I would be inheriting from JSFunction to purloin it's handling of HasMethod and whatnot.
Then, I would pass dummy values to JSFunction's constructor for "obj" and "func", since they are only used in "exec", which I will be overriding.
Is that correct?