OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "core/dom/custom/CustomElementDescriptorHash.h" | 35 #include "core/dom/custom/CustomElementDescriptorHash.h" |
36 #include "core/dom/custom/CustomElementObserver.h" | 36 #include "core/dom/custom/CustomElementObserver.h" |
37 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
38 #include "wtf/ListHashSet.h" | 38 #include "wtf/ListHashSet.h" |
39 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
40 | 40 |
41 namespace WebCore { | 41 namespace WebCore { |
42 | 42 |
43 class Element; | 43 class Element; |
44 | 44 |
45 class CustomElementUpgradeCandidateMap : CustomElementObserver { | 45 class CustomElementUpgradeCandidateMap FINAL : public CustomElementObserver { |
46 WTF_MAKE_NONCOPYABLE(CustomElementUpgradeCandidateMap); | 46 WTF_MAKE_NONCOPYABLE(CustomElementUpgradeCandidateMap); |
47 public: | 47 public: |
48 CustomElementUpgradeCandidateMap() { } | 48 static PassOwnPtrWillBeRawPtr<CustomElementUpgradeCandidateMap> create(); |
49 ~CustomElementUpgradeCandidateMap(); | 49 virtual ~CustomElementUpgradeCandidateMap(); |
50 | 50 |
51 // API for CustomElementRegistrationContext to save and take candidates | 51 // API for CustomElementRegistrationContext to save and take candidates |
52 | 52 |
53 typedef ListHashSet<Element*> ElementSet; | 53 typedef WillBeHeapListHashSet<RawPtrWillBeMember<Element> > ElementSet; |
dominicc (has gone to gerrit)
2014/05/26 02:28:58
Hmm... the idea of the CustomElementUpgradeCandida
sof
2014/05/26 14:21:25
Thanks, the weakness of that reference must stay t
| |
54 | 54 |
55 void add(const CustomElementDescriptor&, Element*); | 55 void add(const CustomElementDescriptor&, Element*); |
56 void remove(Element*); | 56 void remove(Element*); |
57 ElementSet takeUpgradeCandidatesFor(const CustomElementDescriptor&); | 57 ElementSet takeUpgradeCandidatesFor(const CustomElementDescriptor&); |
58 | 58 |
59 virtual void trace(Visitor*) OVERRIDE; | |
60 | |
59 private: | 61 private: |
62 CustomElementUpgradeCandidateMap() { } | |
63 | |
60 virtual void elementWasDestroyed(Element*) OVERRIDE; | 64 virtual void elementWasDestroyed(Element*) OVERRIDE; |
61 void removeCommon(Element*); | 65 void removeCommon(Element*); |
62 | 66 |
63 virtual void elementDidFinishParsingChildren(Element*) OVERRIDE; | 67 virtual void elementDidFinishParsingChildren(Element*) OVERRIDE; |
64 void moveToEnd(Element*); | 68 void moveToEnd(Element*); |
65 | 69 |
66 typedef HashMap<Element*, CustomElementDescriptor> UpgradeCandidateMap; | 70 typedef WillBeHeapHashMap<RawPtrWillBeMember<Element>, CustomElementDescript or> UpgradeCandidateMap; |
67 UpgradeCandidateMap m_upgradeCandidates; | 71 UpgradeCandidateMap m_upgradeCandidates; |
68 | 72 |
69 typedef HashMap<CustomElementDescriptor, ElementSet> UnresolvedDefinitionMap ; | 73 typedef WillBeHeapHashMap<CustomElementDescriptor, ElementSet> UnresolvedDef initionMap; |
70 UnresolvedDefinitionMap m_unresolvedDefinitions; | 74 UnresolvedDefinitionMap m_unresolvedDefinitions; |
71 }; | 75 }; |
72 | 76 |
73 } | 77 } |
74 | 78 |
75 #endif // CustomElementUpgradeCandidateMap_h | 79 #endif // CustomElementUpgradeCandidateMap_h |
OLD | NEW |