Commit 74fea66c authored by Nicholas Nethercote's avatar Nicholas Nethercote
Browse files

Bug 440908 - Remove gIsAnyPrefLocked. r=glandium

It optimizes Preferences::IsLocked(), but that function is called fewer than
200 times while starting the browser and opening a range of tabs.

MozReview-Commit-ID: 5q0zS8TSwdu

--HG--
extra : rebase_source : 015c5ebbe28097ef3f02b1062e650df67721f1c3
parent e415dc84
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -820,8 +820,6 @@ static PLDHashTable* gHashTable;
static CallbackNode* gFirstCallback = nullptr;
static CallbackNode* gLastPriorityNode = nullptr;

static bool gIsAnyPrefLocked = false;

// These are only used during the call to NotifyCallbacks().
static bool gCallbacksInProgress = false;
static bool gShouldCleanupDeadNodes = false;
@@ -4185,7 +4183,6 @@ Preferences::LockInAnyProcess(const char* aPrefName)

  if (!pref->IsLocked()) {
    pref->SetIsLocked(true);
    gIsAnyPrefLocked = true;
    NotifyCallbacks(aPrefName);
  }

@@ -4223,14 +4220,8 @@ Preferences::IsLocked(const char* aPrefName)
{
  NS_ENSURE_TRUE(InitStaticMembers(), false);

  if (gIsAnyPrefLocked) {
  Pref* pref = pref_HashTableLookup(aPrefName);
    if (pref && pref->IsLocked()) {
      return true;
    }
  }

  return false;
  return pref && pref->IsLocked();
}

/* static */ nsresult