Bug 36337

Summary: Log an error when an OOP plug-in sends an unknown object id
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Plug-insAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P4    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
proposed patch
darin: review-
proposed patch darin: review+

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.