| 71 | } |
| 72 | |
| 73 | bool ElementRepository::IsElementManaged(IHTMLElement* element, |
| 74 | ElementHandle* element_wrapper) { |
| 75 | // TODO: This method needs much work. If we are already managing a |
| 76 | // given element, we don't want to assign it a new ID, but to find |
| 77 | // out if we're managing it already, we need to compare to all of |
| 78 | // the elements already in our map, which means iterating through |
| 79 | // the map. For long-running tests, this means the addition of a |
| 80 | // new managed element may take longer and longer as we have no |
| 81 | // good algorithm for removing dead elements from the map. |
| 82 | ElementMap::iterator it = this->managed_elements_.begin(); |
| 83 | for (; it != this->managed_elements_.end(); ++it) { |
| 84 | if (it->second->element() == element) { |
| 85 | *element_wrapper = it->second; |
| 86 | return true; |
| 87 | } |
| 88 | } |
| 89 | return false; |
| 90 | } |
| 91 | |
| 92 | void ElementRepository::RemoveManagedElement(const std::string& element_id) { |
| 93 | LOG(TRACE) << "Entering ElementRepository::RemoveManagedElement"; |
no test coverage detected