Closed Bug 967941 Opened 12 years ago Closed 11 years ago

Convert nsZipReaderCache::mZips to a modern hashtable

Categories

(Core :: Networking: JAR, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(3 files, 2 obsolete files)

No description provided.
As a bonus, I can fix the quadratic behavior in nsZipReaderCache::Observe.
Summary: Convert nsJAR to a modern hashtable → Convert nsJAR::mZips to a modern hashtable
Summary: Convert nsJAR::mZips to a modern hashtable → Convert nsZipReaderCache::mZips to a modern hashtable
With this patch, modules/libjar/test/unit/test_bug637286.js is failing. It hits some kind of deadlock detection. My theory is that this is due to causing a change in how objects are addrefed and released, causing some object to die too early, but I haven't had any success investigating it so far.
Taras, let me know if you aren't the right person to review this. I could get froydnj to review it instead or something. https://tbpl.mozilla.org/?tree=Try&rev=919977e5c90b
Attachment #8379771 - Flags: review?(taras.mozilla)
Attachment #8375843 - Attachment is obsolete: true
Attachment #8375846 - Attachment is obsolete: true
Attachment #8379771 - Flags: review?(taras.mozilla) → review?(aklotz)
Attachment #8379773 - Flags: review?(taras.mozilla) → review?(aklotz)
Attachment #8379774 - Flags: review?(taras.mozilla) → review?(aklotz)
Comment on attachment 8379771 [details] [diff] [review] part 1 - Remove some trailing whitespace from nsJAR.{h,cpp}. Review of attachment 8379771 [details] [diff] [review]: ----------------------------------------------------------------- ::: modules/libjar/nsJAR.cpp @@ +121,5 @@ > #endif > mCache->ReleaseZip(this); > NS_ASSERTION(NS_SUCCEEDED(rv), "failed to release zip file"); > } > return count; There's a trailing space here. @@ +639,2 @@ > curLine.Assign(curPos, linelen); > if (linelen == 0) There's a trailing space here. @@ +1037,5 @@ > > NS_IMETHODIMP > nsZipReaderCache::Init(uint32_t cacheSize) > { > mCacheSize = cacheSize; and here @@ +1044,1 @@ > nsCOMPtr<nsIObserverService> os = and here @@ +1209,5 @@ > } > return true; > } > > struct ZipFindData {nsJAR* zip; bool found;}; Here ::: modules/libjar/nsJAR.h @@ +144,2 @@ > uint32_t mPermissions; > bool mIsDirectory; There's a trailing space here.
Attachment #8379771 - Flags: review?(aklotz) → review+
Comment on attachment 8379773 [details] [diff] [review] part 2 - Convert nsZipReaderCache::mZips to use nsRefPtrHashtable. Review of attachment 8379773 [details] [diff] [review]: ----------------------------------------------------------------- ::: modules/libjar/nsJAR.cpp @@ +1279,2 @@ > nsRefPtr<nsJAR> removed; > + mZips.Remove(uri, getter_AddRefs(removed)); I can't find any overload of Remove() that does a Get + Remove in one call.
Attachment #8379773 - Flags: review?(aklotz) → review-
Attachment #8379774 - Flags: review?(aklotz) → review+
Ah, yeah, sorry, I'm adding one in bug 975223. I was just going to wait on this patch being ready to land before landing it.
Comment on attachment 8379773 [details] [diff] [review] part 2 - Convert nsZipReaderCache::mZips to use nsRefPtrHashtable. See comment 9.
Attachment #8379773 - Flags: review- → review?(aklotz)
Comment on attachment 8379773 [details] [diff] [review] part 2 - Convert nsZipReaderCache::mZips to use nsRefPtrHashtable. Review of attachment 8379773 [details] [diff] [review]: ----------------------------------------------------------------- Cool.
Attachment #8379773 - Flags: review?(aklotz) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: