Bug 36337 - Log an error when an OOP plug-in sends an unknown object id
Summary: Log an error when an OOP plug-in sends an unknown object id
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P4 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-18 17:11 PDT by Alexey Proskuryakov
Modified: 2010-03-19 11:20 PDT (History)
0 users

See Also:


Attachments
proposed patch (6.86 KB, patch)
2010-03-18 17:14 PDT, Alexey Proskuryakov
darin: review-
Details | Formatted Diff | Diff
proposed patch (7.00 KB, patch)
2010-03-18 17:30 PDT, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2010-03-18 17:11:28 PDT
This can only happen due to an error in WK/WKPH communication code. We already have early return for those, but debug output would make investigating problems easier.
Comment 1 Alexey Proskuryakov 2010-03-18 17:14:25 PDT
Created attachment 51112 [details]
proposed patch
Comment 2 Darin Adler 2010-03-18 17:15:44 PDT
Comment on attachment 51112 [details]
proposed patch

> +        LOG_ERROR("NetscapePluginInstanceProxy::evaluate: local object %u doesn't exist.");

You used "%u" but forgot to pass a number. Every time!
Comment 3 Alexey Proskuryakov 2010-03-18 17:30:33 PDT
Created attachment 51115 [details]
proposed patch

Note to self: don't build and test in 32 bit when changing OOP code.
Comment 4 Darin Adler 2010-03-18 17:41:17 PDT
Comment on attachment 51115 [details]
proposed patch

> +        LOG_ERROR("NetscapePluginInstanceProxy::evaluate: local object %u doesn't exist.", objectID);

To be pedantic, %u is for printing values of type unsigned. Since objectID is of type uint32_t the correct format string is:

    ... object " PRIu32 " doesn't ...

Of course, I'm not really sure that uint32_t is better than unsigned here. And this can probably land as-is, but it's an example of why I think types like uint32_t aren't all that great as abstractions.

r=me
Comment 5 Alexey Proskuryakov 2010-03-19 11:20:18 PDT
Committed revision 56247.

If I'm not mistaken, PRIu32 would only be necessary for 16-bit platforms, so landed as is.