[Webkit-unassigned] [Bug 136112] New: Clean up DiskCacheMonitor object memory management after bug 135896

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 20 11:20:49 PDT 2014


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

           Summary: Clean up DiskCacheMonitor object memory management
                    after bug 135896
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: psolanki at apple.com


In <https://bugs.webkit.org/show_bug.cgi?id=135896#c11>, Darin commented

> > Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm:53
> > +    new NetworkDiskCacheMonitor(cachedResponse, loader); // Balanced by adoptPtr in the blocks setup in the DiskCacheMonitor constructor, one of which is guaranteed to run.
> 
> Should be "set up" rather than "setup".
> 
> This is a bad situation; code to implement this unconventional storage management is now spread across two classes, with the new call in the derived class and the adoptPtr in the base class. It’s really easy to get that wrong. Can we find a more straightforward idiom for this? I think we should consider moving the logic from the DiskCacheMonitor constructor into a separate function that takes a std::unique_ptr to get rid of this strangeness.

---

We should clean up this code and make the memory management more sane once my fix for bug 135896 lands.

-- 
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