FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
FB::scoped_zonelock Class Reference

Provides a helper class for locking. More...

#include "JSAPI.h"

Inherits noncopyable.

Public Member Functions

 scoped_zonelock (const JSAPIPtr &api, const SecurityZone &zone)
 Accepts a FB::JSAPIPtr and pushes the specified security zone to be used until this object goes out of scope. More...
 
 scoped_zonelock (JSAPI *api, const SecurityZone &zone)
 
 ~scoped_zonelock ()
 Unlocks/pops the zone. More...
 

Detailed Description

Provides a helper class for locking.

This class will call pushZone on the provided JSAPI object when instantiated and popZone when it goes out of scope.

// 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
Since
1.4a3
See Also
FB::JSAPI::pushZone
FB::JSAPI::popZone

Definition at line 548 of file JSAPI.h.


The documentation for this class was generated from the following file: