"view-source:" doesn't load HTML from AppCache

RESOLVED FIXED in mozilla15

Status

()

Core
Networking: Cache
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: timdream, Assigned: mayhemer)

Tracking

Trunk
mozilla15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Step to reproduce:

1. Go to a AppCache enabled website, make sure it's cached
2. Verified it is AppCache'd by checking about:cache?device=offline
3. Delete the HTTP cache (Preference -> Advanced -> Network -> Cached Web Content -> Clear Now)
4. Go offline (File -> Work Offline)
5. Go back to the website, it should load from AppCache
6. View source (cmd+U)

Expected result:

* view the source code

Actual result:

* Problem loading page

==

It's very tricky to reproduce the behavior in Firefox, but in B2G Gaia we test our apps by inserting offline AppCache directly into the profile with a fictitious hostname, that makes the behavior easy to surface (with the view source hardware key from in our dev preview phone)

Is it possible to make view-source to access not only HTTP cache but also AppCache?
Component: Networking: Cache → View Source
Product: Core → Toolkit
QA Contact: networking.cache → view.source
No, this was in the right place.  Necko is what's not hitting the appcache here.  The toolkit code is just using the APIs core exposes for this stuff.
Component: View Source → Networking: Cache
Product: Toolkit → Core
QA Contact: view.source → networking.cache
(In reply to Boris Zbarsky (:bz) from comment #1)
> No, this was in the right place.  Necko is what's not hitting the appcache
> here.  The toolkit code is just using the APIs core exposes for this stuff.

Oh thanks.
(Assignee)

Comment 3

5 years ago
I'll look at this.  I suspect this may be complicated, though...
Assignee: nobody → honzab.moz
(Assignee)

Comment 4

5 years ago
Created attachment 623113 [details] [diff] [review]
v1

It was damn easy! :)  Just let nsViewSourceChannel implement and forward nsIApplicatonCacheChannel.
Attachment #623113 - Flags: review?(bzbarsky)
(Assignee)

Updated

5 years ago
Status: NEW → ASSIGNED
Comment on attachment 623113 [details] [diff] [review]
v1

r=me
Attachment #623113 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 6

5 years ago
Comment on attachment 623113 [details] [diff] [review]
v1

https://hg.mozilla.org/integration/mozilla-inbound/rev/c5023518db2f
Attachment #623113 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/c5023518db2f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
Depends on: 754588
This patch may have triggered a new intermittent leak in mochitests (bug 754588).  Any thoughts on whether or how that might be related?
You need to log in before you can comment on or make changes to this bug.