Bug 1202526 (part 5) - Use PLDHashTable::RemoveEntry() in nsSecureBrowserUIImpl. r=dkeeler.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 07 Sep 2015 19:20:16 -0700
changeset 294326 aa827e8bdba208ef2e8b4dcb70600c00d67a4137
parent 294325 438b7e68c23adbf83344f832a09d626a1190c46f
child 294327 38e1c1c1bdc772bc0b06471737ee22b0ff8ba62c
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdkeeler
bugs1202526
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1202526 (part 5) - Use PLDHashTable::RemoveEntry() in nsSecureBrowserUIImpl. r=dkeeler. This avoids repeating the hash table search in order to remove the entry.
security/manager/ssl/nsSecureBrowserUIImpl.cpp
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -867,18 +867,20 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
   bool requestHasTransferedData = false;
 
   if (aProgressStateFlags & STATE_STOP
       &&
       aProgressStateFlags & STATE_IS_REQUEST)
   {
     { /* scope for the ReentrantMonitorAutoEnter */
       ReentrantMonitorAutoEnter lock(mReentrantMonitor);
-      if (PL_DHashTableSearch(&mTransferringRequests, aRequest)) {
-        PL_DHashTableRemove(&mTransferringRequests, aRequest);
+      PLDHashEntryHdr* entry =
+        PL_DHashTableSearch(&mTransferringRequests, aRequest);
+      if (entry) {
+        mTransferringRequests.RemoveEntry(entry);
         requestHasTransferedData = true;
       }
     }
 
     if (!requestHasTransferedData) {
       // Because image loads doesn't support any TRANSFERRING notifications but
       // only START and STOP we must ask them directly whether content was
       // transferred.  See bug 432685 for details.