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

Side by Side Diff: Source/core/css/MediaQueryExp.h

Issue 170283019: Change various helper classes to transition types to get CSSValue entirely onto the gc heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * CSS Media Query 2 * CSS Media Query
3 * 3 *
4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 20 matching lines...) Expand all
31 31
32 #include "core/css/CSSValue.h" 32 #include "core/css/CSSValue.h"
33 #include "core/css/MediaFeatureNames.h" 33 #include "core/css/MediaFeatureNames.h"
34 #include "wtf/PassOwnPtr.h" 34 #include "wtf/PassOwnPtr.h"
35 #include "wtf/RefPtr.h" 35 #include "wtf/RefPtr.h"
36 #include "wtf/text/AtomicString.h" 36 #include "wtf/text/AtomicString.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 class CSSParserValueList; 39 class CSSParserValueList;
40 40
41 class MediaQueryExp { 41 class MediaQueryExp : public NoBaseWillBeGarbageCollectedFinalized<MediaQueryExp > {
42 WTF_MAKE_FAST_ALLOCATED; 42 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
43 DECLARE_GC_INFO;
43 public: 44 public:
44 static PassOwnPtr<MediaQueryExp> create(const AtomicString& mediaFeature, CS SParserValueList*); 45 static PassOwnPtrWillBeRawPtr<MediaQueryExp> create(const AtomicString& medi aFeature, CSSParserValueList*);
45 ~MediaQueryExp(); 46 ~MediaQueryExp();
46 47
47 AtomicString mediaFeature() const { return m_mediaFeature; } 48 AtomicString mediaFeature() const { return m_mediaFeature; }
48 49
49 CSSValue* value() const { return m_value.get(); } 50 CSSValue* value() const { return m_value.get(); }
50 51
51 bool operator==(const MediaQueryExp& other) const 52 bool operator==(const MediaQueryExp& other) const
52 { 53 {
53 return (other.m_mediaFeature == m_mediaFeature) 54 return (other.m_mediaFeature == m_mediaFeature)
54 && ((!other.m_value && !m_value) 55 && ((!other.m_value && !m_value)
55 || (other.m_value && m_value && other.m_value->equals(*m_value)) ); 56 || (other.m_value && m_value && other.m_value->equals(*m_value)) );
56 } 57 }
57 58
58 bool isViewportDependent() const; 59 bool isViewportDependent() const;
59 60
60 String serialize() const; 61 String serialize() const;
61 62
62 PassOwnPtr<MediaQueryExp> copy() const { return adoptPtr(new MediaQueryExp(* this)); } 63 PassOwnPtrWillBeRawPtr<MediaQueryExp> copy() const { return adoptPtrWillBeNo op(new MediaQueryExp(*this)); }
64
65 void trace(Visitor* visitor) { visitor->trace(m_value); }
66
67 MediaQueryExp(const MediaQueryExp& other);
63 68
64 private: 69 private:
65 MediaQueryExp(const AtomicString& mediaFeature, PassRefPtrWillBeRawPtr<CSSVa lue>); 70 MediaQueryExp(const AtomicString& mediaFeature, PassRefPtrWillBeRawPtr<CSSVa lue>);
66 71
67 AtomicString m_mediaFeature; 72 AtomicString m_mediaFeature;
68 RefPtr<CSSValue> m_value; 73 RefPtrWillBeMember<CSSValue> m_value;
69 }; 74 };
70 75
71 } // namespace 76 } // namespace
72 77
73 #endif 78 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698