Closed
Bug 1165256
Opened 10 years ago
Closed 10 years ago
use origin for app_cache
Categories
(Core :: Networking: Cache, defect, P2)
Core
Networking: Cache
Tracking
()
RESOLVED
FIXED
FxOS-S8 (02Oct)
People
(Reporter: allstars.chh, Assigned: mayhemer)
References
Details
(Whiteboard: must land on 43)
Attachments
(1 file, 4 obsolete files)
|
82.30 KB,
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
We implemented app caches for apps on B2G back in Bug 751754 and Bug 786299.
For the new security model we will update nsIPrincipal.origin in Bug 1163254.
So for app_cache it should use the origin, instead of {appId, isBrowser}, for example in
nsIApplicationCacheService.idl, and nsIOfflineCacheUpdate.idl.
| Assignee | ||
Comment 1•10 years ago
|
||
Here applies similar as in bug 1165269. Also offline cache is an unmaintained code about to be removed. No dates/more details avail now tho.
| Assignee | ||
Comment 2•10 years ago
|
||
See bug 1165269 comment 3. This may "just work" when we fix that bug.
Assignee: nobody → honzab.moz
Updated•10 years ago
|
Blocks: nsec-origins
| Assignee | ||
Comment 3•10 years ago
|
||
How can I at [1] get OriginAttributes instead of "just" nsILoadContext?
[1] http://hg.mozilla.org/mozilla-central/annotate/f61c3cc0eb8b/dom/offline/nsDOMOfflineResourceList.cpp#l809
Flags: needinfo?(jonas)
| Assignee | ||
Comment 4•10 years ago
|
||
(The motivation is to covert nsApplicationCacheService::BuildGroupIDForApp to take OriginAttributes, or maybe be removed/renamed to something else working with OA)
| Assignee | ||
Comment 5•10 years ago
|
||
This bug should mainly fix:
- nsIApplicationCacheService.buildGroupIDForApp to take either directly OriginAttributes (as a jsval?) or be removed completely and convert existing code to use the nsILoadContextInfo variant "buildGroupID".
- nsIOfflineCacheUpdate* methods taking appid/inbrowser to accept OriginAttributes
As I understand, I can always obtain OriginAttributes from nsIPrincipal.
| Assignee | ||
Comment 6•10 years ago
|
||
One more question, how should I use/obtain OriginAttributes at [1]?
[1] http://hg.mozilla.org/mozilla-central/annotate/56a6c786bdb0/dom/apps/Webapps.jsm#l1955
| Reporter | ||
Comment 7•10 years ago
|
||
(In reply to Honza Bambas (not reviewing) (:mayhemer) from comment #3)
> How can I at [1] get OriginAttributes instead of "just" nsILoadContext?
>
> [1]
> http://hg.mozilla.org/mozilla-central/annotate/f61c3cc0eb8b/dom/offline/
> nsDOMOfflineResourceList.cpp#l809
I am adding OriginAttributes into nsILoadContext in Bug 1165466.
(In reply to Honza Bambas (not reviewing) (:mayhemer) from comment #6)
> One more question, how should I use/obtain OriginAttributes at [1]?
>
> [1]
> http://hg.mozilla.org/mozilla-central/annotate/56a6c786bdb0/dom/apps/Webapps.
> jsm#l1955
If aApp is an instance of mozIApplication, it has a 'principal' attribute. (bug 1168783).
If not we usually pass the dictionaty of OriginAttributes.
{ appId: aApp.localId }
Flags: needinfo?(jonas)
Updated•10 years ago
|
Priority: -- → P2
Target Milestone: --- → FxOS-S8 (02Oct)
| Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 10•10 years ago
|
||
| Assignee | ||
Comment 11•10 years ago
|
||
adding bug 1199295 to the dep list since it changes the offline app APIs in prefetch to pass down principal, will base a much simpler patch on it here. OriginAttributes can be extracted from principals (with bug 1165466).
Depends on: 1199295
| Assignee | ||
Updated•10 years ago
|
Whiteboard: must land on 43
| Reporter | ||
Comment 12•10 years ago
|
||
mark this also blocks Bug 1168777, for AppCacheClearDataObserver in nsApplicationCacheService.cpp should also listen to clear-origin-data and clear the cache accordingly.
Updated•10 years ago
|
QA Whiteboard: [COM=NSec]
| Assignee | ||
Comment 13•10 years ago
|
||
- rebased
- builds
- fails
Attachment #8656047 -
Attachment is obsolete: true
| Assignee | ||
Comment 14•10 years ago
|
||
- pattern match
- builds
- no more data..
Attachment #8681363 -
Attachment is obsolete: true
Comment 15•10 years ago
|
||
Honza, any updates here?
| Assignee | ||
Comment 16•10 years ago
|
||
(In reply to Tanvi Vyas [:tanvi] from comment #15)
> Honza, any updates here?
In two weeks I may have a production quality patch.
| Assignee | ||
Comment 17•10 years ago
|
||
goal was to make appcache code respect origin attributes suffix string for isolation. to obtain origin attrs in nsOfflineCacheUpdate I use the loading principal which is identical source for appid/inbrowser in the current code. In the cache code itself further I use nsILoadContextInfo (from cache2 apis) or internally directly the suffix string as appropriate. the patch also impls clear-origin-data properly.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=bae9785efd4c
Attachment #8681383 -
Attachment is obsolete: true
Attachment #8709191 -
Flags: review?(jduell.mcbugs)
Comment 18•10 years ago
|
||
Comment on attachment 8709191 [details] [diff] [review]
v1
Review of attachment 8709191 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for doing all this fun stuff Honza :)
Attachment #8709191 -
Flags: review?(jduell.mcbugs) → review+
| Assignee | ||
Comment 19•10 years ago
|
||
One more detail left to fix:
chrome://mochitests/content/browser/browser/base/content/test/general/browser_sanitizeDialog.js:557 - TypeError: appcacheserv.buildGroupID is not a function
| Assignee | ||
Comment 20•10 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=bae9785efd4c - where BC7 is FIXED in the v1.1 patch.
Attachment #8709191 -
Attachment is obsolete: true
Attachment #8710015 -
Flags: review+
| Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 21•10 years ago
|
||
Keywords: checkin-needed
Comment 22•10 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•