OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 ElementFlagMap::iterator found = m_elements.find(element); | 76 ElementFlagMap::iterator found = m_elements.find(element); |
77 if (found == m_elements.end()) { | 77 if (found == m_elements.end()) { |
78 element->setUserActionElement(false); | 78 element->setUserActionElement(false); |
79 return; | 79 return; |
80 } | 80 } |
81 | 81 |
82 unsigned updated = found->value & ~flags; | 82 unsigned updated = found->value & ~flags; |
83 if (!updated) { | 83 if (!updated) { |
84 element->setUserActionElement(false); | 84 element->setUserActionElement(false); |
85 m_elements.remove(found); | 85 m_elements.erase(found); |
86 return; | 86 return; |
87 } | 87 } |
88 | 88 |
89 found->value = updated; | 89 found->value = updated; |
90 } | 90 } |
91 | 91 |
92 inline void UserActionElementSet::setFlags(Element* element, unsigned flags) { | 92 inline void UserActionElementSet::setFlags(Element* element, unsigned flags) { |
93 ElementFlagMap::iterator result = m_elements.find(element); | 93 ElementFlagMap::iterator result = m_elements.find(element); |
94 if (result != m_elements.end()) { | 94 if (result != m_elements.end()) { |
95 DCHECK(element->isUserActionElement()); | 95 DCHECK(element->isUserActionElement()); |
96 result->value |= flags; | 96 result->value |= flags; |
97 return; | 97 return; |
98 } | 98 } |
99 | 99 |
100 element->setUserActionElement(true); | 100 element->setUserActionElement(true); |
101 m_elements.insert(element, flags); | 101 m_elements.insert(element, flags); |
102 } | 102 } |
103 | 103 |
104 DEFINE_TRACE(UserActionElementSet) { | 104 DEFINE_TRACE(UserActionElementSet) { |
105 visitor->trace(m_elements); | 105 visitor->trace(m_elements); |
106 } | 106 } |
107 | 107 |
108 } // namespace blink | 108 } // namespace blink |
OLD | NEW |