[Webkit-unassigned] [Bug 34539] Implement NPN_GetValueForURL and NPN_SetValueForURL and provide a stub for NPN_GetAuthenticationInfo

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 10 09:47:42 PDT 2010


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





--- Comment #46 from Dawit A. <adawit at kde.org>  2010-09-10 09:47:42 PST ---
(In reply to comment #45)
> (From update of attachment 66374 [details])
> This page is rather interesting: https://developer.mozilla.org/en/NPN_GetValueForURL
> 
> About the "value" argument:
> "Out parameter. The browser passes back the requested information. If the function succeeds, the result buffer will be allocated with NPN_MemAlloc; the plugin is responsible for freeing the buffer. Note: the value may have internal NULL bytes and may not be NULL-terminated."
> 
> I think we should be nice and null-terminate the returned value, it won't hurt and will shield against broken plugins.
> 
> > +                *value = static_cast<char*>(NPN_MemAlloc(cookieStr.length()));
> 
> Allocate cookieStr.length() + 1 bytes.
> 
> > +                    strncpy(*value, cookieStr.data(), cookieStr.length());
> 
> Use memcpy() instead of strncpy(). (And cookieStr.length() + 1.)
> 
> The above two comments apply to all cases where you're NPN_MemAlloc()ing a char buffer and copying something to it.

I have already changed this locally and is waiting to be committed once I figure out on how to add a test coverage for it.

> > +        LOG(Plugins, "PluginView::getValueForURL(%s): Need to implement PluginView::platformGetValueForURL!", prettyNameForNPNURLVariable(variable).data());
> > ...
> > +        LOG(Plugins, "PluginView::getValueForURL: %s", prettyNameForNPNURLVariable(variable).data());
> 
> Nit: inconsistent formatting, second case should be something like:
> LOG(Plugins, "PluginView::getValueForURL(%s): Unhandled variable", prettyNameForNPNURLVariable(variable).data());

This was done because of your own feedback in comment #36. If it's changed to what you are suggesting here, it would read:

"PluginView::getValueForURL(Unknown variable): Unhandled variable"

which is not much different than it was before comment #36. Instead it should correctly, as pointed out by yourself in comment #36, read:

"PluginView::getValueForURL: Unknown variable"

> r- because of lack of test, that's the important missing piece.

Still trying to figure that out... No clue when that will happen ; so this patch will have to sit and wait until I figure that out or someone else with better understanding of how the test coverages work provides one for it...

-- 
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