2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2003-10-05 11:29:50 +04:00
|
|
|
|
2006-03-30 12:03:04 +04:00
|
|
|
/*
|
|
|
|
* Base class for the XML and HTML content sinks, which construct a
|
|
|
|
* DOM based on information from the parser.
|
|
|
|
*/
|
|
|
|
|
2003-10-05 11:29:50 +04:00
|
|
|
#ifndef _nsContentSink_h_
|
|
|
|
#define _nsContentSink_h_
|
|
|
|
|
|
|
|
// Base class for contentsink implementations.
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2003-10-05 11:29:50 +04:00
|
|
|
#include "nsICSSLoaderObserver.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsString.h"
|
2004-06-25 16:26:02 +04:00
|
|
|
#include "nsAutoPtr.h"
|
2006-12-26 20:47:52 +03:00
|
|
|
#include "nsGkAtoms.h"
|
2007-01-31 00:21:06 +03:00
|
|
|
#include "nsITimer.h"
|
|
|
|
#include "nsStubDocumentObserver.h"
|
|
|
|
#include "nsIContentSink.h"
|
2015-05-19 21:15:34 +03:00
|
|
|
#include "mozilla/Logging.h"
|
2008-02-09 01:07:51 +03:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2009-06-25 17:13:38 +04:00
|
|
|
#include "nsThreadUtils.h"
|
2003-10-05 11:29:50 +04:00
|
|
|
|
|
|
|
class nsIURI;
|
|
|
|
class nsIChannel;
|
|
|
|
class nsIDocShell;
|
2017-10-03 01:05:19 +03:00
|
|
|
class nsAtom;
|
2003-10-05 11:29:50 +04:00
|
|
|
class nsIChannel;
|
|
|
|
class nsIContent;
|
2004-06-25 16:26:02 +04:00
|
|
|
class nsNodeInfoManager;
|
2008-08-28 05:15:32 +04:00
|
|
|
class nsIApplicationCache;
|
2003-10-05 11:29:50 +04:00
|
|
|
|
2010-03-03 00:00:53 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace css {
|
|
|
|
class Loader;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace css
|
2017-05-08 09:24:22 +03:00
|
|
|
|
|
|
|
namespace dom {
|
2019-01-02 16:05:23 +03:00
|
|
|
class Document;
|
2017-05-08 09:24:22 +03:00
|
|
|
class ScriptLoader;
|
|
|
|
} // namespace dom
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|
2010-03-03 00:00:53 +03:00
|
|
|
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
2007-01-31 00:21:06 +03:00
|
|
|
|
2015-11-23 22:09:25 +03:00
|
|
|
extern mozilla::LazyLogModule gContentSinkLogModuleInfo;
|
2007-01-31 00:21:06 +03:00
|
|
|
|
|
|
|
# define SINK_TRACE_CALLS 0x1
|
|
|
|
# define SINK_TRACE_REFLOW 0x2
|
|
|
|
# define SINK_ALWAYS_REFLOW 0x4
|
|
|
|
|
2015-11-23 22:09:25 +03:00
|
|
|
# define SINK_LOG_TEST(_lm, _bit) (int((_lm)->Level()) & (_bit))
|
2007-01-31 00:21:06 +03:00
|
|
|
|
|
|
|
# define SINK_TRACE(_lm, _bit, _args) \
|
2017-04-05 00:36:19 +03:00
|
|
|
do { \
|
2007-01-31 00:21:06 +03:00
|
|
|
if (SINK_LOG_TEST(_lm, _bit)) { \
|
2017-04-05 00:36:19 +03:00
|
|
|
printf_stderr _args; \
|
2007-01-31 00:21:06 +03:00
|
|
|
} \
|
2017-04-05 00:36:19 +03:00
|
|
|
} while (0)
|
2007-01-31 00:21:06 +03:00
|
|
|
|
|
|
|
#else
|
|
|
|
# define SINK_TRACE(_lm, _bit, _args)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef SINK_NO_INCREMENTAL
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2003-10-05 11:29:50 +04:00
|
|
|
class nsContentSink : public nsICSSLoaderObserver,
|
2007-01-31 00:21:06 +03:00
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsStubDocumentObserver,
|
2017-02-14 02:45:23 +03:00
|
|
|
public nsITimerCallback,
|
|
|
|
public nsINamed {
|
2019-01-02 16:05:23 +03:00
|
|
|
protected:
|
|
|
|
typedef mozilla::dom::Document Document;
|
|
|
|
|
|
|
|
private:
|
2008-02-09 01:07:51 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsContentSink, nsICSSLoaderObserver)
|
2007-01-31 00:21:06 +03:00
|
|
|
// nsITimerCallback
|
|
|
|
NS_DECL_NSITIMERCALLBACK
|
|
|
|
|
2017-02-14 02:45:23 +03:00
|
|
|
NS_DECL_NSINAMED
|
|
|
|
|
2003-10-05 11:29:50 +04:00
|
|
|
// nsICSSLoaderObserver
|
2016-09-26 15:03:25 +03:00
|
|
|
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet, bool aWasAlternate,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsresult aStatus) override;
|
2003-10-05 11:29:50 +04:00
|
|
|
|
2008-07-17 07:16:23 +04:00
|
|
|
virtual nsresult ProcessMETATag(nsIContent* aContent);
|
2005-11-10 18:51:10 +03:00
|
|
|
|
2007-02-04 08:14:23 +03:00
|
|
|
// nsIContentSink implementation helpers
|
2014-06-02 16:08:21 +04:00
|
|
|
nsresult WillParseImpl(void);
|
|
|
|
nsresult WillInterruptImpl(void);
|
|
|
|
nsresult WillResumeImpl(void);
|
|
|
|
nsresult DidProcessATokenImpl(void);
|
|
|
|
void WillBuildModelImpl(void);
|
|
|
|
void DidBuildModelImpl(bool aTerminated);
|
|
|
|
void DropParserAndPerfHint(void);
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsScriptExecutingImpl();
|
2007-01-31 00:21:06 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void NotifyAppend(nsIContent* aContent, uint32_t aStartIndex);
|
2007-01-31 00:21:06 +03:00
|
|
|
|
|
|
|
// nsIDocumentObserver
|
2010-10-20 11:41:05 +04:00
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE
|
2007-01-31 00:21:06 +03:00
|
|
|
|
|
|
|
virtual void UpdateChildCounts() = 0;
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsTimeToNotify();
|
2017-06-20 12:19:52 +03:00
|
|
|
bool LinkContextIsOurDocument(const nsAString& aAnchor);
|
2012-05-21 17:31:00 +04:00
|
|
|
bool Decode5987Format(nsAString& aEncoded);
|
2009-06-29 02:44:22 +04:00
|
|
|
|
2010-04-27 13:57:32 +04:00
|
|
|
static void InitializeStatics();
|
|
|
|
|
2003-10-05 11:29:50 +04:00
|
|
|
protected:
|
|
|
|
nsContentSink();
|
|
|
|
virtual ~nsContentSink();
|
|
|
|
|
2008-08-28 05:15:32 +04:00
|
|
|
enum CacheSelectionAction {
|
|
|
|
// There is no offline cache manifest specified by the document,
|
|
|
|
// or the document was loaded from a cache other than the one it
|
|
|
|
// specifies via its manifest attribute and IS NOT a top-level
|
|
|
|
// document, or an error occurred during the cache selection
|
|
|
|
// algorithm.
|
|
|
|
CACHE_SELECTION_NONE = 0,
|
|
|
|
|
|
|
|
// The offline cache manifest must be updated.
|
|
|
|
CACHE_SELECTION_UPDATE = 1,
|
|
|
|
|
|
|
|
// The document was loaded from a cache other than the one it
|
|
|
|
// specifies via its manifest attribute and IS a top-level
|
|
|
|
// document. In this case, the document is marked as foreign in
|
|
|
|
// the cache it was loaded from and must be reloaded from the
|
|
|
|
// correct cache (the one it specifies).
|
2008-11-06 03:01:07 +03:00
|
|
|
CACHE_SELECTION_RELOAD = 2,
|
|
|
|
|
|
|
|
// Some conditions require we must reselect the cache without the manifest
|
|
|
|
CACHE_SELECTION_RESELECT_WITHOUT_MANIFEST = 3
|
2008-08-28 05:15:32 +04:00
|
|
|
};
|
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
nsresult Init(Document* aDoc, nsIURI* aURI, nsISupports* aContainer,
|
2003-10-05 11:29:50 +04:00
|
|
|
nsIChannel* aChannel);
|
|
|
|
|
|
|
|
nsresult ProcessHTTPHeaders(nsIChannel* aChannel);
|
2017-10-03 01:05:19 +03:00
|
|
|
nsresult ProcessHeaderData(nsAtom* aHeader, const nsAString& aValue,
|
2012-07-30 18:20:58 +04:00
|
|
|
nsIContent* aContent = nullptr);
|
2012-08-28 21:10:07 +04:00
|
|
|
nsresult ProcessLinkHeader(const nsAString& aLinkData);
|
2017-12-22 00:43:24 +03:00
|
|
|
nsresult ProcessLinkFromHeader(
|
|
|
|
const nsAString& aAnchor, const nsAString& aHref, const nsAString& aRel,
|
|
|
|
const nsAString& aTitle, const nsAString& aType, const nsAString& aMedia,
|
|
|
|
const nsAString& aCrossOrigin, const nsAString& aReferrerPolicy,
|
|
|
|
const nsAString& aAs);
|
|
|
|
|
|
|
|
virtual nsresult ProcessStyleLinkFromHeader(const nsAString& aHref,
|
|
|
|
bool aAlternate,
|
|
|
|
const nsAString& aTitle,
|
|
|
|
const nsAString& aType,
|
|
|
|
const nsAString& aMedia,
|
|
|
|
const nsAString& aReferrerPolicy);
|
2003-10-05 11:29:50 +04:00
|
|
|
|
2017-07-10 16:05:56 +03:00
|
|
|
void PrefetchPreloadHref(const nsAString& aHref, nsINode* aSource,
|
|
|
|
uint32_t aLinkTypes, const nsAString& aAs,
|
|
|
|
const nsAString& aType, const nsAString& aMedia);
|
2008-08-28 05:15:32 +04:00
|
|
|
|
2015-05-06 03:55:18 +03:00
|
|
|
// For PrefetchDNS() aHref can either be the usual
|
2015-02-21 01:01:36 +03:00
|
|
|
// URI format or of the form "//www.hostname.com" without a scheme.
|
2008-11-08 02:00:26 +03:00
|
|
|
void PrefetchDNS(const nsAString& aHref);
|
|
|
|
|
2008-08-28 05:15:32 +04:00
|
|
|
// Gets the cache key (used to identify items in a cache) of the channel.
|
|
|
|
nsresult GetChannelCacheKey(nsIChannel* aChannel, nsACString& aCacheKey);
|
|
|
|
|
|
|
|
// There is an offline cache manifest attribute specified and the
|
|
|
|
// document is allowed to use the offline cache. Process the cache
|
|
|
|
// selection algorithm for this document and the manifest. Result is
|
|
|
|
// an action that must be taken on the manifest, see
|
|
|
|
// CacheSelectionAction enum above.
|
|
|
|
//
|
|
|
|
// @param aLoadApplicationCache
|
|
|
|
// The application cache from which the load originated, if
|
|
|
|
// any.
|
|
|
|
// @param aManifestURI
|
|
|
|
// The manifest URI listed in the document.
|
|
|
|
// @param aFetchedWithHTTPGetOrEquiv
|
|
|
|
// TRUE if this was fetched using the HTTP GET method.
|
|
|
|
// @param aAction
|
|
|
|
// Out parameter, returns the action that should be performed
|
|
|
|
// by the calling function.
|
|
|
|
nsresult SelectDocAppCache(nsIApplicationCache* aLoadApplicationCache,
|
|
|
|
nsIURI* aManifestURI,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aFetchedWithHTTPGetOrEquiv,
|
2008-08-28 05:15:32 +04:00
|
|
|
CacheSelectionAction* aAction);
|
|
|
|
|
|
|
|
// There is no offline cache manifest attribute specified. Process
|
|
|
|
// the cache selection algorithm w/o the manifest. Result is an
|
|
|
|
// action that must be taken, see CacheSelectionAction enum
|
|
|
|
// above. In case the offline cache manifest has to be updated the
|
|
|
|
// manifest URI is returned in aManifestURI.
|
|
|
|
//
|
|
|
|
// @param aLoadApplicationCache
|
|
|
|
// The application cache from which the load originated, if
|
|
|
|
// any.
|
|
|
|
// @param aManifestURI
|
|
|
|
// Out parameter, returns the manifest URI of the cache that
|
|
|
|
// was selected.
|
|
|
|
// @param aAction
|
|
|
|
// Out parameter, returns the action that should be performed
|
|
|
|
// by the calling function.
|
|
|
|
nsresult SelectDocAppCacheNoManifest(
|
|
|
|
nsIApplicationCache* aLoadApplicationCache, nsIURI** aManifestURI,
|
|
|
|
CacheSelectionAction* aAction);
|
|
|
|
|
2009-06-29 02:44:22 +04:00
|
|
|
public:
|
2008-08-28 05:15:32 +04:00
|
|
|
// Searches for the offline cache manifest attribute and calls one
|
|
|
|
// of the above defined methods to select the document's application
|
|
|
|
// cache, let it be associated with the document and eventually
|
|
|
|
// schedule the cache update process.
|
2011-05-13 12:31:12 +04:00
|
|
|
// This method MUST be called with the empty string as the argument
|
|
|
|
// when there is no manifest attribute!
|
2010-02-02 10:43:18 +03:00
|
|
|
void ProcessOfflineManifest(const nsAString& aManifestSpec);
|
|
|
|
|
2017-07-06 15:00:35 +03:00
|
|
|
// Extracts the manifest attribute from the element if it is the root
|
2010-02-02 10:43:18 +03:00
|
|
|
// element and calls the above method.
|
2008-01-17 00:54:33 +03:00
|
|
|
void ProcessOfflineManifest(nsIContent* aElement);
|
2003-10-05 11:29:50 +04:00
|
|
|
|
2015-05-06 03:55:18 +03:00
|
|
|
// For Preconnect() aHref can either be the usual
|
|
|
|
// URI format or of the form "//www.hostname.com" without a scheme.
|
2015-06-20 00:11:42 +03:00
|
|
|
void Preconnect(const nsAString& aHref, const nsAString& aCrossOrigin);
|
2015-05-06 03:55:18 +03:00
|
|
|
|
2009-06-29 02:44:22 +04:00
|
|
|
protected:
|
2011-05-12 20:07:42 +04:00
|
|
|
// Tries to scroll to the URI's named anchor. Once we've successfully
|
|
|
|
// done that, further calls to this method will be ignored.
|
|
|
|
void ScrollToRef();
|
2007-04-21 02:59:18 +04:00
|
|
|
|
|
|
|
// Start layout. If aIgnorePendingSheets is true, this will happen even if
|
|
|
|
// we still have stylesheet loads pending. Otherwise, we'll wait until the
|
|
|
|
// stylesheets are all done loading.
|
2009-06-29 02:44:22 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
void StartLayout(bool aIgnorePendingSheets);
|
2010-08-28 09:54:57 +04:00
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
static void NotifyDocElementCreated(Document* aDoc);
|
2010-08-28 09:54:57 +04:00
|
|
|
|
2019-01-21 20:09:33 +03:00
|
|
|
Document* GetDocument() { return mDocument; }
|
|
|
|
|
2009-06-29 02:44:22 +04:00
|
|
|
protected:
|
2015-04-13 19:02:27 +03:00
|
|
|
void FavorPerformanceHint(bool perfOverStarvation, uint32_t starvationDelay);
|
2014-01-31 09:35:44 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline int32_t GetNotificationInterval() {
|
2007-01-31 00:21:06 +03:00
|
|
|
if (mDynamicLowerValue) {
|
|
|
|
return 1000;
|
|
|
|
}
|
|
|
|
|
2010-04-27 13:57:32 +04:00
|
|
|
return sNotificationInterval;
|
2007-01-31 00:21:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult FlushTags() = 0;
|
|
|
|
|
2007-07-11 07:42:11 +04:00
|
|
|
// Later on we might want to make this more involved somehow
|
|
|
|
// (e.g. stop waiting after some timeout or whatnot).
|
2011-09-29 10:19:26 +04:00
|
|
|
bool WaitForPendingSheets() { return mPendingSheetCount > 0; }
|
2007-07-11 07:42:11 +04:00
|
|
|
|
2009-06-25 17:13:38 +04:00
|
|
|
void DoProcessLinkHeader();
|
|
|
|
|
2012-01-20 15:16:27 +04:00
|
|
|
void StopDeflecting() { mDeflectedCount = sPerfDeflectCount; }
|
2007-02-02 05:12:48 +03:00
|
|
|
|
|
|
|
protected:
|
2019-01-02 16:05:23 +03:00
|
|
|
RefPtr<Document> mDocument;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsParserBase> mParser;
|
2004-01-10 02:54:21 +03:00
|
|
|
nsCOMPtr<nsIURI> mDocumentURI;
|
2003-10-05 11:29:50 +04:00
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::css::Loader> mCSSLoader;
|
|
|
|
RefPtr<nsNodeInfoManager> mNodeInfoManager;
|
2017-05-08 09:24:22 +03:00
|
|
|
RefPtr<mozilla::dom::ScriptLoader> mScriptLoader;
|
2003-10-05 11:29:50 +04:00
|
|
|
|
2007-01-31 00:21:06 +03:00
|
|
|
// back off timer notification after count
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mBackoffCount;
|
2007-01-31 00:21:06 +03:00
|
|
|
|
|
|
|
// Time of last notification
|
2007-04-21 02:59:18 +04:00
|
|
|
// Note: mLastNotificationTime is only valid once mLayoutStarted is true.
|
2007-01-31 00:21:06 +03:00
|
|
|
PRTime mLastNotificationTime;
|
|
|
|
|
|
|
|
// Timer used for notification
|
|
|
|
nsCOMPtr<nsITimer> mNotificationTimer;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mLayoutStarted : 1;
|
|
|
|
uint8_t mDynamicLowerValue : 1;
|
|
|
|
uint8_t mParsing : 1;
|
|
|
|
uint8_t mDroppedTimer : 1;
|
2007-04-21 02:59:18 +04:00
|
|
|
// If true, we deferred starting layout until sheets load
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mDeferredLayoutStart : 1;
|
2007-07-11 07:42:11 +04:00
|
|
|
// If true, we deferred notifications until sheets load
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mDeferredFlushTags : 1;
|
2009-05-17 18:22:55 +04:00
|
|
|
// If false, we're not ourselves a document observer; that means we
|
|
|
|
// shouldn't be performing any more content model notifications,
|
|
|
|
// since we're not longer updating our child counts.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mIsDocumentObserver : 1;
|
2012-01-20 16:03:49 +04:00
|
|
|
// True if this is parser is a fragment parser or an HTML DOMParser.
|
|
|
|
// XML DOMParser leaves this to false for now!
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t mRunsToCompletion : 1;
|
2018-02-16 00:15:01 +03:00
|
|
|
// True if we are blocking load event.
|
|
|
|
bool mIsBlockingOnload : 1;
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2009-05-19 19:54:42 +04:00
|
|
|
//
|
2007-01-31 00:21:06 +03:00
|
|
|
// -- Can interrupt parsing members --
|
2009-05-19 19:54:42 +04:00
|
|
|
//
|
|
|
|
|
|
|
|
// The number of tokens that have been processed since we measured
|
|
|
|
// if it's time to return to the main event loop.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mDeflectedCount;
|
2009-05-19 19:54:42 +04:00
|
|
|
|
|
|
|
// Is there currently a pending event?
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mHasPendingEvent;
|
2009-05-19 19:54:42 +04:00
|
|
|
|
|
|
|
// When to return to the main event loop
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mCurrentParseEndTime;
|
2007-01-31 00:21:06 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mBeginLoadTime;
|
2007-01-31 00:21:06 +03:00
|
|
|
|
|
|
|
// Last mouse event or keyboard event time sampled by the content
|
|
|
|
// sink
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mLastSampledUserEventTime;
|
2007-01-31 00:21:06 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mInMonolithicContainer;
|
2007-01-31 00:21:06 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mInNotification;
|
|
|
|
uint32_t mUpdatesInNotification;
|
2007-02-14 00:18:25 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mPendingSheetCount;
|
2007-04-21 02:59:18 +04:00
|
|
|
|
2010-04-20 21:22:04 +04:00
|
|
|
nsRevocableEventPtr<nsRunnableMethod<nsContentSink, void, false> >
|
2009-06-25 17:13:38 +04:00
|
|
|
mProcessLinkHeaderEvent;
|
2010-04-27 13:57:32 +04:00
|
|
|
|
|
|
|
// Do we notify based on time?
|
2011-09-29 10:19:26 +04:00
|
|
|
static bool sNotifyOnTimer;
|
2010-04-27 13:57:32 +04:00
|
|
|
// Back off timer notification after count.
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sBackoffCount;
|
2010-04-27 13:57:32 +04:00
|
|
|
// Notification interval in microseconds
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sNotificationInterval;
|
2010-04-27 13:57:32 +04:00
|
|
|
// How many times to deflect in interactive/perf modes
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sInteractiveDeflectCount;
|
|
|
|
static int32_t sPerfDeflectCount;
|
2010-04-27 13:57:32 +04:00
|
|
|
// 0 = don't check for pending events
|
|
|
|
// 1 = don't deflect if there are pending events
|
|
|
|
// 2 = bail if there are pending events
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sPendingEventMode;
|
2010-04-27 13:57:32 +04:00
|
|
|
// How often to probe for pending events. 1=every token
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sEventProbeRate;
|
2010-04-27 13:57:32 +04:00
|
|
|
// How long to stay off the event loop in interactive/perf modes
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sInteractiveParseTime;
|
|
|
|
static int32_t sPerfParseTime;
|
2010-04-27 13:57:32 +04:00
|
|
|
// How long to be in interactive mode after an event
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sInteractiveTime;
|
2010-04-27 13:57:32 +04:00
|
|
|
// How long to stay in perf mode after initial loading
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sInitialPerfTime;
|
2010-04-27 13:57:32 +04:00
|
|
|
// Should we switch between perf-mode and interactive-mode
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t sEnablePerfMode;
|
2003-10-05 11:29:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _nsContentSink_h_
|