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/EventPath.cpp

Issue 2274403002: Replace two ASSERT()s for HashMap iterators with DCHECK_NE()s. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) { 179 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) {
180 // Use olderShadowRootOrParentTreeScope here for parent-child relationsh ips. 180 // Use olderShadowRootOrParentTreeScope here for parent-child relationsh ips.
181 // See the definition of trees of trees in the Shadow DOM spec: 181 // See the definition of trees of trees in the Shadow DOM spec:
182 // http://w3c.github.io/webcomponents/spec/shadow/ 182 // http://w3c.github.io/webcomponents/spec/shadow/
183 TreeScope* parent = treeScopeEventContext.get()->treeScope().olderShadow RootOrParentTreeScope(); 183 TreeScope* parent = treeScopeEventContext.get()->treeScope().olderShadow RootOrParentTreeScope();
184 if (!parent) { 184 if (!parent) {
185 DCHECK(!rootTree); 185 DCHECK(!rootTree);
186 rootTree = treeScopeEventContext.get(); 186 rootTree = treeScopeEventContext.get();
187 continue; 187 continue;
188 } 188 }
189 // TODO(tkent): Add a stream printer for HashMap::iterator. 189 DCHECK_NE(treeScopeEventContextMap.find(parent), treeScopeEventContextMa p.end());
190 ASSERT(treeScopeEventContextMap.find(parent) != treeScopeEventContextMap .end());
191 treeScopeEventContextMap.find(parent)->value->addChild(*treeScopeEventCo ntext.get()); 190 treeScopeEventContextMap.find(parent)->value->addChild(*treeScopeEventCo ntext.get());
192 } 191 }
193 DCHECK(rootTree); 192 DCHECK(rootTree);
194 rootTree->calculateTreeOrderAndSetNearestAncestorClosedTree(0, nullptr); 193 rootTree->calculateTreeOrderAndSetNearestAncestorClosedTree(0, nullptr);
195 } 194 }
196 195
197 TreeScopeEventContext* EventPath::ensureTreeScopeEventContext(Node* currentTarge t, TreeScope* treeScope, TreeScopeEventContextMap& treeScopeEventContextMap) 196 TreeScopeEventContext* EventPath::ensureTreeScopeEventContext(Node* currentTarge t, TreeScope* treeScope, TreeScopeEventContextMap& treeScopeEventContextMap)
198 { 197 {
199 if (!treeScope) 198 if (!treeScope)
200 return nullptr; 199 return nullptr;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 DEFINE_TRACE(EventPath) 383 DEFINE_TRACE(EventPath)
385 { 384 {
386 visitor->trace(m_nodeEventContexts); 385 visitor->trace(m_nodeEventContexts);
387 visitor->trace(m_node); 386 visitor->trace(m_node);
388 visitor->trace(m_event); 387 visitor->trace(m_event);
389 visitor->trace(m_treeScopeEventContexts); 388 visitor->trace(m_treeScopeEventContexts);
390 visitor->trace(m_windowEventContext); 389 visitor->trace(m_windowEventContext);
391 } 390 }
392 391
393 } // namespace blink 392 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698