| Index: Source/core/dom/Node.cpp
|
| diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
|
| index 5e8678b6ec3d5cfc7f7bd52e53439f1e99f7ae70..eb3adb82162a6236b34ae6dde5ec624401542e37 100644
|
| --- a/Source/core/dom/Node.cpp
|
| +++ b/Source/core/dom/Node.cpp
|
| @@ -96,14 +96,12 @@
|
| #include "wtf/text/CString.h"
|
| #include "wtf/text/StringBuilder.h"
|
|
|
| -using namespace std;
|
| -
|
| namespace WebCore {
|
|
|
| using namespace HTMLNames;
|
|
|
| #if !ENABLE(OILPAN)
|
| -void* Node::operator new(size_t size)
|
| +void* Node::operator new(std::size_t size)
|
| {
|
| ASSERT(isMainThread());
|
| return partitionAlloc(Partitions::getObjectModelPartition(), size);
|
| @@ -127,25 +125,25 @@ static HashSet<Node*>& liveNodeSet()
|
| void Node::dumpStatistics()
|
| {
|
| #if DUMP_NODE_STATISTICS
|
| - size_t nodesWithRareData = 0;
|
| -
|
| - size_t elementNodes = 0;
|
| - size_t attrNodes = 0;
|
| - size_t textNodes = 0;
|
| - size_t cdataNodes = 0;
|
| - size_t commentNodes = 0;
|
| - size_t piNodes = 0;
|
| - size_t documentNodes = 0;
|
| - size_t docTypeNodes = 0;
|
| - size_t fragmentNodes = 0;
|
| - size_t shadowRootNodes = 0;
|
| -
|
| - HashMap<String, size_t> perTagCount;
|
| -
|
| - size_t attributes = 0;
|
| - size_t elementsWithAttributeStorage = 0;
|
| - size_t elementsWithRareData = 0;
|
| - size_t elementsWithNamedNodeMap = 0;
|
| + std::size_t nodesWithRareData = 0;
|
| +
|
| + std::size_t elementNodes = 0;
|
| + std::size_t attrNodes = 0;
|
| + std::size_t textNodes = 0;
|
| + std::size_t cdataNodes = 0;
|
| + std::size_t commentNodes = 0;
|
| + std::size_t piNodes = 0;
|
| + std::size_t documentNodes = 0;
|
| + std::size_t docTypeNodes = 0;
|
| + std::size_t fragmentNodes = 0;
|
| + std::size_t shadowRootNodes = 0;
|
| +
|
| + HashMap<String, std::size_t> perTagCount;
|
| +
|
| + std::size_t attributes = 0;
|
| + std::size_t elementsWithAttributeStorage = 0;
|
| + std::size_t elementsWithRareData = 0;
|
| + std::size_t elementsWithNamedNodeMap = 0;
|
|
|
| for (HashSet<Node*>::iterator it = liveNodeSet().begin(); it != liveNodeSet().end(); ++it) {
|
| Node* node = *it;
|
| @@ -165,7 +163,7 @@ void Node::dumpStatistics()
|
|
|
| // Tag stats
|
| Element* element = toElement(node);
|
| - HashMap<String, size_t>::AddResult result = perTagCount.add(element->tagName(), 1);
|
| + HashMap<String, std::size_t>::AddResult result = perTagCount.add(element->tagName(), 1);
|
| if (!result.isNewEntry)
|
| result.storedValue->value++;
|
|
|
| @@ -229,7 +227,7 @@ void Node::dumpStatistics()
|
| printf(" Number of ShadowRoot nodes: %zu\n", shadowRootNodes);
|
|
|
| printf("Element tag name distibution:\n");
|
| - for (HashMap<String, size_t>::iterator it = perTagCount.begin(); it != perTagCount.end(); ++it)
|
| + for (HashMap<String, std::size_t>::iterator it = perTagCount.begin(); it != perTagCount.end(); ++it)
|
| printf(" Number of <%s> tags: %zu\n", it->key.utf8().data(), it->value);
|
|
|
| printf("Attributes:\n");
|
| @@ -632,8 +630,8 @@ bool Node::hasNonEmptyBoundingBox() const
|
| Vector<IntRect> rects;
|
| FloatPoint absPos = renderer()->localToAbsolute();
|
| renderer()->absoluteRects(rects, flooredLayoutPoint(absPos));
|
| - size_t n = rects.size();
|
| - for (size_t i = 0; i < n; ++i)
|
| + std::size_t n = rects.size();
|
| + for (std::size_t i = 0; i < n; ++i)
|
| if (!rects[i].isEmpty())
|
| return true;
|
|
|
| @@ -704,7 +702,7 @@ PassRefPtr<JSONArray> jsStackAsJSONArray()
|
| RefPtr<ScriptCallStack> stack = createScriptCallStack(10);
|
| if (!stack)
|
| return jsonArray.release();
|
| - for (size_t i = 0; i < stack->size(); i++)
|
| + for (std::size_t i = 0; i < stack->size(); i++)
|
| jsonArray->pushString(stack->at(i).functionName());
|
| return jsonArray.release();
|
| }
|
| @@ -1622,7 +1620,7 @@ unsigned short Node::compareDocumentPositionInternal(const Node* otherNode, Shad
|
| unsigned connection = start1->treeScope() != start2->treeScope() ? DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC : 0;
|
|
|
| // Walk the two chains backwards and look for the first difference.
|
| - for (unsigned i = min(index1, index2); i; --i) {
|
| + for (unsigned i = std::min(index1, index2); i; --i) {
|
| const Node* child1 = chain1[--index1];
|
| const Node* child2 = chain2[--index2];
|
| if (child1 != child2) {
|
| @@ -1708,7 +1706,7 @@ String Node::debugName() const
|
|
|
| if (hasClass()) {
|
| name.appendLiteral(" class=\'");
|
| - for (size_t i = 0; i < toElement(this)->classNames().size(); ++i) {
|
| + for (std::size_t i = 0; i < toElement(this)->classNames().size(); ++i) {
|
| if (i > 0)
|
| name.append(' ');
|
| name.append(toElement(this)->classNames()[i]);
|
| @@ -1957,7 +1955,7 @@ void Node::didMoveToNewDocument(Document& oldDocument)
|
| }
|
|
|
| if (WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> >* registry = mutationObserverRegistry()) {
|
| - for (size_t i = 0; i < registry->size(); ++i) {
|
| + for (std::size_t i = 0; i < registry->size(); ++i) {
|
| document().addMutationObserverTypes(registry->at(i)->mutationTypes());
|
| }
|
| }
|
| @@ -2113,7 +2111,7 @@ void Node::registerMutationObserver(MutationObserver& observer, MutationObserver
|
| {
|
| MutationObserverRegistration* registration = 0;
|
| WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> >& registry = ensureRareData().ensureMutationObserverData().registry;
|
| - for (size_t i = 0; i < registry.size(); ++i) {
|
| + for (std::size_t i = 0; i < registry.size(); ++i) {
|
| if (®istry[i]->observer() == &observer) {
|
| registration = registry[i].get();
|
| registration->resetObservation(options, attributeFilter);
|
| @@ -2135,7 +2133,7 @@ void Node::unregisterMutationObserver(MutationObserverRegistration* registration
|
| if (!registry)
|
| return;
|
|
|
| - size_t index = registry->find(registration);
|
| + std::size_t index = registry->find(registration);
|
| ASSERT(index != kNotFound);
|
| if (index == kNotFound)
|
| return;
|
| @@ -2175,8 +2173,8 @@ void Node::notifyMutationObserversNodeWillDetach()
|
|
|
| for (Node* node = parentNode(); node; node = node->parentNode()) {
|
| if (WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> >* registry = node->mutationObserverRegistry()) {
|
| - const size_t size = registry->size();
|
| - for (size_t i = 0; i < size; ++i)
|
| + const std::size_t size = registry->size();
|
| + for (std::size_t i = 0; i < size; ++i)
|
| registry->at(i)->observedSubtreeNodeWillDetach(*this);
|
| }
|
|
|
| @@ -2451,7 +2449,7 @@ PassRefPtrWillBeRawPtr<NodeList> Node::getDestinationInsertionPoints()
|
| WillBeHeapVector<RawPtrWillBeMember<InsertionPoint>, 8> insertionPoints;
|
| collectDestinationInsertionPoints(*this, insertionPoints);
|
| WillBeHeapVector<RefPtrWillBeMember<Node> > filteredInsertionPoints;
|
| - for (size_t i = 0; i < insertionPoints.size(); ++i) {
|
| + for (std::size_t i = 0; i < insertionPoints.size(); ++i) {
|
| InsertionPoint* insertionPoint = insertionPoints[i];
|
| ASSERT(insertionPoint->containingShadowRoot());
|
| if (insertionPoint->containingShadowRoot()->type() != ShadowRoot::UserAgentShadowRoot)
|
| @@ -2471,9 +2469,9 @@ void Node::unregisterScopedHTMLStyleChild()
|
| setHasScopedHTMLStyleChild(numberOfScopedHTMLStyleChildren());
|
| }
|
|
|
| -size_t Node::numberOfScopedHTMLStyleChildren() const
|
| +std::size_t Node::numberOfScopedHTMLStyleChildren() const
|
| {
|
| - size_t count = 0;
|
| + std::size_t count = 0;
|
| for (HTMLStyleElement* style = Traversal<HTMLStyleElement>::firstChild(*this); style; style = Traversal<HTMLStyleElement>::nextSibling(*style)) {
|
| if (style->isRegisteredAsScoped())
|
| ++count;
|
|
|