Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Issue 7056006: QuotaManager::GetUsageAndQuota should not hung when the returned usage is negative (Closed)

Created:
9 years, 7 months ago by kinuko
Modified:
9 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, michaeln
Visibility:
Public.

Description

QuotaManager::GetUsageAndQuota should not hung even when the returned usage/quota value is negative BUG=none TEST=QuotaManager.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86266

Patch Set 1 #

Total comments: 4

Patch Set 2 : rebased #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -28 lines) Patch
M webkit/quota/quota_manager.cc View 1 2 7 chunks +34 lines, -28 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
kinuko
9 years, 7 months ago (2011-05-20 08:45:40 UTC) #1
Dai Mikurube (NOT FULLTIME)
Basically LGTM with some nits.
9 years, 7 months ago (2011-05-20 09:16:42 UTC) #2
Dai Mikurube (NOT FULLTIME)
Sorry, I wrongly clicked the button. http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc File webkit/quota/quota_manager.cc (right): http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc#newcode169 webkit/quota/quota_manager.cc:169: ++waiting_callbacks_; Counting this ...
9 years, 7 months ago (2011-05-20 09:19:08 UTC) #3
kinuko
http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc File webkit/quota/quota_manager.cc (right): http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc#newcode169 webkit/quota/quota_manager.cc:169: ++waiting_callbacks_; On 2011/05/20 09:19:08, Dai Mikurube wrote: > Counting ...
9 years, 7 months ago (2011-05-20 09:27:22 UTC) #4
tzik
LGTM
9 years, 7 months ago (2011-05-20 13:41:35 UTC) #5
Dai Mikurube (NOT FULLTIME)
LGTM if the following comment is ok. http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc File webkit/quota/quota_manager.cc (right): http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc#newcode169 webkit/quota/quota_manager.cc:169: ++waiting_callbacks_; On ...
9 years, 7 months ago (2011-05-23 02:16:11 UTC) #6
kinuko
http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc File webkit/quota/quota_manager.cc (right): http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc#newcode169 webkit/quota/quota_manager.cc:169: ++waiting_callbacks_; On 2011/05/23 02:16:11, Dai Mikurube wrote: > On ...
9 years, 7 months ago (2011-05-23 03:31:54 UTC) #7
Dai Mikurube (NOT FULLTIME)
9 years, 7 months ago (2011-05-23 04:32:22 UTC) #8
On 2011/05/23 03:31:54, kinuko wrote:
> http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc
> File webkit/quota/quota_manager.cc (right):
> 
>
http://codereview.chromium.org/7056006/diff/1/webkit/quota/quota_manager.cc#n...
> webkit/quota/quota_manager.cc:169: ++waiting_callbacks_;
> On 2011/05/23 02:16:11, Dai Mikurube wrote:
> > On 2011/05/20 09:27:23, kinuko wrote:
> > > On 2011/05/20 09:19:08, Dai Mikurube wrote:
> > > > Counting this up when generating looks a little strange for me.  How
about
> > > when
> > > > calling GetGlobalUsage?  (The same for other functions.)
> > > 
> > > GetGlobalUsage() etc is called in subclasses and I wanted to make the base
> > class
> > > provide some 'automatic' mechanism for them (but I know what you mean).
> > > 
> > > Alternatively I could add a protected method like AddWaitingCallback()
that
> > just
> > > increments waiting_callbacks_ and make subclasses call it each time it
makes
> > > additional request that takes callback.  I thought this might look a bit
> > > redundant but wdyt.
> > 
> > I guess you mean adding AddWaitingCallback(), for example, after (or before)
> >     manager()->temporary_usage_tracker_->GetGlobalUsage(
> >         NewGlobalUsageCallback());
> > in RunBody() of sub classes like UsageAndQuotaDispatcherTaskForTemporary.
> > 
> > I agree with it.  It's more reasonable than the current code.
> 
> That was what I meant when I wrote the previous comment but instead I did
> following in patch 3:
> - kept the '++waiting_callbacks' code in NewXxxCallback method
> - renamed NewXxxCallback to NewWaitableXxxCallback to explicitly indicate that
> they are the methods that create a new waiting point (i.e. creates a new
> callback which decrements waiting_callbacks when it is called).  I also added
a
> comment about that.  ptal thanks.

Make sense.  LGTM.

Powered by Google App Engine
This is Rietveld 408576698