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

Unified Diff: Source/core/css/resolver/MatchResult.h

Issue 273843003: [Oilpan]: Make StylePropertySet fully garbage collected. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add comment for ShareableElementData new Created 6 years, 6 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: Source/core/css/resolver/MatchResult.h
diff --git a/Source/core/css/resolver/MatchResult.h b/Source/core/css/resolver/MatchResult.h
index 25d9b91900a50be0e24b2af3e7725e6e291714ea..b1caefd5017094ff0e1ceabdd0362cc66e0db5c5 100644
--- a/Source/core/css/resolver/MatchResult.h
+++ b/Source/core/css/resolver/MatchResult.h
@@ -25,6 +25,7 @@
#include "core/css/RuleSet.h"
#include "core/css/SelectorChecker.h"
+#include "platform/heap/Handle.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
@@ -53,10 +54,15 @@ struct MatchRanges {
};
struct MatchedProperties {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+public:
MatchedProperties();
~MatchedProperties();
- RefPtr<StylePropertySet> properties;
+ void trace(Visitor*);
+
+ RefPtrWillBeWeakMember<StylePropertySet> properties;
+
union {
struct {
unsigned linkMatchType : 2;
@@ -67,11 +73,23 @@ struct MatchedProperties {
};
};
+} // WebCore namespace
+
+namespace WTF {
Mads Ager (chromium) 2014/06/25 06:31:48 You can use WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCT
wibling-chromium 2014/06/25 09:03:27 Done.
+template <> struct VectorTraits<WebCore::MatchedProperties> : VectorTraitsBase<WebCore::MatchedProperties> {
+ static const bool canInitializeWithMemset = true;
+ static const bool canMoveWithMemcpy = true;
+};
+
+}
+
+namespace WebCore {
+
class MatchResult {
STACK_ALLOCATED();
public:
MatchResult() : isCacheable(true) { }
- Vector<MatchedProperties, 64> matchedProperties;
+ WillBeHeapVector<MatchedProperties, 64> matchedProperties;
Mads Ager (chromium) 2014/06/25 06:31:48 In MatchResult you are using the normal tracing of
Erik Corry 2014/06/25 06:58:25 I agree in principle, but it's sort of subtle. Mat
wibling-chromium 2014/06/25 09:03:27 Nice catch. I have changed it be a Member instead.
WillBeHeapVector<RawPtrWillBeMember<StyleRule>, 64> matchedRules;
MatchRanges ranges;
bool isCacheable;

Powered by Google App Engine
This is Rietveld 408576698