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

Side by Side Diff: third_party/WebKit/Source/core/events/TreeScopeEventContext.cpp

Issue 2554953005: Avoid WTF::Vector::at() and operator[] in core/events. (Closed)
Patch Set: _ Created 4 years 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) 2014 Google Inc. All Rights Reserved. 2 * Copyright (C) 2014 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 int TreeScopeEventContext::calculateTreeOrderAndSetNearestAncestorClosedTree( 107 int TreeScopeEventContext::calculateTreeOrderAndSetNearestAncestorClosedTree(
108 int orderNumber, 108 int orderNumber,
109 TreeScopeEventContext* nearestAncestorClosedTreeScopeEventContext) { 109 TreeScopeEventContext* nearestAncestorClosedTreeScopeEventContext) {
110 m_preOrder = orderNumber; 110 m_preOrder = orderNumber;
111 m_containingClosedShadowTree = 111 m_containingClosedShadowTree =
112 (rootNode().isShadowRoot() && !toShadowRoot(rootNode()).isOpenOrV0()) 112 (rootNode().isShadowRoot() && !toShadowRoot(rootNode()).isOpenOrV0())
113 ? this 113 ? this
114 : nearestAncestorClosedTreeScopeEventContext; 114 : nearestAncestorClosedTreeScopeEventContext;
115 for (size_t i = 0; i < m_children.size(); ++i) 115 for (const auto& context : m_children) {
116 orderNumber = 116 orderNumber = context->calculateTreeOrderAndSetNearestAncestorClosedTree(
117 m_children[i]->calculateTreeOrderAndSetNearestAncestorClosedTree( 117 orderNumber + 1, containingClosedShadowTree());
118 orderNumber + 1, containingClosedShadowTree()); 118 }
119 m_postOrder = orderNumber + 1; 119 m_postOrder = orderNumber + 1;
120 120
121 return orderNumber + 1; 121 return orderNumber + 1;
122 } 122 }
123 123
124 } // namespace blink 124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698