Sirikata
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Sirikata::JS::JSSystemStruct Struct Reference

#include <JSSystemStruct.hpp>

Collaboration diagram for Sirikata::JS::JSSystemStruct:

List of all members.

Public Member Functions

 JSSystemStruct (JSContextStruct *jscont, Capabilities::CapNum capNum)
 ~JSSystemStruct ()
v8::Handle< v8::Value > proxAddedHandlerCallallback (v8::Handle< v8::Function >cb)
v8::Handle< v8::Value > proxRemovedHandlerCallallback (v8::Handle< v8::Function >cb)
v8::Handle< v8::Value > struct_canSendMessage ()
v8::Handle< v8::Value > struct_canRecvMessage ()
v8::Handle< v8::Value > struct_canProxCallback ()
v8::Handle< v8::Value > struct_canProxChangeQuery ()
v8::Handle< v8::Value > struct_canImport ()
v8::Handle< v8::Value > pushEvalContextScopeDirectory (const String &newDir)
v8::Handle< v8::Value > popEvalContextScopeDirectory ()
v8::Handle< v8::Value > checkResources ()
v8::Handle< v8::Value > struct_evalInGlobal (const String &native_contents, ScriptOrigin *sOrigin)
v8::Handle< v8::Value > checkHeadless ()
v8::Handle< v8::Value > getAssociatedPresence ()
v8::Handle< v8::Value > storageBeginTransaction ()
v8::Handle< v8::Value > storageCommit (v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > storageWrite (const OH::Storage::Key &key, const String &toWrite, v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > storageErase (const OH::Storage::Key &key, v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > storageRead (const OH::Storage::Key &key, v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > storageRangeRead (const OH::Storage::Key &start, const OH::Storage::Key &finish, v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > storageRangeErase (const OH::Storage::Key &start, const OH::Storage::Key &finish, v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > storageCount (const OH::Storage::Key &start, const OH::Storage::Key &finish, v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > setRestoreScript (const String &key, v8::Handle< v8::Function > cb)
v8::Handle< v8::Value > killEntity ()
v8::Handle< v8::Value > struct_canCreatePres ()
v8::Handle< v8::Value > struct_canCreateEnt ()
v8::Handle< v8::Value > struct_canEval ()
v8::Handle< v8::Value > sendSandbox (const String &msgToSend, JSContextStruct *destination)
v8::Handle< v8::Value > setSandboxMessageCallback (v8::Persistent< v8::Function > callback)
v8::Handle< v8::Value > setPresenceMessageCallback (v8::Persistent< v8::Function > callback)
v8::Handle< v8::Value > emersonCompileString (const String &toCompile)
v8::Handle< v8::Value > struct_create_vis (const SpaceObjectReference &sporefWatching, JSVisibleDataPtr addParams)
v8::Handle< v8::Value > restorePresence (PresStructRestoreParams &psrp)
v8::Handle< v8::Value > debug_fileWrite (String &strToWrite, String &filename)
v8::Handle< v8::Value > debug_fileRead (String &filename)
v8::Handle< v8::Value > httpRequest (Sirikata::Network::Address addr, Transfer::HttpManager::HTTP_METHOD method, String request, v8::Persistent< v8::Function > cb)
v8::Handle< v8::Value > struct_print (const String &msg)
v8::Handle< v8::Value > struct_sendHome (const String &toSend)
v8::Handle< v8::Value > struct_import (const String &toImportFrom, bool isJS)
v8::Handle< v8::Value > struct_require (const String &toRequireFrom, bool isJS)
v8::Handle< v8::Value > struct_createEntity (EntityCreateInfo &eci)
v8::Handle< v8::Value > struct_createContext (JSPresenceStruct *jspres, const SpaceObjectReference &canSendTo, Capabilities::CapNum permNum)
JSContextStructgetContext ()
v8::Handle< v8::Value > struct_registerOnPresenceConnectedHandler (v8::Persistent< v8::Function > cb_persist)
v8::Handle< v8::Value > struct_registerOnPresenceDisconnectedHandler (v8::Persistent< v8::Function > cb_persist)
v8::Handle< v8::Value > sendMessageNoErrorHandler (JSPresenceStruct *jspres, const String &serialized_message, JSPositionListener *jspl, bool reliable)
v8::Handle< v8::Value > deserialize (const String &toDeserialize)
v8::Handle< v8::Value > struct_event (v8::Persistent< v8::Function > &cb)
v8::Handle< v8::Value > struct_createTimeout (double period, v8::Persistent< v8::Function > &cb)
v8::Handle< v8::Value > struct_createTimeout (double period, v8::Persistent< v8::Function > &cb, uint32 contID, double timeRemaining, bool isSuspended, bool isCleared)
v8::Handle< v8::Value > struct_setScript (const String &script)
v8::Handle< v8::Value > struct_getScript ()
v8::Handle< v8::Value > struct_reset (const std::map< SpaceObjectReference, std::vector< SpaceObjectReference > > &proxResSet)
Capabilities::CapNum getCapNum ()

Static Public Member Functions

static JSSystemStructdecodeSystemStruct (v8::Handle< v8::Value > toDecode, std::string &errorMessage)

Private Member Functions

void stripCapEscalation (Capabilities::CapNum &permNum, Capabilities::Caps capRequesting, JSPresenceStruct *jspres, const String &capRequestingName)
bool checkCurCtxtHasCapability (JSPresenceStruct *jspres, Capabilities::Caps capRequesting)

Private Attributes

JSContextStructassociatedContext
uint32 mCapNum

Constructor & Destructor Documentation

Sirikata::JS::JSSystemStruct::JSSystemStruct ( JSContextStruct jscont,
Capabilities::CapNum  capNum 
)
Sirikata::JS::JSSystemStruct::~JSSystemStruct ( )

Member Function Documentation

bool Sirikata::JS::JSSystemStruct::checkCurCtxtHasCapability ( JSPresenceStruct jspres,
Capabilities::Caps  capRequesting 
) [private]
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::checkHeadless ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::checkResources ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::debug_fileRead ( String &  filename)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::debug_fileWrite ( String &  strToWrite,
String &  filename 
)
JSSystemStruct * Sirikata::JS::JSSystemStruct::decodeSystemStruct ( v8::Handle< v8::Value >  toDecode,
std::string &  errorMessage 
) [static]

References SYSTEM_TEMPLATE_FIELD_COUNT, and SYSTEM_TEMPLATE_SYSTEM_FIELD.

Referenced by Sirikata::JS::JSSystem::commonImport(), Sirikata::JS::JSSystem::commonRequire(), Sirikata::JS::JSSystem::debug_fileRead(), Sirikata::JS::JSSystem::debug_fileWrite(), Sirikata::JS::JSSystem::evalInGlobal(), Sirikata::JS::JSVisible::loadMesh(), Sirikata::JS::JSSystem::root_canCreateEnt(), Sirikata::JS::JSSystem::root_canCreatePres(), Sirikata::JS::JSSystem::root_canEval(), Sirikata::JS::JSSystem::root_canImport(), Sirikata::JS::JSSystem::root_canProxCallback(), Sirikata::JS::JSSystem::root_canProxChangeQuery(), Sirikata::JS::JSSystem::root_canRecvMessage(), Sirikata::JS::JSSystem::root_canSendMessage(), Sirikata::JS::JSSystem::root_createContext(), Sirikata::JS::JSSystem::root_createEntity(), Sirikata::JS::JSSystem::root_createEntityNoSpace(), Sirikata::JS::JSSystem::root_createVisible(), Sirikata::JS::JSSystem::root_deserialize(), Sirikata::JS::JSSystem::root_event(), Sirikata::JS::JSSystem::root_getScript(), Sirikata::JS::JSSystem::root_headless(), Sirikata::JS::JSSystem::root_onPresenceConnected(), Sirikata::JS::JSSystem::root_onPresenceDisconnected(), Sirikata::JS::JSSystem::root_print(), Sirikata::JS::JSSystem::root_proxAddedHandler(), Sirikata::JS::JSSystem::root_proxRemovedHandler(), Sirikata::JS::JSSystem::root_reset(), Sirikata::JS::JSSystem::root_restorePresence(), Sirikata::JS::JSSystem::root_sendHome(), Sirikata::JS::JSSystem::root_serialize(), Sirikata::JS::JSSystem::root_setScript(), Sirikata::JS::JSSystem::root_timeout(), Sirikata::JS::JSSystem::sendMessage(), Sirikata::JS::JSSerializer::serializeSystem(), Sirikata::JS::JSSystem::setRestoreScript(), Sirikata::JS::JSSystem::storageBeginTransaction(), Sirikata::JS::JSSystem::storageCommit(), Sirikata::JS::JSSystem::storageCount(), Sirikata::JS::JSSystem::storageErase(), Sirikata::JS::JSSystem::storageRangeErase(), Sirikata::JS::JSSystem::storageRangeRead(), Sirikata::JS::JSSystem::storageRead(), and Sirikata::JS::JSSystem::storageWrite().

v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::deserialize ( const String &  toDeserialize)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::emersonCompileString ( const String &  toCompile)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::getAssociatedPresence ( )
Capabilities::CapNum Sirikata::JS::JSSystemStruct::getCapNum ( )
JSContextStruct * Sirikata::JS::JSSystemStruct::getContext ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::httpRequest ( Sirikata::Network::Address  addr,
Transfer::HttpManager::HTTP_METHOD  method,
String  request,
v8::Persistent< v8::Function >  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::killEntity ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::popEvalContextScopeDirectory ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::proxAddedHandlerCallallback ( v8::Handle< v8::Function >  cb)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::proxRemovedHandlerCallallback ( v8::Handle< v8::Function >  cb)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::pushEvalContextScopeDirectory ( const String &  newDir)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::restorePresence ( PresStructRestoreParams psrp)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::sendMessageNoErrorHandler ( JSPresenceStruct jspres,
const String &  serialized_message,
JSPositionListener jspl,
bool  reliable 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::sendSandbox ( const String &  msgToSend,
JSContextStruct destination 
)
Parameters:
{v8::Object}msgToSend
{JSContextStruct*}destination. (If null, means send to parent).

Sends a message from the sandbox associated with this system object to the sandbox associated with destination. If destination is null, sends to parent.

References associatedContext, and Sirikata::JS::JSContextStruct::sendSandbox().

v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::setPresenceMessageCallback ( v8::Persistent< v8::Function >  callback)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::setRestoreScript ( const String &  key,
v8::Handle< v8::Function >  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::setSandboxMessageCallback ( v8::Persistent< v8::Function >  callback)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageBeginTransaction ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageCommit ( v8::Handle< v8::Function >  cb)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageCount ( const OH::Storage::Key start,
const OH::Storage::Key finish,
v8::Handle< v8::Function >  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageErase ( const OH::Storage::Key key,
v8::Handle< v8::Function >  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageRangeErase ( const OH::Storage::Key start,
const OH::Storage::Key finish,
v8::Handle< v8::Function >  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageRangeRead ( const OH::Storage::Key start,
const OH::Storage::Key finish,
v8::Handle< v8::Function >  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageRead ( const OH::Storage::Key key,
v8::Handle< v8::Function >  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::storageWrite ( const OH::Storage::Key key,
const String &  toWrite,
v8::Handle< v8::Function >  cb 
)
void Sirikata::JS::JSSystemStruct::stripCapEscalation ( Capabilities::CapNum permNum,
Capabilities::Caps  capRequesting,
JSPresenceStruct jspres,
const String &  capRequestingName 
) [private]
Parameters:
{Capabilities::CapNum}The requested amount of capabilities.
{Capabilities::Caps}capRequesting Capability that scripter is requesting to imbue into new sandbox.
{JSPresenceStruct}jspres Default presence for new sandbox.

If scripter is trying to request capabilities that the initial sandbox he/she is creating does not have, strips those capabilities.

References checkCurCtxtHasCapability(), Sirikata::Logging::info, and JSLOG.

Referenced by struct_createContext().

v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canCreateEnt ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canCreatePres ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canEval ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canImport ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canProxCallback ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canProxChangeQuery ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canRecvMessage ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_canSendMessage ( )
v8::Handle<v8::Value> Sirikata::JS::JSSystemStruct::struct_create_vis ( const SpaceObjectReference sporefWatching,
JSVisibleDataPtr  addParams 
) [inline]
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_createContext ( JSPresenceStruct jspres,
const SpaceObjectReference canSendTo,
Capabilities::CapNum  permNum 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_createEntity ( EntityCreateInfo eci)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_createTimeout ( double  period,
v8::Persistent< v8::Function > &  cb,
uint32  contID,
double  timeRemaining,
bool  isSuspended,
bool  isCleared 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_createTimeout ( double  period,
v8::Persistent< v8::Function > &  cb 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_evalInGlobal ( const String &  native_contents,
ScriptOrigin *  sOrigin 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_event ( v8::Persistent< v8::Function > &  cb)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_getScript ( )
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_import ( const String &  toImportFrom,
bool  isJS 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_print ( const String &  msg)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_registerOnPresenceConnectedHandler ( v8::Persistent< v8::Function >  cb_persist)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_registerOnPresenceDisconnectedHandler ( v8::Persistent< v8::Function >  cb_persist)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_require ( const String &  toRequireFrom,
bool  isJS 
)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_reset ( const std::map< SpaceObjectReference, std::vector< SpaceObjectReference > > &  proxResSet)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_sendHome ( const String &  toSend)
v8::Handle< v8::Value > Sirikata::JS::JSSystemStruct::struct_setScript ( const String &  script)

Member Data Documentation


The documentation for this struct was generated from the following files: