Commit Graph

211 Commits

Author SHA1 Message Date
David Benjamin 0209a6814c Report browser and plugin hooks as NULL when not provided
Fixes bug #7.
2011-04-27 10:58:08 -04:00
David Benjamin a8017830ef Add header file to iteration over browser and plugin functions
Saves a bit of effort, and simplifies capability passing. We lose the
npruntime logic, but we may as well unconditionally initialize the
bridge. It's cheap and every browser should have it by now.
2011-04-27 10:06:42 -04:00
David Benjamin eab4684a2f Fix comment typo 2011-04-26 14:26:09 -04:00
David Benjamin fd8fd73ac0 nspluginwrapper 1.3.2 2011-04-23 14:47:21 -04:00
David Benjamin 857234e5f1 Revert "Decrease the RPC message timeout from 30 seconds to 10"
This reverts commit 1b259a8119. If you
call a function from Flash that ends up opening an alert, the call
blocks until the user closes the alert, and the call eventually times
out. A 30 second timeout isn't much better, but is harder to trigger
accidentally, whereas it's not difficult to trigger a 10 second timeout
on accident.

See bug #24.
2011-04-23 14:28:00 -04:00
David Benjamin 189a5244a3 Add an explicit npobject_is_proxy check
For obnoxious reasons, NPN_CreateObject needs to know if an object is a
proxy before its proxy fields have been initialized. We can't assume
proxy_id == 0 means not a proxy. Valgrind gets upset.
2011-04-23 13:57:45 -04:00
David Benjamin 30021085d3 Release received NPObjects in npruntime handler functions
Missed a few spots there.
2011-04-22 22:57:06 -04:00
David Benjamin 0bdca9b126 Add more debug statements in npobject_destroy_stub
In case it fails in the middle or something.
2011-04-22 22:55:01 -04:00
David Benjamin cc47a00292 Don't check gtk_plug_new and gtk_socket_new for NULL
Neither can actually return NULL.
2011-04-21 19:21:47 -04:00
David Benjamin 31dcc57f69 Use NPN_ReallocData to reallocate NPPVformValue and Enumerate output
Saves a little bit of code. Also some of the enumerate code was bogus.
Also actually reallocate NPClass::Enumerate array. Oops, must have
missed that one.
2011-04-21 16:37:16 -04:00
David Benjamin e9aeade7cd Don't leak the NPN_SetException string
What's this about? Both Firefox and Chrome make a copy of it. (In fact,
Firefox apparently doesn't implement it for their out-of-process plugin
code. But their old codepath handles it fine.
2011-04-21 16:06:27 -04:00
David Benjamin 63f8937736 Incorporate the release number into NPW_PLUGIN_IDENT
As long as distributions actually remember to increment this value, they
won't keep missing updates.
2011-04-21 14:23:54 -04:00
David Benjamin 1ed587a95a Let's not use a deprecated function when checking for usable glib
Though it really doesn't matter.
2011-04-21 12:35:33 -04:00
David Benjamin 30df6a2f17 Drop archive-building Makefile targets
Last I tried, they didn't work. More importantly, I don't want to
maintain another list of files. That's what version control is for.
2011-04-21 09:35:03 -04:00
David Benjamin 115f33499e Rename the ChangeLog file so it's visible not current 2011-04-21 09:32:27 -04:00
David Benjamin 6e950dc11e Drop changelog records from the Makefile
I'm not going to maintain that, and this isn't in svn anymore.
2011-04-21 09:30:57 -04:00
David Benjamin 8104fc2afa Don't recompute VERSION, RELEASE, etc. in the Makefile
We already have one nasty set of shell commands. Let's not make it two.
2011-04-21 09:23:11 -04:00
David Benjamin 698e8d0c12 Hide some accidentally exposed symbols
Now we're back to exporting the bare minimum.
2011-04-20 22:59:30 -04:00
David Benjamin fd133c39a1 Allow NPN_CreateObject to run with a NULL instance
It's probably not a bad idea, and you'll crash Firefox, but let's not
crash it on our end.
2011-04-20 22:56:39 -04:00
David Benjamin 82851c108b Don't reserve the topmost bit in NPObject ids
We explicitly advertise the type, so client and server each get distinct
id spaces.
2011-04-20 21:01:48 -04:00
David Benjamin 6947ea103e Remove some spurious debug statements 2011-04-20 20:57:48 -04:00
David Benjamin cfd90e9ce4 When a NPObjectProxy is forcible invalidated, release the stub
It is of no use anymore, and later code will refuse to communicate with
the stub. It's easier to just free it now directly.
2011-04-20 20:52:37 -04:00
David Benjamin b8aa5a06fb Another massive commit
Maintain and send the owning NPP for every viewer-owned NPObject. Use
this as the NPP when creating proxy objects. Also send an explicit
NPObject type so we don't infer which side owns it from our
dictionaries.

This fixes the Firefox thing properly.
2011-04-20 20:52:37 -04:00
David Benjamin 8bd6c24884 Only compile npruntime_deactivate in the browser 2011-04-20 20:52:37 -04:00
David Benjamin 5f01909fec Go back to calling NPN_CreateObject
We'll later properly fix this under Firefox so that we pass the real NPP
to NPN_CreateObject.
2011-04-20 20:52:14 -04:00
David Benjamin 21480208af Don't invalidate the plugin-side object on proxy invalidate
Just invalidate the proxy. We'll invalidate the viewer-side NPObjects
later.
2011-04-20 14:11:00 -04:00
David Benjamin 9f47596137 Remove delayed calls machinery
It is no longer necessary.
2011-04-20 12:04:13 -04:00
David Benjamin b381a9e811 Disallow RPC calls after rpc_method_send_reply
With NPObject pass-ref sending, there is no need for it.
2011-04-20 12:01:19 -04:00
David Benjamin b96edf97d9 Remove proxy entry from hash table always
Otherwise it looked like we were leaking proxies when we really weren't.
2011-04-20 11:55:44 -04:00
David Benjamin e1c01801fb Don't use NPN_CreateObject to make proxies
Firefox crashes when you give it a NULL npp. Simulate it instead.

NOTE: That may cause some problems, looking at the source. We'd best
avoid it.
2011-04-20 11:51:02 -04:00
David Benjamin e471accc81 Use the pass-ref variants in all return values
Delayed calls should no longer be needed.
2011-04-20 11:46:15 -04:00
David Benjamin 3a76b975b7 Move an input NPN_ReleaseVariantValue before rpc_send_reply
Missed one.
2011-04-20 11:22:35 -04:00
David Benjamin 3791e265ab Implement pass-ref semantics for NPObject and NPVariant
This will allow us to get rid of delayed NPN_ReleaseObject.
2011-04-20 11:15:08 -04:00
David Benjamin 94593ff660 Handle NPObject lifetime better
All received NPObjects must be released, either directly or by releasing
the NPVariant. Verified that visiting and leaving pages on YouTube and
Hulu do not leak stubs and proxies.
2011-04-20 02:05:18 -04:00
David Benjamin bd167dc2d3 First iteration of completely rewritten NPObject marshalling code
Most of the credit goes to Chromium as this is the exact same design.
The main advantage is that we should no longer be leaking NPObject stubs
left and right.
2011-04-20 01:47:55 -04:00
David Benjamin 60638fff52 Fix a typo 2011-04-20 01:27:08 -04:00
David Benjamin f8c295a480 Don't export npobject_info_destroy
No one outside npruntime.c calls it.
2011-04-19 22:26:52 -04:00
David Benjamin 2c301b1cfa Move NPClass::* method descriptor registration into a helper function
Let's cut down drastically on the interface of npruntime-impl.h.
2011-04-19 22:24:49 -04:00
David Benjamin 3a9056b07d Release argument NPVariants before sending result
Now the only releases that need be delayed are results.
2011-04-19 21:23:48 -04:00
David Benjamin f9f3c1d093 Document the delayed call mess
Now that I've finally figured out what it's for, make a comment. Also,
EWWWWW!
2011-04-19 13:55:41 -04:00
David Benjamin e20d7c9194 Merge branch 'sync-event' 2011-04-19 13:55:38 -04:00
David Benjamin 00534b2b7c Pull in NPAPI SDK changes for DOM cursor control
Also update our code to support this variable and the change in
capitalization of NPPVsupportsAdvancedKeyHandling. No NPAPI version bump
or additional hooks are required to support DOM cursor control.
2011-04-19 12:33:35 -04:00
David Benjamin d64e9756d4 Revert "Delay calls to NPP_Destroy when the plugin instance is on the stack"
This reverts commit 1fc19f41e6. With the
two processes kept mutually exclusive, a delayed NPP_Destroy is no
longer necessary. In fact, it doesn't actually work because returning
from NPP_Destroy (to the browser) allows it to release X11 resources
that the plugin holds on to. See bug #20.
2011-04-18 18:52:47 -04:00
David Benjamin 761718d317 Add a different giant comment to explain synchronization
This should be more accurate.
2011-04-18 18:40:49 -04:00
David Benjamin d68d19dd3b Trim some of the extra debug messages 2011-04-18 18:32:11 -04:00
David Benjamin bb8d605a5c The sync mechanism is no longer related to depth
Store a boolean. Also, we can make it the caller's responsibility to not
sync/end_sync inappropriately.
2011-04-18 18:32:11 -04:00
David Benjamin f448a38e77 And, finally, incorporate the SYNC code into the main loop
Surround dispatches with a SYNC/SYNC_END pair, but only if the dispatch
does anything. check and prepare hooks do not get run synchronized for
efficiency. We assume plugins do not violate the GSource API and, say,
modify X objects in those hooks.
2011-04-18 18:32:11 -04:00
David Benjamin 5e867129b1 Drive even more of the glib event loop ourselves 2011-04-18 18:32:11 -04:00
David Benjamin 4be9580ae6 Drive the event loop ourselves 2011-04-18 18:32:11 -04:00
David Benjamin 6cb51fd453 Add strings for NPP_ClearSiteData error codes 2011-04-16 13:20:39 -04:00