{{+bindTo:partials.standard_nacl_article}}
| int32_t(* | Map )(PP_Instance instance, PP_Resource file_io, int64_t length, uint32_t map_protection, uint32_t map_flags, int64_t offset, void **address, struct PP_CompletionCallback callback) |
| int32_t(* | Unmap )(PP_Instance instance, const void *address, int64_t length, struct PP_CompletionCallback callback) |
| int64_t(* | GetMapPageSize )(PP_Instance instance) |
PPB_FileMapping contains functions for mapping and unmapping files into and out of memory.
| int64_t(* PPB_FileMapping::GetMapPageSize)(PP_Instance instance) |
GetMapPageSize() retrieves the size of pages that Map() uses.
| [in] | instance | A PP_Instance identifying the instance. |
| int32_t(* PPB_FileMapping::Map)(PP_Instance instance, PP_Resource file_io, int64_t length, uint32_t map_protection, uint32_t map_flags, int64_t offset, void **address, struct PP_CompletionCallback callback) |
Map() maps the contents from an offset of the file into memory.
| [in] | instance | A PP_Instance identifying one instance of a module. |
| [in] | file_io | A PPB_FileIO PP_Resource corresponding to the file that should be mapped in to memory. |
| [in] | length | The number of bytes to map. |
| [in] | map_protection | A bitfield containing values from PP_FileMapProtection, indicating what memory operations should be permitted on the mapped region. |
| [in] | map_flags | A bitfield containing values from PP_FileMapFlags, providing options for the behavior of Map. If the region is to be writeable, then exactly one of PP_FILEMAPFLAG_SHARED or PP_FILEMAPFLAG_PRIVATE must be set. |
| [in] | offset | The offset into the file. Must be a multiple of the Map page size as returned by GetMapPageSize(). |
| inout] | address The value of *address, if non-NULL, will be used as a hint to determine where in memory the file should be mapped. If the value is NULL, the host operating system will choose address. Upon Map() completing, *address will contain the actual memory location at which the file was mapped. If the plugin provides a non-NULL *address, it must be a multiple of the map page size as returned by GetMapPageSize(). | |
| [in] | callback | A PP_CompletionCallback to be called upon completion of Map(). |
pp_errors.h. | int32_t(* PPB_FileMapping::Unmap)(PP_Instance instance, const void *address, int64_t length, struct PP_CompletionCallback callback) |
Unmap() deletes the mapping of the specified address.
The specified address must have been retrieved with Map().
| [in] | instance | A PP_Instance identifying the instance. |
| [in] | address | The starting address of the address in memory to be unmapped. |
| [in] | length | The length of the region to unmap. |
| [in] | callback | A PP_CompletionCallback to be called upon completion of Unmap(). |
pp_errors.h.