def __init__(self): self.queue = [] self.inCallback = False self.updateEvent = locks.Event(name='LodQueueEvent') self.__freezeQueue = False uthread.new(LodQueue.QueueMonitorThread, weakref.ref(self)) self.queueSizeStat = blue.statistics.Find('paperDoll/queueSize') if not self.queueSizeStat: self.queueSizeStat = blue.CcpStatisticsEntry() self.queueSizeStat.name = 'paperDoll/queueSize' self.queueSizeStat.type = 1 self.queueSizeStat.resetPerFrame = False self.queueSizeStat.description = 'The length of the LOD switching queue' blue.statistics.Register(self.queueSizeStat) self.queueActiveUpStat = blue.statistics.Find( 'paperDoll/queueActiveUp') if not self.queueActiveUpStat: self.queueActiveUpStat = blue.CcpStatisticsEntry() self.queueActiveUpStat.name = 'paperDoll/queueActiveUp' self.queueActiveUpStat.type = 1 self.queueActiveUpStat.resetPerFrame = False self.queueActiveUpStat.description = 'Number of LOD switches to higher quality in progress' blue.statistics.Register(self.queueActiveUpStat) self.queueActiveDownStat = blue.statistics.Find( 'paperDoll/queueActiveDown') if not self.queueActiveDownStat: self.queueActiveDownStat = blue.CcpStatisticsEntry() self.queueActiveDownStat.name = 'paperDoll/queueActiveDown' self.queueActiveDownStat.type = 1 self.queueActiveDownStat.resetPerFrame = False self.queueActiveDownStat.description = 'Number of LOD switches to lower quality in progress' blue.statistics.Register(self.queueActiveDownStat)
def Startup(self, sessionName, initialUrl=None, browserEventHandler=None, autoHandleLockdown=True, *args): self.name = sessionName self.statusText = '' self.securityInfo = 0 self.awaitingTitle = True self.loading = False self.logToHistory = False self.cursorType = 0 self.isViewSourceMode = False self.hint = '' self.surfaceDirty = False self.currentUrl = initialUrl if self.currentUrl is None: self.currentUrl = 'about:blank' self.hidden = self.currentUrl == 'about:blank' self.browserEventHandler = browserEventHandler self.autoHandleLockdown = autoHandleLockdown self.AppStartup(sessionName, initialUrl, browserEventHandler, autoHandleLockdown) self.SetupBrowserSession(autoHandleLockdown=autoHandleLockdown) stat = blue.statistics.Find('browser/numRequests') if stat is None: stat = blue.CcpStatisticsEntry() stat.name = 'browser/numRequests' stat.resetPerFrame = False stat.type = 1 blue.statistics.Register(stat) self.numRequestsStat = stat
def CreateOrGetStatistic(name, desc, statType, resetPerFrame): stat = blue.statistics.Find(name) if not stat: stat = blue.CcpStatisticsEntry() stat.name = name stat.type = statType stat.resetPerFrame = resetPerFrame stat.description = desc blue.statistics.Register(stat) return stat
def Startup(self, sessionName, initialUrl=None, browserEventHandler=None, autoHandleLockdown=True, *args): """ sessionName: A unique string ID for this BrowserSession. Primarily used for tabbing. browserEventHandler: An object that can handle a number of browser-event callbacks sourced from Awesomium/Chromium. These are items that include page-begin-loading, loading-complete, etc. Note! You must also call SetBrowserSurfaceManager with a valid argument before a browserPane will be functional! """ self.name = sessionName self.statusText = '' self.securityInfo = 0 self.awaitingTitle = True self.loading = False self.logToHistory = False self.cursorType = 0 self.isViewSourceMode = False self.hint = '' self.surfaceDirty = False self.currentUrl = initialUrl if self.currentUrl is None: self.currentUrl = 'about:blank' self.hidden = self.currentUrl == 'about:blank' self.browserEventHandler = browserEventHandler self.autoHandleLockdown = autoHandleLockdown self.AppStartup(sessionName, initialUrl, browserEventHandler, autoHandleLockdown) self.SetupBrowserSession(autoHandleLockdown=autoHandleLockdown) stat = blue.statistics.Find('browser/numRequests') if stat is None: stat = blue.CcpStatisticsEntry() stat.name = 'browser/numRequests' stat.resetPerFrame = False stat.type = 1 blue.statistics.Register(stat) self.numRequestsStat = stat