Closed Bug 1218087 Opened 5 years ago Closed 5 years ago

NS_ERROR_FAILURE: Failure arg 0 [nsICacheStorageService.diskCacheStorage] in pageInfo.js and metadata.js; [nsICacheStorageService.appCacheStorage] in pref-offlineapps.js

Categories

(SeaMonkey :: Page Info, defect)

defect
Not set
normal

Tracking

(seamonkey2.41 fixed)

RESOLVED FIXED
seamonkey2.41
Tracking Status
seamonkey2.41 --- fixed

People

(Reporter: philip.chee, Assigned: philip.chee)

References

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Depends on: 1165269
Philip, to fix this I need lot more data.
Assignee: nobody → honzab.moz
Flags: needinfo?(philip.chee)
Sat Oct 24 2015 05:49:36
Error: NS_ERROR_FAILURE: Failure arg 0 [nsICacheStorageService.diskCacheStorage]
Source file: chrome://navigator/content/metadata.js
Line: 171

Sat Oct 24 2015 05:50:55
Error: NS_ERROR_FAILURE: Failure arg 0 [nsICacheStorageService.appCacheStorage]
Source file: chrome://communicator/content/pref/pref-offlineapps.js
Line: 63

Sat Oct 24 2015 05:55:28
Error: NS_ERROR_FAILURE: Failure arg 0 [nsICacheStorageService.diskCacheStorage]
Source file: chrome://navigator/content/pageinfo/pageInfo.js
Line: 227
(In reply to Honza Bambas (:mayhemer) from comment #1)
> Philip, to fix this I need lot more data.
Apologies. This is a bug in SeaMonkey. We need to update our code to take into account changes in 1165269.
Assignee: honzab.moz → nobody
Flags: needinfo?(philip.chee)
Attached patch Patch v1.0 Proposed fix (obsolete) — Splinter Review
> -const ALLOW = Services.perms.ALLOW_ACTION;         // 1
> -const BLOCK = Services.perms.DENY_ACTION;          // 2
> -const SESSION = nsICookiePermission.ACCESS_SESSION;// 8
> +const ALLOW = Services.perms.ALLOW_ACTION;                               // 1
> +const BLOCK = Services.perms.DENY_ACTION;                                // 2
> +const SESSION = Components.interfaces.nsICookiePermission.ACCESS_SESSION;// 8
Lexical global const whinge whinge
Assignee: nobody → philip.chee
Status: NEW → ASSIGNED
Attachment #8678470 - Flags: review?(neil)
Note that you may want to build the loadcontextinfo object from a window, if you have it.  Only that way you respect origin attributes from the attached principal.

I probably had never introduced default and private properties on the factory.  It's a footgun.
(In reply to Honza Bambas (:mayhemer) from comment #5)
> Note that you may want to build the loadcontextinfo object from a window, if
> you have it.  Only that way you respect origin attributes from the attached
> principal.
Can you explain why we need to respect the origin attributes?
Fix typo in previous patch.
Attachment #8678470 - Attachment is obsolete: true
Attachment #8678470 - Flags: review?(neil)
Attachment #8678583 - Flags: review?(neil)
Attachment #8678595 - Flags: review?(neil)
Attachment #8678583 - Attachment is obsolete: true
Attachment #8678583 - Flags: review?(neil)
(In reply to Philip Chee from comment #6)
> (In reply to Honza Bambas (:mayhemer) from comment #5)
> > Note that you may want to build the loadcontextinfo object from a window, if
> > you have it.  Only that way you respect origin attributes from the attached
> > principal.
> Can you explain why we need to respect the origin attributes?

I'd expect it to be obvious.  Anyway, the cache identifies cache entries by the following keying: origin-attributes-suffix + is-anonymous-load + is-private + URL.  For normal browsing you must respect the "jar" by building the nsILoadContextInfo object correctly, usually from nsILoadContext or nsIPrincipal passed down to your code.

Depends on the context, if you only work with entries that have no origin attributes such as appid, user-context etc, you are ok to use the "default" or "private" load context info object offered by the factory.

You have to know what your are doing.  Remember the new cache (cache2) API is more selective about the load context then the old API.
*than the old API.
Comment on attachment 8678595 [details] [diff] [review]
Patch v1.2 more fixes.

>+const LoadContextInfo = Components.classes["@mozilla.org/load-context-info-factory;1"]
>+                                  .getService(Components.interfaces.nsILoadContextInfoFactory);
Nit: put this inside the if (img) block.

>+const LoadContextInfo = Components.classes["@mozilla.org/load-context-info-factory;1"]
>+                                  .getService(Components.interfaces.nsILoadContextInfoFactory)
>+                                  [opener.gPrivate ? "private" : "default"];
Nit: I preferred the way you did it in metadata.js

>-const SESSION = nsICookiePermission.ACCESS_SESSION;// 8
>+const SESSION = Components.interfaces.nsICookiePermission.ACCESS_SESSION;// 8
This is the only user of nsICookiePermission, so just move that instead.
Attachment #8678595 - Flags: review?(neil) → review+
Pushed to comm-central: http://hg.mozilla.org/comm-central/rev/fda4f691250e
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.41
You need to log in before you can comment on or make changes to this bug.