[Webkit-unassigned] [Bug 72484] [v8] Exception thrown in npObjectInvokeImpl may overwrite the exception message thrown by NPN_SetException

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 25 19:48:27 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=72484





--- Comment #5 from Hongbo Min <hongbo.min at intel.com>  2011-11-25 19:48:27 PST ---
Steve, thanks for your reviewing.

The updated patch has been attached again.

It is actually not a standard technique for solving such an issue, but it is the most reasonable and simplest solution, no need to change NPAPI interface.

Suppose the situation when invoking a native method implemented in NPAPI plugin, setexception may be called to throw an exception message to indicate there is something wrong happend in the process of method execution. However, there is no way to tell V8 engine that there is already an exception message thrown.

This solution is to reuse the NPVariant result that stores the result of method execution. If the method fails to execute, the NPVariant result serves as a inidcator to tell v8 engine some error occurs. It provides a chance to native method writter to throw their own exception message instead of generic message by setting NPVariant result as an boolean type and true value. Patch for http://codereview.chromium.org/8576001/ is a typical usage.

The same issue also exists in JavascriptCore engine. I will fire another bug to track it.

(In reply to comment #3)
> (From update of attachment 115502 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=115502&action=review
> 
> > Source/WebCore/ChangeLog:2
> > +        Generic exception message thrown by npObjectInvokeImpl may overwrite
> 
> ChangeLog description should start with bug title and URL. See http://www.webkit.org/coding/contributing.html#changelogs
> 
> > Source/WebCore/ChangeLog:15
> > +        No new tests. (OOPS!)
> 
> Need to provide tests or explain why none are possible.
> 
> > Source/WebCore/bindings/v8/V8NPObject.cpp:136
> > +        // the result has a boolean type and its value should be true, so the
> 
> Is this a standard technique? If so, can you point to some documentation? Or is it just a Chromium-specific work-around?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list