Skip to end of metadata
Go to start of metadata

virtual void FB::JSAPIImpl::pushZone ( const SecurityZone securityLevel  )  [inline, virtual]

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
Parameters:
securityLevel const SecurityZone & Zone id to push on the stack
Since:
1.4a3
See also:
FB::scoped_zonelock

Reimplemented from FB::JSAPI.

Definition at line 176 of file JSAPIImpl.h.

00177         {
00178             m_zoneMutex.lock();
00179             m_zoneStack.push_back(securityLevel);
00180         }


Generated on 19 Jun 2013 for FireBreath by  doxygen 1.6.1
Labels
  • None