Closed
Bug 596476
Opened 14 years ago
Closed 14 years ago
Fixup of smart_size cache code
Categories
(Core :: Networking: Cache, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta7+ |
People
(Reporter: jduell.mcbugs, Assigned: jduell.mcbugs)
References
(Blocks 1 open bug)
Details
Attachments
(4 files, 1 obsolete file)
2.21 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
13.51 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
8.18 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
2.97 KB,
patch
|
jduell.mcbugs
:
review+
|
Details | Diff | Splinter Review |
This is a bunch of patches for fixes I made while debugging the smart_size cache code crash (bug 595413)
The first patch fixes our algorithm which uses smart_size unless the user manually set a size lower than our old default (50 MB). We had 250 MB instead.
Attachment #475395 -
Flags: review?(jst)
Assignee | ||
Comment 1•14 years ago
|
||
We were mixing bytes and KB, and in several places were accidentally assigning byte fields to mDiskCacheCapacity, which takes kb.
Converted everything to KB to make life less error-prone.
Attachment #475396 -
Flags: review?(jst)
Assignee | ||
Comment 2•14 years ago
|
||
Use previous cache size while we wait for smart_size update, instead of MAX_SIZE (1 GB). If something goes wrong with determinig smart size, we don't want to have set the user's cache by default to 1 GB, and even using it temporarily seems weird.
Attachment #475398 -
Flags: review?(jst)
Assignee | ||
Comment 3•14 years ago
|
||
We get the cache dir by checking a number of prefs. The previous code only checked one pref. Now we send directory path to smart_size event to ensure it has correct dir.
Attachment #475399 -
Flags: review?(jst)
Assignee | ||
Comment 4•14 years ago
|
||
I'd like to land all these with the fix for bug 595413.
blocking2.0: --- → ?
Comment 5•14 years ago
|
||
Comment on attachment 475395 [details] [diff] [review]
Corrects previous shipped cache size: is 50 MB, not 250
+// Default cache size was 50 MB for many years until FF 4:
+const PRInt32 PRE_FF4_DEFAULT_CACHE_SIZE = 50 * 1024 * 1024;
Name use GECKO_2_0 here instead of FF4, as this is not specific to Firefox.
r=jst
Attachment #475395 -
Flags: review?(jst) → review+
Updated•14 years ago
|
Attachment #475396 -
Flags: review?(jst) → review+
Updated•14 years ago
|
Attachment #475398 -
Attachment is patch: true
Attachment #475398 -
Attachment mime type: application/octet-stream → text/plain
Updated•14 years ago
|
Attachment #475398 -
Flags: review?(jst) → review+
Comment 6•14 years ago
|
||
Blocking, though this is probably not super critical.
blocking2.0: ? → betaN+
Assignee | ||
Comment 7•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•14 years ago
|
||
Damn, wrong bug. HG changeset in comment 7 is bogus
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•14 years ago
|
Blocks: http_cache
Assignee | ||
Comment 9•14 years ago
|
||
Minor fix: first time new cache code run, if user didn't set sz < 50 mb, set manual setting to 1 GB as starting point for mods (see bug 559942 comment 65)
Attachment #475398 -
Attachment is obsolete: true
Attachment #476170 -
Flags: review+
Comment 10•14 years ago
|
||
(In reply to comment #6)
> Blocking, though this is probably not super critical.
sounds like it might help with #1-2 top crash bug 598007. we should try to move up from betaN+ if that is the case.
blocking2.0: betaN+ → ?
Comment 11•14 years ago
|
||
Very bad, and this probably caused bug 598007.
blocking2.0: ? → beta7+
Comment 13•14 years ago
|
||
Comment on attachment 475399 [details] [diff] [review]
Ensure correct cache directory is used for smart_size check
- In nsCacheProfilePrefObserver::GetSmartCacheSize(const nsAString& cachePath):
+ nsCOMPtr<nsILocalFile>
+ cacheDirectory (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
+ rv = cacheDirectory->InitWithPath(cachePath);
+ if (NS_FAILED(rv))
return DEFAULT_CACHE_SIZE;
Given what we're hoping this might fix, I'd feel a bit more comfortable if we null checked cacheDirectory after creating it above.
r=jst with that.
Attachment #475399 -
Flags: review?(jst) → review+
Assignee | ||
Comment 14•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/f26eacbf7a3b
http://hg.mozilla.org/mozilla-central/rev/e705df4f708c
http://hg.mozilla.org/mozilla-central/rev/ecac1d09d40c
http://hg.mozilla.org/mozilla-central/rev/9c44ec22e1f4
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
Comment 15•14 years ago
|
||
(In reply to comment #5)
> Name use GECKO_2_0 here instead of FF4, as this is not specific to Firefox.
Jason, I don't see this comment addressed, is that in a followup?
Assignee | ||
Comment 16•14 years ago
|
||
> Name use GECKO_2_0 here instead of FF4, as this is not specific to Firefox.
Oops--thanks, nice catch. Fixed.
http://hg.mozilla.org/mozilla-central/rev/942b5b6e74e4
Updated•13 years ago
|
Assignee: nobody → jduell.mcbugs
You need to log in
before you can comment on or make changes to this bug.
Description
•