Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: third_party/WebKit/Source/core/css/MediaQueryExp.h

Issue 2873433003: Move MediaQuery classes off BlinkGC heap (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/MediaQueryExp.h
diff --git a/third_party/WebKit/Source/core/css/MediaQueryExp.h b/third_party/WebKit/Source/core/css/MediaQueryExp.h
index c2193a6c69716f50a77dba66d23ed85a7125fb54..2d4e77107e736c5b21ca1f27c9899b5d532a99c6 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryExp.h
+++ b/third_party/WebKit/Source/core/css/MediaQueryExp.h
@@ -77,17 +77,26 @@ struct MediaQueryExpValue {
}
};
-class CORE_EXPORT MediaQueryExp
- : public GarbageCollectedFinalized<MediaQueryExp> {
+class CORE_EXPORT MediaQueryExp {
+ DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
+
public:
- static MediaQueryExp* createIfValid(const String& mediaFeature,
- const Vector<CSSParserToken, 4>&);
+ // Returns an invalid MediaQueryExp if the arguments are invalid.
+ static MediaQueryExp create(const String& mediaFeature,
+ const Vector<CSSParserToken, 4>&);
+ static MediaQueryExp invalid() {
+ return MediaQueryExp(String(), MediaQueryExpValue());
+ }
+
+ MediaQueryExp(const MediaQueryExp& other);
~MediaQueryExp();
const String& mediaFeature() const { return m_mediaFeature; }
MediaQueryExpValue expValue() const { return m_expValue; }
+ bool isValid() const { return !m_mediaFeature.isNull(); }
+
bool operator==(const MediaQueryExp& other) const;
bool isViewportDependent() const;
@@ -96,11 +105,6 @@ class CORE_EXPORT MediaQueryExp
String serialize() const;
- MediaQueryExp* copy() const { return new MediaQueryExp(*this); }
-
- MediaQueryExp(const MediaQueryExp& other);
-
- DEFINE_INLINE_TRACE() {}
private:
MediaQueryExp(const String&, const MediaQueryExpValue&);
« no previous file with comments | « third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp ('k') | third_party/WebKit/Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698