mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Issue #1688 - Add flood guard to state change logic.
This commit is contained in:
parent
d6c1cc53ba
commit
51c4b1838c
3 changed files with 56 additions and 0 deletions
|
|
@ -1049,6 +1049,15 @@ private:
|
|||
// as constants in the nsIDocShell.idl file.
|
||||
uint32_t mTouchEventsOverride;
|
||||
|
||||
// Keep track how how many history state changes we're getting, to catch &
|
||||
// prevent flooding.
|
||||
int32_t mStateFloodGuardCount;
|
||||
mozilla::TimeStamp mStateFloodGuardUpdated;
|
||||
bool mStateFloodGuardReported;
|
||||
// We have a limit of pushing 50 states to history every 10 seconds.
|
||||
const int32_t kStateUpdateLimit = 50;
|
||||
const double kRefreshTimeSecs = 10.0;
|
||||
|
||||
// Separate function to do the actual name (i.e. not _top, _self etc.)
|
||||
// searching for FindItemWithName.
|
||||
nsresult DoFindItemWithName(const nsAString& aName,
|
||||
|
|
@ -1064,6 +1073,10 @@ private:
|
|||
void MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
|
||||
const nsString& aKeyword);
|
||||
|
||||
// Helper method for AddState which checks for excessive calls to PushState or
|
||||
// ReplaceState.
|
||||
bool IsStateChangeFlooding();
|
||||
|
||||
#ifdef DEBUG
|
||||
// We're counting the number of |nsDocShells| to help find leaks
|
||||
static unsigned long gNumberOfDocShells;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue