[Webkit-unassigned] [Bug 40627] Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 29 17:20:10 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40627





--- Comment #38 from Joseph Pecoraro <joepeck at webkit.org>  2010-07-29 17:20:10 PST ---
(In reply to comment #37)
> WebCore/loader/appcache/ApplicationCacheGroup.cpp:1024
>  +      RefPtr<Frame> frameProtector = m_frame;
>  +      OriginQuotaReachedCallbackTimer* timer = new OriginQuotaReachedCallbackTimer(this, frameProtector.get());
> 
> Do you really need a frameProtector if the OriginQuotaReachedCallbackTimer keeps its own RefPtr<> to the frame?

I will look into this. I could use some guidance on lifetime management. While the manifest
resources are downloading there is a Frame. However, OriginQuotaReachedCallbackTimer
is triggered asynchronously  at which point the frame could have been deleted. I try and
keep it around, so that when the callback triggers it can notify the client via:

  frame->page()->chrome()->client()->reachedApplicationCacheOriginQuota(m_origin.get());

I was worried that because the callback runs asynchronously I would need to protect the
Frame. However, now I think that even with the protector, the Frame's page() could have been
deleted. I'll look into this a bit more.


> WebKit/WebKit.xcodeproj/project.pbxproj: 
>  -          51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51079D140CED11B00077247D /* WebSecurityOrigin.mm */; };
> 
> Please don't delete and the re-add files to the Xcode project file.  It causes more work when merging
> later, and creates unnecessary churn.  Please revert the project file and then move existing files and add
> the new files to fix this.

I seem to recall moved the file between groups. From WebView to WebCoreSupport,
or something similar. I should have mentioned this in the ChangeLog.


> WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm:40
>  +      return 0;
> 
> Just add the #endif above this line instead of having an #else / return 0; / #endif.

I thought this would produce an "unreachable statement" if the #if condition was
true. The produced could would look like:

  return ...;
  return 0;



>  +  @protocol WebSecurityOriginQuotaManagement;
>  +  @protocol WebSecurityOriginQuotaManagementUnsigned;
> r=me assuming you can explain or remove the mysterious @protocols used.  :)

Sorry about that, this is stale code. I'll remove them. I did a few iterations
here learning Obj-C and writing a "good" typed interface that respected
the types of the quotas.

This was because the Database's quota is (unsigned long long)
and the ApplicationCacheQuota is (long long). I ended up removing it
all, because it would make a change to the existing public API. I've
considered changing ApplicationCache's quota to be unsigned because
logically it makes sense to have the quota be unsigned. The reason I went
with just (long long) was because the value is stored in SQLite, which really
does store it as signed, so there would be downcast.

I am working on opening a bug for this, I just have to verify I can make
it happen.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list