gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [patch #8916] Patch to make libgnashplugin return real Ja


From: Nutchanon Wetchasit
Subject: [Gnash-commit] [patch #8916] Patch to make libgnashplugin return real JavaScript object from ExternalInterface callback
Date: Mon, 22 Feb 2016 13:57:21 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:25.8) Gecko/20151123 Firefox/31.9 PaleMoon/25.8.1

URL:
  <http://savannah.gnu.org/patch/?8916>

                 Summary: Patch to make libgnashplugin return real JavaScript
object from ExternalInterface callback
                 Project: Gnash - The GNU Flash player
            Submitted by: nachanon
            Submitted on: Mon 22 Feb 2016 08:57:20 PM ICT
                Category: plugin
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Current NPAPI libgnashplugin code returns a custom-allocated `NPObject`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/plugin/npapi/external.cpp?id=c12c3cf104a095cff9791cdb3cee8bbf4853d5e0#n334>
to browser when it receives Object-typed or Array-typed return value from
player-side ExternalInterface callback.

Doing this resulting in object's members not being set correctly
(`NPN_SetProperty()`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/plugin/npapi/external.cpp?id=c12c3cf104a095cff9791cdb3cee8bbf4853d5e0#n342>
returned false), JavaScript seen the object
as type `function`, and the plugin container *crashed*
<https://savannah.gnu.org/bugs/?32411#comment13> after it
received such `NPObject` instance.

The attached `0001_make-libgnashplugin-return-real-js-object.patch` does
following things:
* Drop the custom `NPObject` allocation in `ExternalInterface::parseXML()`.
* Make `ExternalInterface::parseXML()` call container's `window.Object()`
method to construct a JavaScript-authentic `Object`.
* Change `NPP nppinstance` field in `GnashPluginScriptObject` to public,
allowing `ExternalInterface::parseXML()` to access it.
* Change various functions which call `ExternalInterface::parseXML()`, to make
them pass `GnashPluginScriptObject` along.
* Implement `NPN_GetValue()` and `NPN_Invoke()` stub in standalone tester.
* Comment out existing `<object>` parsing test
<http://git.savannah.gnu.org/cgit/gnash.git/tree/plugin/npapi/test.cpp?id=c12c3cf104a095cff9791cdb3cee8bbf4853d5e0#n244>
as `GnashPluginScriptObject` and container's `window` object are not available
in testing environment.

This fixes the crash and single-depth Object member unmarshalling in
JavaScript-calls-Flash ExternalInterface return value, partially fixing
bug #32411, while allowing unrelated tests in plugin's standalone tester
to continue working.

This patch needs review since I'm new to Netscape Plugin API framework
and its NPRuntime extension, and I'm not sure if there's a nicer way to
implement this (especially the way that `NPP` instance got passed around).

Gnash: 0.8.11dev (patched against git c12c3cf 22-Feb-2016) NPAPI
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 22 Feb 2016 08:57:20 PM ICT  Name:
0001_make-libgnashplugin-return-real-js-object.patch  Size: 20kB   By:
nachanon
Patch for making NPAPI libgnashplugin return real JavaScript Object for
ExternalInterface object return value
<http://savannah.gnu.org/patch/download.php?file_id=36423>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8916>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]