mozilla
검색 결과

    NPSavedData

    아직 자원 봉사자들이 한국어로 현재 문서를 번역하지 않았습니다. 가입해서 이 문서가 번역되는 일에 함께 해 주세요!

    « Gecko Plugin API Reference « Plug-in Side Plug-in API

    Summary

    Block of instance information saved after the plug-in instance is deleted; can be returned to the plug-in to restore the data in future instances of the plug-in.

    Syntax

    typedef struct _NPSavedData
    {
        int32  len;
        void*  buf;
    } NPSavedData;
    

    Fields

    The data structure has the following fields:

    len
    Length in bytes of the buffer pointed to by buf; set by the plug-in.
    buf
    Pointer to a memory buffer allocated by the plug-in with NPN_MemAlloc(). Can be any reasonable size; its contents are private to the plug-in and are not modified by the browser.

    Description

    The NPSavedData object contains a block of per-instance information that the browser saves after the instance is deleted. This information can be returned to another instance of the same plug-in if the user returns to the web page that contains it.

    You can use the plug-in's NPP_Destroy() function to allocate an NPSavedData object using the NPN_MemAlloc() function, fill in the fields, and return it to the browser as an output parameter. See Instance Destruction for a code example that shows how to use NPSavedData.

    If the user revisits a web page that contains a plug-in, the browser returns the NPSavedData to the new instance of the plug-in in a call to NPP_New(). After this, the plug-in is responsible for keeping or deleting the objects as necessary.

    See also

    문서 태그 및 공헌자

    태그: 
    Contributors to this page: Pmash, jgriffin, Sheppy
    최종 변경: Sheppy,