Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
Line 18: | Line 18: | ||
= Current Proposal = | = Current Proposal = | ||
The current proposal | The current proposal adds two new methods for registering and unregistering blocks of memory. | ||
<pre> | <pre> | ||
NPError NPN_ErrorReportingRegisterMemoryBlock( | NPError NPN_ErrorReportingRegisterMemoryBlock(const char* key, | ||
const char* key, | unit flags, | ||
unit flags, | void* pMemBlock, | ||
void* pMemBlock, | size_t sizeOfMemBlock); | ||
size_t sizeOfMemBlock); | </pre> | ||
Parameters: | Parameters: | ||
Return | * <code>key</code>: unique string identifying the memory block | ||
* NPERR_OUT_OF_MEMORY_ERROR | * <code>flags</code>: | ||
* NPERR_INVALID_PARAM | ** <code>NPMEM_CHARACTER_DATA</code>: the data is character data which can be presented as UTF8/ASCII data | ||
* NPERR_NO_ERROR | ** <code>NPMEM_NOT_PERSONAL</code>: the data is guaranteed to not contain any personally identifying information such as URLs, cookie data, etc | ||
* <code>pMemBlock</code>: The starting address of the memory block | |||
* <code>sizeOfMemBlock</code>: The size of the memory block in bytes | |||
Return value: | |||
* <code>NPERR_OUT_OF_MEMORY_ERROR</code>: If the memory size exceeds the maximum size allowed | |||
* <code>NPERR_INVALID_PARAM</code>: If the registration fails | |||
* <code>NPERR_NO_ERROR</code>: If successful | |||
If the API is called with same key that was registered earlier, then API call with succeed and call will override the old pointer and length values. The plugin can attempt to register multiple memory blocks. | |||
Calling <code>NPN_GetValue</code> with new key <code>NPNVmaxCrashMemoryBlockSize</code> can be used to get the maximum block size that could be registered. | |||
block size that could be registered | |||
<pre> | <pre> | ||
NPError NPN_ErrorReportingUnregisterMemoryBlock(const char* key); | NPError NPN_ErrorReportingUnregisterMemoryBlock(const char* key); | ||
</pre> | |||
Parameters: | Parameters: | ||
* key - key value which was used to register the memory block | * key - key value which was used to register the memory block | ||
Return | Return value: | ||
* NPERR_INVALID_PARAM - If un registration fails | * NPERR_INVALID_PARAM - If un registration fails | ||
* NPERR_NO_ERROR - If un resgitation succeeds | * NPERR_NO_ERROR - If un resgitation succeeds | ||
== Open Issues == | == Open Issues == | ||
* We need to check with browser vendor crash reporting teams to make sure we can handle arbitrary blocks of memory. Right now, for example, I think Mozilla is only set up to handle string annotations and I'm not sure what additional challenges random memory will pose. | * We need to check with browser vendor crash reporting teams to make sure we can handle arbitrary blocks of memory. Right now, for example, I think Mozilla is only set up to handle string annotations and I'm not sure what additional challenges random memory will pose. | ||
* Does <code>NPNVmaxCrashMemoryBlockSize</code> give the maximum size for a single registered block or all registered blocks? |