Last Comment Bug 748240 - "view-source:" doesn't load HTML from AppCache
: "view-source:" doesn't load HTML from AppCache
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Networking: Cache (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla15
Assigned To: Honza Bambas (:mayhemer)
:
Mentors:
Depends on: 754588
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-23 22:47 PDT by Tim Guan-tin Chien [:timdream] (please needinfo)
Modified: 2012-05-13 17:45 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (4.12 KB, patch)
2012-05-11 06:23 PDT, Honza Bambas (:mayhemer)
bzbarsky: review+
honzab.moz: checkin+
Details | Diff | Splinter Review

Description Tim Guan-tin Chien [:timdream] (please needinfo) 2012-04-23 22:47:23 PDT
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?
Comment 1 Boris Zbarsky [:bz] 2012-05-07 18:39:15 PDT
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.
Comment 2 Tim Guan-tin Chien [:timdream] (please needinfo) 2012-05-08 07:46:03 PDT
(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.
Comment 3 Honza Bambas (:mayhemer) 2012-05-11 05:42:28 PDT
I'll look at this.  I suspect this may be complicated, though...
Comment 4 Honza Bambas (:mayhemer) 2012-05-11 06:23:51 PDT
Created attachment 623113 [details] [diff] [review]
v1

It was damn easy! :)  Just let nsViewSourceChannel implement and forward nsIApplicatonCacheChannel.
Comment 5 Boris Zbarsky [:bz] 2012-05-11 22:20:47 PDT
Comment on attachment 623113 [details] [diff] [review]
v1

r=me
Comment 7 Matt Brubeck (:mbrubeck) 2012-05-12 09:05:28 PDT
https://hg.mozilla.org/mozilla-central/rev/c5023518db2f
Comment 8 Matt Brubeck (:mbrubeck) 2012-05-13 17:34:05 PDT
This patch may have triggered a new intermittent leak in mochitests (bug 754588).  Any thoughts on whether or how that might be related?

Note You need to log in before you can comment on or make changes to this bug.