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

Side by Side Diff: third_party/WebKit/Source/core/dom/SelectorQuery.cpp

Issue 2759703002: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: rebase, fix one platform-specific reference Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 nullptr, selectors); 629 nullptr, selectors);
630 630
631 if (!selectorList.first()) { 631 if (!selectorList.first()) {
632 exceptionState.throwDOMException( 632 exceptionState.throwDOMException(
633 SyntaxError, "'" + selectors + "' is not a valid selector."); 633 SyntaxError, "'" + selectors + "' is not a valid selector.");
634 return nullptr; 634 return nullptr;
635 } 635 }
636 636
637 const unsigned maximumSelectorQueryCacheSize = 256; 637 const unsigned maximumSelectorQueryCacheSize = 256;
638 if (m_entries.size() == maximumSelectorQueryCacheSize) 638 if (m_entries.size() == maximumSelectorQueryCacheSize)
639 m_entries.remove(m_entries.begin()); 639 m_entries.erase(m_entries.begin());
640 640
641 return m_entries 641 return m_entries
642 .insert(selectors, SelectorQuery::adopt(std::move(selectorList))) 642 .insert(selectors, SelectorQuery::adopt(std::move(selectorList)))
643 .storedValue->value.get(); 643 .storedValue->value.get();
644 } 644 }
645 645
646 void SelectorQueryCache::invalidate() { 646 void SelectorQueryCache::invalidate() {
647 m_entries.clear(); 647 m_entries.clear();
648 } 648 }
649 649
650 } // namespace blink 650 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ResizeObserver.cpp ('k') | third_party/WebKit/Source/core/dom/UserActionElementSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698