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

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

Issue 1489433002: Support the essential part of Shadow DOM v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert Internals.* Created 5 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) 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 22 matching lines...) Expand all
33 33
34 void DistributedNodes::swap(DistributedNodes& other) 34 void DistributedNodes::swap(DistributedNodes& other)
35 { 35 {
36 m_nodes.swap(other.m_nodes); 36 m_nodes.swap(other.m_nodes);
37 m_indices.swap(other.m_indices); 37 m_indices.swap(other.m_indices);
38 } 38 }
39 39
40 void DistributedNodes::append(PassRefPtrWillBeRawPtr<Node> node) 40 void DistributedNodes::append(PassRefPtrWillBeRawPtr<Node> node)
41 { 41 {
42 ASSERT(node); 42 ASSERT(node);
43 ASSERT(!isActiveInsertionPoint(*node)); 43 ASSERT(!node->isSlotOrActiveInsertionPoint());
44 size_t size = m_nodes.size(); 44 size_t size = m_nodes.size();
45 m_indices.set(node.get(), size); 45 m_indices.set(node.get(), size);
46 m_nodes.append(node); 46 m_nodes.append(node);
47 } 47 }
48 48
49 size_t DistributedNodes::find(const Node* node) const 49 size_t DistributedNodes::find(const Node* node) const
50 { 50 {
51 WillBeHeapHashMap<RawPtrWillBeMember<const Node>, size_t>::const_iterator it = m_indices.find(node); 51 WillBeHeapHashMap<RawPtrWillBeMember<const Node>, size_t>::const_iterator it = m_indices.find(node);
52 if (it == m_indices.end()) 52 if (it == m_indices.end())
53 return kNotFound; 53 return kNotFound;
(...skipping 19 matching lines...) Expand all
73 73
74 DEFINE_TRACE(DistributedNodes) 74 DEFINE_TRACE(DistributedNodes)
75 { 75 {
76 #if ENABLE(OILPAN) 76 #if ENABLE(OILPAN)
77 visitor->trace(m_nodes); 77 visitor->trace(m_nodes);
78 visitor->trace(m_indices); 78 visitor->trace(m_indices);
79 #endif 79 #endif
80 } 80 }
81 81
82 } // namespace blink 82 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698