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

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: Rebase and revert member to persistent in StorageEvent Created 6 years, 9 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 public: 43 public:
44 static PassOwnPtr<MediaQueryExp> create(const AtomicString& mediaFeature, CS SParserValueList*); 44 static PassOwnPtrWillBeRawPtr<MediaQueryExp> create(const AtomicString& medi aFeature, CSSParserValueList*);
45 ~MediaQueryExp(); 45 ~MediaQueryExp();
46 46
47 AtomicString mediaFeature() const { return m_mediaFeature; } 47 AtomicString mediaFeature() const { return m_mediaFeature; }
48 48
49 CSSValue* value() const { return m_value.get(); } 49 CSSValue* value() const { return m_value.get(); }
50 50
51 bool operator==(const MediaQueryExp& other) const 51 bool operator==(const MediaQueryExp& other) const
52 { 52 {
53 return (other.m_mediaFeature == m_mediaFeature) 53 return (other.m_mediaFeature == m_mediaFeature)
54 && ((!other.m_value && !m_value) 54 && ((!other.m_value && !m_value)
55 || (other.m_value && m_value && other.m_value->equals(*m_value)) ); 55 || (other.m_value && m_value && other.m_value->equals(*m_value)) );
56 } 56 }
57 57
58 bool isViewportDependent() const; 58 bool isViewportDependent() const;
59 59
60 String serialize() const; 60 String serialize() const;
61 61
62 PassOwnPtr<MediaQueryExp> copy() const { return adoptPtr(new MediaQueryExp(* this)); } 62 PassOwnPtrWillBeRawPtr<MediaQueryExp> copy() const { return adoptPtrWillBeNo op(new MediaQueryExp(*this)); }
63
64 void trace(Visitor* visitor) { visitor->trace(m_value); }
65
66 MediaQueryExp(const MediaQueryExp& other);
63 67
64 private: 68 private:
65 MediaQueryExp(const AtomicString& mediaFeature, PassRefPtrWillBeRawPtr<CSSVa lue>); 69 MediaQueryExp(const AtomicString& mediaFeature, PassRefPtrWillBeRawPtr<CSSVa lue>);
66 70
67 AtomicString m_mediaFeature; 71 AtomicString m_mediaFeature;
68 RefPtr<CSSValue> m_value; 72 RefPtrWillBeMember<CSSValue> m_value;
69 }; 73 };
70 74
71 } // namespace 75 } // namespace
72 76
73 #endif 77 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698