Closed
Bug 922081
Opened 11 years ago
Closed 11 years ago
HTTP cache v2: respect "browser.cache.disk.parent_directory" preference
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: mayhemer, Assigned: mayhemer)
References
Details
Attachments
(1 file, 1 obsolete file)
6.00 KB,
patch
|
michal
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 3•11 years ago
|
||
This will be fixed when the new cache will be enabled. So far, feel free to provide a patch your self. I don't plan working on this as a top priority right now.
Assignee | ||
Comment 4•11 years ago
|
||
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Attachment #8373478 -
Flags: review?(michal.novotny)
Comment 5•11 years ago
|
||
Comment on attachment 8373478 [details] [diff] [review]
v1
Review of attachment 8373478 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/cache2/CacheFileIOManager.cpp
@@ +929,5 @@
> nsresult rv;
>
> nsCOMPtr<nsIFile> directory;
>
> + CacheObserver::ParentDirOverride(getter_AddRefs(directory));
I think CacheObserver::ParentDirOverride() should either return a clone or we need to clone it here since we append a leaf to this nsIFile a few lines below.
Attachment #8373478 -
Flags: review?(michal.novotny) → review-
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Michal Novotny (:michal) from comment #5)
> Comment on attachment 8373478 [details] [diff] [review]
> v1
>
> Review of attachment 8373478 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: netwerk/cache2/CacheFileIOManager.cpp
> @@ +929,5 @@
> > nsresult rv;
> >
> > nsCOMPtr<nsIFile> directory;
> >
> > + CacheObserver::ParentDirOverride(getter_AddRefs(directory));
>
> I think CacheObserver::ParentDirOverride() should either return a clone or
> we need to clone it here since we append a leaf to this nsIFile a few lines
> below.
But we clone before adding the leaf.
Assignee | ||
Updated•11 years ago
|
Attachment #8373478 -
Flags: review- → review?(michal.novotny)
Assignee | ||
Comment 7•11 years ago
|
||
To make it more clear:
914 nsresult
915 CacheFileIOManager::OnProfile()
916 {
917 LOG(("CacheFileIOManager::OnProfile() [gInstance=%p]", gInstance));
918
919 MOZ_ASSERT(gInstance);
920
921 nsresult rv;
922
923 nsCOMPtr<nsIFile> directory;
924
...
942
943 if (directory) {
Here is the clone:
944 rv = directory->Clone(getter_AddRefs(gInstance->mCacheDirectory));
945 NS_ENSURE_SUCCESS(rv, rv);
946
947 rv = gInstance->mCacheDirectory->Append(NS_LITERAL_STRING("cache2"));
948 NS_ENSURE_SUCCESS(rv, rv);
949 }
950
951 return NS_OK;
952 }
Comment 8•11 years ago
|
||
Right, I've looked into my tree where I have CacheIndex patch applied and it exchanges Clone() and Append(). The current code is wrong since for a very short time we have a wrong path (without the leaf) in mCacheDirectory between Append() and Clone(). Anyway, NS_GetSpecialDirectory() returns either a new file or a cloned file if it is cached, i.e. always returns a file that the caller can modify as needed. CacheObserver::ParentDirOverride() should do the same to be consistent. And call to Clone() should be removed from CacheFileIOManager::OnProfile() since it is not necessary.
Assignee | ||
Comment 9•11 years ago
|
||
- clones inside CacheObserver::ParentDirOverride
- clone at OnProfile removed
Attachment #8373478 -
Attachment is obsolete: true
Attachment #8373478 -
Flags: review?(michal.novotny)
Attachment #8377710 -
Flags: review?(michal.novotny)
Assignee | ||
Comment 10•11 years ago
|
||
Michal, ping on review. It's actually quite unfortunate this didn't make it for the trial regardless how simple the patch is, people complain!
Comment 11•11 years ago
|
||
Add me as a user interested in seeing this. Under Windows, I use browser.cache.disk.parent_directory to put the cache on a ramdisk. (I have a fast broadband connection, and am not concerned about preserving cache between boots.) Under Linux, I put it in POSIX shared memory in /dev/shm. I want to be able to do the same for cache2.
Updated•11 years ago
|
Attachment #8377710 -
Flags: review?(michal.novotny) → review+
Assignee | ||
Comment 12•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Flags: in-testsuite-
Comment 13•11 years ago
|
||
Comment 14•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•