Code ensures that m_expressions is never null so we can just return a reference.
Created attachment 209479 [details] Patch
Comment on attachment 209479 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=209479&action=review > Source/WebCore/css/MediaQueryEvaluator.cpp:145 > - const Vector<OwnPtr<MediaQueryExp> >* exps = query->expressions(); > + const Vector<OwnPtr<MediaQueryExp> >& exps = query->expressions(); Since you are touching every line with this variable on it, you could also rename it to "expressions" while you're here :)
Comment on attachment 209479 [details] Patch Attachment 209479 [details] did not pass qt-ews (qt): Output: http://webkit-queues.appspot.com/results/1523967
Comment on attachment 209479 [details] Patch Attachment 209479 [details] did not pass qt-wk2-ews (qt-wk2): Output: http://webkit-queues.appspot.com/results/1542358
Comment on attachment 209479 [details] Patch Attachment 209479 [details] did not pass efl-wk2-ews (efl-wk2): Output: http://webkit-queues.appspot.com/results/1558051
Comment on attachment 209479 [details] Patch Attachment 209479 [details] did not pass efl-ews (efl): Output: http://webkit-queues.appspot.com/results/1555303
Created attachment 209491 [details] Patch
Attachment 209491 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/css/MediaList.cpp', u'Source/WebCore/css/MediaQuery.cpp', u'Source/WebCore/css/MediaQuery.h', u'Source/WebCore/css/MediaQueryEvaluator.cpp']" exit_code: 1 Source/WebCore/css/MediaQueryEvaluator.cpp:145: Missing spaces around >> [whitespace/operators] [3] Source/WebCore/css/MediaList.cpp:331: Missing spaces around >> [whitespace/operators] [3] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 209491 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=209491&action=review > Source/WebCore/css/MediaQuery.cpp:82 > +MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<ExpressionVector> exprs) Didn’t we decide that this should be PassOwnPtr<Vector<OwnPtr<MediaQueryExp>>>?
Comment on attachment 209491 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=209491&action=review >> Source/WebCore/css/MediaQuery.cpp:82 >> +MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<ExpressionVector> exprs) > > Didn’t we decide that this should be PassOwnPtr<Vector<OwnPtr<MediaQueryExp>>>? Since this was in MediaQuery.cpp, I felt it was okay to use the internal typedef ExpressionVector. Header says PassOwnPtr<Vector<OwnPtr<MediaQueryExp>>> for clarity.
Actually, MediaQuery.h uses ExpressionVector in some of it's public methods. We should just use Vector<OwnPtr<MediaQueryExp>> there to be clearer for callers. I'll make that change and land. Thanks for the review.
Committed r154533: <http://trac.webkit.org/changeset/154533>