AppCache: Remove WeakPtrFactory from AppCacheResponseIO.
AppCacheResponseIO is an abstract (with pure virtual methods) base class for classes that also use WeakPtrFactories. Some method in the base class currently use the WeakPtrFactory embedded in the base class to vend WeakPtrs, which will point to instances of the derived classes. These pointers will be invalidated when the base class' WeakPtrFactory is destroyed. So, there is a time window when the weak pointers are valid, but the members in derived classes are being destroyed. To avoid reasoning about such complexities, this CL removes the WeakPtrFactory in the base class. Instead, base class methods use a virtual method to get weak pointers from the derived classes' factories. Change-Id: I343a0e1159d839b0f71fb09518704ce560b2c5ad Reviewed-on: https://chromium-review.googlesource.com/1188825Reviewed-by:Joshua Bell <jsbell@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#586360}
Showing
Please register or sign in to comment