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

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

Issue 2837023005: Move MediaQuery classes off BlinkGC heap (Closed)
Patch Set: fix Created 3 years, 8 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 20f3fe710faeea8a954b5251fe180aefab04d576..6f962b39298d21c4043a648839b0feecd4e6cb4d 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& media_feature,
- const Vector<CSSParserToken, 4>&);
+ // Returns an invalid MediaQueryExp if the arguments are invalid.
+ static MediaQueryExp Create(const String& media_feature,
+ const Vector<CSSParserToken, 4>&);
+ static MediaQueryExp Invalid() {
+ return MediaQueryExp(String(), MediaQueryExpValue());
+ }
+
+ MediaQueryExp(const MediaQueryExp& other);
~MediaQueryExp();
const String& MediaFeature() const { return media_feature_; }
MediaQueryExpValue ExpValue() const { return exp_value_; }
+ bool IsValid() const { return !media_feature_.IsNull(); }
+
bool operator==(const MediaQueryExp& other) const;
bool IsViewportDependent() const;
@@ -96,12 +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&);

Powered by Google App Engine
This is Rietveld 408576698