AppCache: Ensure inflight ActiveCalls are not destroyed
commit25d1cd1fefacd75c8537ebdc4b2f4ef11a01bdba
authornhiroki <nhiroki@chromium.org>
Sat, 16 May 2015 00:42:27 +0000 (15 17:42 -0700)
committerCommit bot <commit-bot@chromium.org>
Sat, 16 May 2015 00:42:31 +0000 (16 00:42 +0000)
treec5fa96b5c38abdca0152f91d96f49bbacf4802b9
parent6cd3b230c3b280a037efb2db8048e4cda4f69fbc
AppCache: Ensure inflight ActiveCalls are not destroyed

Before this CL, AppCacheDiskCache could delete inflight ActiveCalls without
any abort operation when the backend is disabled, so callbacks bound with
ActiveCall objects are invoked in broken state.

After this CL, ActiveCall hides its constructor and manages its own lifetime
using refptr, so AppCacheDiskCache no longer has to take care of their
lifetime. In addition, AppCacheDiskCache passes its weakptr to ActiveCall,
which in turn checks it when an operation is completed. If the backend is
closed, ActiveCall closes the entry and returns net::ERR_ABORTED.

BUG=488757
TEST=n/a

Review URL: https://codereview.chromium.org/1136373003

Cr-Commit-Position: refs/heads/master@{#330250}
content/browser/appcache/appcache_disk_cache.cc
content/browser/appcache/appcache_disk_cache.h