Handle MediaQueryExp memory management exclusively with smart pointers
Created attachment 65922 [details] Patch
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
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.
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"
Committed r66968: <http://trac.webkit.org/changeset/66968>