RESOLVED FIXED 44874
Handle MediaQueryExp memory management exclusively with smart pointers
https://bugs.webkit.org/show_bug.cgi?id=44874
Summary Handle MediaQueryExp memory management exclusively with smart pointers
Maciej Stachowiak
Reported 2010-08-30 09:16:56 PDT
Handle MediaQueryExp memory management exclusively with smart pointers
Attachments
Patch (23.06 KB, patch)
2010-08-30 09:22 PDT, Maciej Stachowiak
darin: review+
Maciej Stachowiak
Comment 1 2010-08-30 09:22:40 PDT
Darin Adler
Comment 2 2010-08-30 09:26:39 PDT
Comment on attachment 65922 [details] Patch I think we can use Vector<OwnPtr> almost everywhere we do deleteAllValues. > +inline PassOwnPtr<MediaQueryExp> MediaQueryExp::create(const AtomicString& mediaFeature, CSSParserValueList* values) > +{ > + return adoptPtr(new MediaQueryExp(mediaFeature, values)); > +} The pattern I've been using on these is to put the create function into the .cpp file and marking the constructor inline. I think this results in the same amount of function call overhead, and more code sharing between call sites of the create function. r=me
WebKit Review Bot
Comment 3 2010-08-30 09:28:39 PDT
Attachment 65922 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 JavaScriptCore/wtf/NonCopyingSort.h:27: #ifndef header guard has wrong style, please use: NonCopyingSort_h [build/header_guard] [5] JavaScriptCore/wtf/NonCopyingSort.h:32: Use 'using namespace std;' instead of 'using std::swap;'. [build/using_std] [4] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Joseph Pecoraro
Comment 4 2010-08-30 10:10:08 PDT
Comment on attachment 65922 [details] Patch > Index: WebCore/ChangeLog > =================================================================== > + Gace MediaQueryExp a create function, made the constructor private, and followed If you haven't landed yet. Typo: "Gace" => "Gave"
Maciej Stachowiak
Comment 5 2010-09-08 04:08:31 PDT
Note You need to log in before you can comment on or make changes to this bug.