Page tree
Skip to end of metadata
Go to start of metadata

public void FB::JSAPI::pushZone ( const SecurityZone securityLevel)

Pushes a new security level and locks a mutex (for every Push there must be a Pop!)

This should be used to temporarily set the security zone of the API object. Note that this also locks a mutex to ensure that access to members under a non-default security level is serialized. Do not ever leave an unmatched push (a push with no pop after it). For safety, use the helper FB::scoped_zonelock:

// In the constructor
// Register protected members
FB::scoped_zonelock _l(this, SecurityScope_Protected);
registerMethod("start", make_method(this, &MyPluginAPI::start));
} // Zone automatically popped off
// Register private members
FB::scoped_zonelock _l(this, SecurityScope_Protected);
registerMethod("getDirectoryListing", make_method(this, &MyPluginAPI::getDirectoryListing));
} // Zone automatically popped off
securityLevelconst SecurityZone & Zone id to push on the stack
See Also

Reimplemented in FB::JSAPIImpl.

Definition at line 118 of file JSAPI.h.

118 { }
  • No labels