WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
136112
Clean up DiskCacheMonitor object memory management after
bug 135896
https://bugs.webkit.org/show_bug.cgi?id=136112
Summary
Clean up DiskCacheMonitor object memory management after bug 135896
Pratik Solanki
Reported
2014-08-20 11:20:57 PDT
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug