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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 void CustomElementUpgradeCandidateMap::add(const CustomElementDescriptor& descri
ptor, Element* element) | 45 void CustomElementUpgradeCandidateMap::add(const CustomElementDescriptor& descri
ptor, Element* element) |
46 { | 46 { |
47 observe(element); | 47 observe(element); |
48 | 48 |
49 UpgradeCandidateMap::AddResult result = m_upgradeCandidates.add(element, des
criptor); | 49 UpgradeCandidateMap::AddResult result = m_upgradeCandidates.add(element, des
criptor); |
50 ASSERT_UNUSED(result, result.isNewEntry); | 50 ASSERT_UNUSED(result, result.isNewEntry); |
51 | 51 |
52 UnresolvedDefinitionMap::iterator it = m_unresolvedDefinitions.find(descript
or); | 52 UnresolvedDefinitionMap::iterator it = m_unresolvedDefinitions.find(descript
or); |
| 53 ElementSet* elements; |
53 if (it == m_unresolvedDefinitions.end()) | 54 if (it == m_unresolvedDefinitions.end()) |
54 it = m_unresolvedDefinitions.add(descriptor, ElementSet()).iterator; | 55 elements = &m_unresolvedDefinitions.add(descriptor, ElementSet()).stored
Value->value; |
55 it->value.add(element); | 56 else |
| 57 elements = &it->value; |
| 58 elements->add(element); |
56 } | 59 } |
57 | 60 |
58 void CustomElementUpgradeCandidateMap::remove(Element* element) | 61 void CustomElementUpgradeCandidateMap::remove(Element* element) |
59 { | 62 { |
60 unobserve(element); | 63 unobserve(element); |
61 removeCommon(element); | 64 removeCommon(element); |
62 } | 65 } |
63 | 66 |
64 void CustomElementUpgradeCandidateMap::elementWasDestroyed(Element* element) | 67 void CustomElementUpgradeCandidateMap::elementWasDestroyed(Element* element) |
65 { | 68 { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 104 |
102 for (ElementSet::const_iterator candidate = candidates.begin(); candidate !=
candidates.end(); ++candidate) { | 105 for (ElementSet::const_iterator candidate = candidates.begin(); candidate !=
candidates.end(); ++candidate) { |
103 unobserve(*candidate); | 106 unobserve(*candidate); |
104 m_upgradeCandidates.remove(*candidate); | 107 m_upgradeCandidates.remove(*candidate); |
105 } | 108 } |
106 | 109 |
107 return candidates; | 110 return candidates; |
108 } | 111 } |
109 | 112 |
110 } | 113 } |
OLD | NEW |