IRC Log Viewer » #firebreath » 2011-09-20

IRC Nick Time (GMT-7) Message
taxilian 11:09 I upgraded confluence on firebreath.org… it's a pain every time
hopefully didn't inconvenience too many people with the temporary outages
kigero 11:09 I was a bit freaked out for a bit - one happened while I was trying to go through the API docs :)
taxilian 11:09 heh. sorry about that
it should be stable now
the new version of confluence seems to be a lot faster, so I think it was worth it
FireBreathBot 11:09 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-116 issue commented by victorabrash "On Windows 7, you have to be an Administrator to run regsvr32. When starting your terminal, righ..."
JIRA issue http://jira.firebreath.org/browse/FIREBREATH-116 issue commented by richard "That is not actually true; you can run regsvr32 as any user, but most DLLs that support self regi..."
JIRA issue http://jira.firebreath.org/browse/FIREBREATH-128 issue created by victorabrash
taxilian 11:09 don't suppose anyone wants to try to track down FIREBREATH-128 for me? =]
FireBreathBot 11:09 FIREBREATH-128: Summary: Events not working on Safari 5.1 (Windows)
FIREBREATH-128: Assigned To: richard
FIREBREATH-128: Priority: Major, Status: Open, http://jira.firebreath.org/browse/FIREBREATH-128
kylehuff 12:09 I'm willing, but mostly unable... lol
I have no idea how to go about tracking down the cause of such an issue
taxilian 12:09 hehe. well, if you have a windows box I can walk you through some basic troubleshooting
kylehuff 12:09 okay, I assume I will need Safari 5.1 installed first
taxilian 12:09 right
kylehuff 12:09 it's downloading now... ETA 4-6 minutes
taxilian 12:09 okay
just get the environment up and let me know
I'm trying to finish architecting a web app before our contractor gets far enough that he needs it =]
kylehuff 12:09 this is actually good timing, I literally just moments ago published a new version of my plugin, and was wondering what I was going to do next.
taxilian 12:09 hehe. awesome
VictorAbrash 12:09 I'm trying to support multiple mimetypes in my plugin. I've modified my PluginConfig.make file to create multiple values for some keys, modified my factory createPlugin() method to send the mimetype to my main PluginCore object, and my createJSAPI() method to return either my main object or the helper object based on the mimetype. All that seems to work, and I can create both kinds of object in my JS application using the
However, if I try to use my new helper object as a parameter to a different object, ie, FillResult(index, resultObject), I get the error message (In Firefox 3.6.X) "Invalid argument conversion from class boost::shared_ptr<class FB::JSObject> to class NLResultAPI at index 2". Any ideas/suggestions?
taxilian 12:09 VictorAbrash: shorter messages; it was cut off after "in my JS application using the"
VictorAbrash 12:09 OK, will try again...
I'm trying to support multiple mimetypes in my plugin. I've modified my PluginConfig.make file to create multiple values for some keys, modified my factory createPlugin() method to send the mimetype to my main PluginCore object, and my createJSAPI() method to return either my main object or the helper object based on the mimetype.
All that seems to work, and I can create both kinds of object in my JS application using the OBJECT tag. I can even call the methods in my helper object.
However, if I try to use my new helper object as a parameter to a different object, ie, FillResult(index, resultObject), I get the error message (In Firefox 3.6.X)
"Invalid argument conversion from class boost::shared_ptr<class FB::JSObject> to class NLResultAPI at index 2". Any ideas/suggestions?
taxilian 12:09 what is the signature of the function you're trying to call?
VictorAbrash 12:09 void GetNLResult(int index, const NLResultAPIPtr& inputNLResultApi)
BTW, if I call MainObject.NewNLResult() in JS, I can pass that back to the GetNLResult() function and it works fine.
taxilian 12:09 hmm. pastebin me some larger pieces of code, please; the javascript function you're using and the relevant pieces of your jsapi code
.pb
FireBreathBot 12:09 When you need to share code, logs, or anything else longer than a couple of lines, use a pastebin. http://fpaste.org, https://pzt.me/, and https://gist.github.com are all good options
kylehuff 12:09 (I haven't gotten lost, just compiling the examples -- this windows PC is virtual on an already small amount of RAM, so, it is taking a while)
taxilian 12:09 no problem
VictorAbrash 12:09 OK, paste #131634 at fpaste.org.
taxilian 12:09 full url?
VictorAbrash 12:09 http://fpaste.org/sqLf (I think, not a great interface)
taxilian 12:09 that works
gimme a few, trying to figure out what you're doing
oh, I see; your problem is that you can't pass in the object from the dom element but you can the return value of an object
VictorAbrash: that's actually because the DOM object is not really the same thing as the root JSAPI object; there are some subtle but important differences
long story short, what you're trying to do won't work, but you could probably do a workaround
just add a property called "self" or something similar that returns shared_from_this() as a FB::JSAPIPtr and instead of passing in nlResult pass in nlResult.self
should work
kylehuff: I'm going to go get some lunch; be back in prolly 30-45 min
VictorAbrash 12:09 I'll try that and let you know.
kylehuff 12:09 roger that; I might still be compiling by then... lol
VictorAbrash 13:09 Taxilian, that didn't work. See http://fpaste.org/dGwM/
(BTW, I get the same error. Perhaps my self function isn't returning correct thing? Still seems to be a DOM object that can't be used as input to other functions.
kylehuff 13:09 okay taxilian; I have the environment setup; Safari 5.1, FBTestPlugin compiled from master, and I can confirm the result of the bug 128. Exact same result on windows XP SP 3. ready to debug when you are
taxilian 13:09 kylehuff: I'm back
kylehuff 13:09 cool; I think I am ready
taxilian 13:09 okay; so the first thing to do is to see if you can reproduce the issue
build FBTestPlugin and see if it has the same failures when running test.html
kylehuff 13:09 I did test that, and yes, the result is the same.
taxilian 13:09 okay; weird
let me think for a moment
!findfile NPJavascriptObject
FireBreathBot 13:09 Found 3 matching file(s) in the master branch. First 3 are:
src/NpapiCore/NPJavascriptObject.cpp http://goo.gl/XgUBq
src/NpapiCore/NPJavascriptObject.h http://goo.gl/ZMej2
tests/NpapiCoreTest/NPJavascriptObjectTest.h http://goo.gl/X5flT
taxilian 13:09 kylehuff: Set a breakpoint in the NPO_addEventListener::exec function in NPJavascriptObject.cpp and see if it ever gets hit
kylehuff 14:09 ok, standby
VictorAbrash 14:09 My browser got locked up... was there any reply to my last question?
taxilian 15:09 you won't be able to cast a DOM object back to a JSAPI object, that's definite
using .self should give you a JSAPI object which would be easier to cast back, however
so I don't know why that wouldn't work
assuming .self returns the correct JSAPIPtr
VictorAbrash 15:09 Yes, that is a good question, since I'm not an expert on shared_ptr stuff.
taxilian 15:09 it's not significantly different from a normal pointer
VictorAbrash 15:09 Should it just be FB::JSAPIPtr get_self() { return shared_from_this(); }, or do I need more magic?
taxilian 15:09 that should work
and you registered that as a property?
FireBreath is usually pretty good at doing all the magic for you
VictorAbrash 15:09 Yes, i registered that as a property, and in firebug at least it appears to return an object of the correct type.
taxilian 15:09 well, try accepting it as a const FB::variant& and then cast it to the JSAPI type you want (in a shared_ptr, of course) using convert_cast<type>
then use a debugger and step through what is happening with that cast
it may give you some clues
kylehuff 15:09 I'm still trying to get VS Express to let me debug this damn plugin...
taxilian 15:09 hmm. VS Express is not the most helpful of tools, sometimes
if it's being that much of a pain dont' feel like you have to do it. At least one day this week (rpobably thursday) I'm going to try to spend on FireBreath
kylehuff 15:09 yet, I think it consumes twice the memory from standard...
taxilian 15:09 heh
ooh… and the real fun thing is that if it's like on Mac, you may not be able to debug very well
just remembered
kylehuff 15:09 oh?
taxilian 15:09 on mac if it doesn't hear back from the plugin w/in a few seconds it assumes it has hung and kills the plugin
so if you attach a debugger, once it hits a breakpoint if you don't let it run again really soon it'll just kill your process
kylehuff 15:09 lol
taxilian 15:09 haven't tried on windows, but that's what it does on Mac
kylehuff 15:09 fun, well, I just figured out half my problem... you need to enable "expert" mode...
taxilian 15:09 ...
are you serious?
kylehuff 15:09 yes.. the option to attach to a process is only if you enable expert mode.......
taxilian 15:09 that sounds like one of those old dos jokes, like "Hidden DOS secret: insert 'bugs=off' in your config.sys file"
kylehuff 15:09 because you know, you aren't automatically an expert when you are setting freaking breakpoints in source-code...
linearray 15:09 hehe it seems like VS Express is marketed towards people, who've never programmed before
to get them hooked
taxilian 15:09 or something
that's just astounding to me
kylehuff 15:09 well, from my understanding, the breakpoint was never reached...
taxilian 15:09 set some other breakpoints to make sure you're able to catch any of them
kylehuff 15:09 good idea, beacuse I'm not even sure if this is working.
is Safari.exe even the correct process to attach to?
taxilian 15:09 most likely not
probably will be something like PluginHost.exe or some such
kylehuff 15:09 hmm.. nothing like that.. the only 2 safari related process I see are Safari.exe and WebKit2ebProcess.exe
taxilian 15:09 try the webkit2eb thingy then
kylehuff 15:09 there we go
taxilian 15:09 =]
kylehuff 15:09 okay, so it made it to the breakpoint
taxilian 15:09 hmm. well, that's good news; step trhough, is the JSObject pointer valid
?
VictorAbrash 15:09 Sorry, got any suggestions for coding the convert_cast?
taxilian 15:09 VictorAbrash: I'm not sure what you mean
you could do something like varval.convert_cast<NLResultAPIPtr>()
it's just a call on FB::variant
kigero 15:09 hopefully a quick question: in the projectDef.cmake on the mac, I'm trying to add a post build step to operate on my plugin binary - how would I get the path to the fbbuilddir/projects/myPlugin/Debug/myPlugin.plugin/Contents/MacOS/myPlugin file? I can get to fbbuilddir/projects/myPlugin with CMAKE_CURRENT_BINARY_DIR, is there something that points directly to that file?
taxilian 15:09 ${CMAKE_CFG_INTDIR} will be converted to a variable that gets resolved to Debug or Release
alternately, you can probably do something like:
get_target_property(LIBDIR ${PROJNAME} LIBRARY_OUTPUT_DIRECTORY)
get_target_property(ONAME ${PROJNAME} OUTPUT_NAME)
set(_PLUGFILENAME "${LIBDIR}/${CMAKE_CFG_INTDIR}/${ONAME}.plugin")
where ${PROJNAME} is the name of the project
(that is taken from Win.cmake where it does something similar)
kigero 15:09 I think something like that will work nicely - thanks!
linearray 15:09 thanks to the new confluence I get emails of kylehuff with an eyepatch
taxilian 15:09 lol
kylehuff 15:09 sweet
linearray 15:09 that was definitely worth it
:D
kylehuff 15:09 as far as I can tell taxilian, it is valid. (caveat: as you probably noticed, I mostly I have no idea what I am doing)
taxilian 15:09 is the event name coming through correctly?
VictorAbrash 15:09 OK, that compiled... basically as I step through the convert_cast, get_type() returns that the object is a JSObject.
So my self property, that returns shared_from_this(), is somehow being converted from a JSAPIPtr to a JSObject?
taxilian 15:09 not at all
any javascript object that comes in from the page is a JSObject
which on firefox is actually a NPObjectAPI and on IE a IDispatchAPI object
however, convert_cast should be able to pull it out of that and get at the underlying JSAPI object
VictorAbrash 15:09 Strange though, that if I create the object using mainObject.NewNLResult(), then I can pass it into my function
kylehuff 15:09 well, I can see that "args" is an array of 3 items, each item containing a table. I don't see how to see the contents/value of the item(s) though
VictorAbrash 15:09 and it works, but not if I create the object using the <OBJECT> tag.
taxilian 15:09 kylehuff: you'll have to step through until it pulls the value out
and then look at the variable it assigns it to
VictorAbrash: that's why you have to use the value that comes from the .self property, not the object tag
VictorAbrash 16:09 Yes, I'm doing that.
Fails on "FB::JSAPIPtr inner = jso->getJSAPI();" in JSObject.h
taxilian 16:09 hmm. did you try stepping into that function to see what is happening?
what browser are you on?
kylehuff 16:09 taxilian: the event name (evtname) looks like "onfired"
taxilian 16:09 okay… that sounds right. hmm
I wonder if somehow Safari is clobbering our delegate function
I'll have to look at it myself, I guess; you could keep digging, but it gets a little weird in places from here
lol
VictorAbrash 16:09 Sorry, it actually goes through that line but can't go through the ptr_cast<T>, so throws a bad_variant_cast. I'm using Firefox 3.6, but other browsers don't work either for this.
taxilian 16:09 hmm. strange
I don't know
if you can reproduce it in a sample plugin that you can send me I'll take a look at it
kylehuff 16:09 taxilian - I'll leave the environment and debugger as it is, if you think of something you want me to test/look at with an untrained eye, just let me know.
VictorAbrash 16:09 Yeah. Unless you have any bright ideas, I'm going to give it up for now. I'll try to extend the sample plugin for multiple mime types, to pay you back for your help today.
(They're setup, but not used). And I can try to write up a short blurb you can use for documentation.
I've spent too much time on a nice to have, rather than a must have... oh well.
taxilian 16:09 yeah :-/ if you can get an example that can be shared with others, I'll try to figure out why it doesn't work
VictorAbrash 16:09 Just to warn you, I have one more issue I'll get back to you with later this week, need to make the asynchronous events more responsive....
Thanks for all your time.