Last Comment Bug 760380 - Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache
: Stop calling mOfflineCacheEntry->GetLastModified when processing response fro...
Status: RESOLVED FIXED
: main-thread-io, perf
Product: Core
Classification: Components
Component: Networking: HTTP (show other bugs)
: Trunk
: All All
: P1 normal (vote)
: mozilla16
Assigned To: Brian Smith (:briansmith, :bsmith, use NEEDINFO?)
:
Mentors:
Depends on: 722034
Blocks: 717761 759886
  Show dependency treegraph
 
Reported: 2012-05-31 23:53 PDT by Brian Smith (:briansmith, :bsmith, use NEEDINFO?)
Modified: 2012-06-28 15:31 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache (2.10 KB, patch)
2012-05-31 23:53 PDT, Brian Smith (:briansmith, :bsmith, use NEEDINFO?)
no flags Details | Diff | Review
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache [v2] (2.87 KB, patch)
2012-06-12 12:08 PDT, Brian Smith (:briansmith, :bsmith, use NEEDINFO?)
honzab.moz: review+
Details | Diff | Review

Description Brian Smith (:briansmith, :bsmith, use NEEDINFO?) 2012-05-31 23:53:25 PDT
Created attachment 629088 [details] [diff] [review]
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache

+++ This bug was initially created as a clone of Bug #722034 +++

This was Part 7 of the series of patches in Bug #722034. Since it wasn't strictly necessary, and we needed to land that series ASAP, I moved this patch to this new bug.

(In reply to Brian Smith (:bsmith) from comment #58)
> Created attachment 628515 [details] [diff] [review]
> Part 7 - Stop calling mOfflineCacheEntry->GetLastModified when processing
> response from normal cache, r?honzab
> 
> This patch simply moves the call to mOfflineCacheEntry->GetLastModified to
> OnOfflineCacheEntryForWritingAvailable, to remove the last non-error,
> pre-validation access to cache entries from the processing of normal cache
> entries. We We will still do parts of the offline cache entry processing on
> the the main thread temporarily (see bug 759886 and bug 759889) but this is
> the best place to put this access for now.

(In reply to Brian Smith (:bsmith) from comment #68)
> (In reply to Honza Bambas (:mayhemer) from comment #66)
> > Comment on attachment 628515 [details] [diff] [review]
> > Part 7 - Stop calling mOfflineCacheEntry->GetLastModified when processing
> > response from normal cache, r?honzab
> > 
> > Why is this patch needed?
> 
> I tried to explain in Bug 722034 comment 58. It isn't strictly needed, 
> because I am just moving it from one place executed on the main thread to 
> another place executed on the main thread. But, long term, we cannot call
> mOfflineCacheEntry->GetLastModified in ShouldUpdateOfflineCachEntry because
> ShouldUpdateOfflineCachEntry will always be called on the main thread, and
> mOfflineCacheEntry->GetLastModified takes the cache service lock. And, after
> bug 759889 is fixed, we will stop calling
> nsHttpChannel::OnOfflineCacheEntryForWritingAvailable on the main thread.
Comment 1 Honza Bambas (:mayhemer) 2012-06-03 05:32:34 PDT
Comment on attachment 629088 [details] [diff] [review]
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache

Review of attachment 629088 [details] [diff] [review]:
-----------------------------------------------------------------

The logic looks good, but... where do you read mOfflineCacheLastModifiedTime ?  The patch seems incomplete.
Comment 2 Brian Smith (:briansmith, :bsmith, use NEEDINFO?) 2012-06-03 14:01:00 PDT
(In reply to Honza Bambas (:mayhemer) from comment #1)
> The logic looks good, but... where do you read mOfflineCacheLastModifiedTime
> ?  The patch seems incomplete.

In nsHttpChannel::ShouldUpdateOfflineCacheEntry.
Comment 3 Honza Bambas (:mayhemer) 2012-06-04 07:25:33 PDT
(In reply to Brian Smith (:bsmith) from comment #2)
> (In reply to Honza Bambas (:mayhemer) from comment #1)
> > The logic looks good, but... where do you read mOfflineCacheLastModifiedTime
> > ?  The patch seems incomplete.
> 
> In nsHttpChannel::ShouldUpdateOfflineCacheEntry.

But I cannot see it in the patch.  Is in some followup patch?  It doesn't make sense to separate things like this, have a patch that introduces and checks a new member, but doesn't set it.
Comment 4 Honza Bambas (:mayhemer) 2012-06-12 06:12:12 PDT
Comment on attachment 629088 [details] [diff] [review]
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache

Please re-request after I get answer to comment 3.
Comment 5 Brian Smith (:briansmith, :bsmith, use NEEDINFO?) 2012-06-12 08:59:59 PDT
Comment on attachment 629088 [details] [diff] [review]
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache

Review of attachment 629088 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/protocol/http/nsHttpChannel.cpp
@@ +3263,4 @@
>          return false;
>      }
>  
> +    if (docLastModifiedTime > mOfflineCacheLastModifiedTime) {

mOfflineCacheLastModifiedTime is used right here.
Comment 6 Honza Bambas (:mayhemer) 2012-06-12 09:02:52 PDT
(In reply to Brian Smith (:bsmith) from comment #5)
> mOfflineCacheLastModifiedTime is used right here.

Where is it set?
Comment 7 Brian Smith (:briansmith, :bsmith, use NEEDINFO?) 2012-06-12 12:08:41 PDT
Created attachment 632359 [details] [diff] [review]
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache [v2]

Sorry Honza, here's the fixed version of the patch.
Comment 8 Honza Bambas (:mayhemer) 2012-06-12 12:21:07 PDT
Comment on attachment 632359 [details] [diff] [review]
Stop calling mOfflineCacheEntry->GetLastModified when processing response from normal cache [v2]

Review of attachment 632359 [details] [diff] [review]:
-----------------------------------------------------------------

r=honzab with just a nit:

Please initialize the new member also in the constructor to 0.
Comment 9 Brian Smith (:briansmith, :bsmith, use NEEDINFO?) 2012-06-28 15:31:04 PDT
https://hg.mozilla.org/mozilla-central/rev/5030b469ca79

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