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

Side by Side Diff: Source/core/xml/XPathResult.cpp

Issue 722893002: Use "unsigned" rather than "unsigned long" for C++ code interacting with WebIDL's "unsigned long". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/xml/XPathResult.h ('k') | no next file » | 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) 2005 Frerich Raabe <raabe@kde.org> 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2009 Apple Inc. 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 bool XPathResult::invalidIteratorState() const 167 bool XPathResult::invalidIteratorState() const
168 { 168 {
169 if (resultType() != UNORDERED_NODE_ITERATOR_TYPE && resultType() != ORDERED_ NODE_ITERATOR_TYPE) 169 if (resultType() != UNORDERED_NODE_ITERATOR_TYPE && resultType() != ORDERED_ NODE_ITERATOR_TYPE)
170 return false; 170 return false;
171 171
172 ASSERT(m_document); 172 ASSERT(m_document);
173 return m_document->domTreeVersion() != m_domTreeVersion; 173 return m_document->domTreeVersion() != m_domTreeVersion;
174 } 174 }
175 175
176 unsigned long XPathResult::snapshotLength(ExceptionState& exceptionState) const 176 unsigned XPathResult::snapshotLength(ExceptionState& exceptionState) const
177 { 177 {
178 if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_ NODE_SNAPSHOT_TYPE) { 178 if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_ NODE_SNAPSHOT_TYPE) {
179 exceptionState.throwTypeError("The result type is not a snapshot."); 179 exceptionState.throwTypeError("The result type is not a snapshot.");
180 return 0; 180 return 0;
181 } 181 }
182 182
183 return m_value.toNodeSet(0).size(); 183 return m_value.toNodeSet(0).size();
184 } 184 }
185 185
186 Node* XPathResult::iterateNext(ExceptionState& exceptionState) 186 Node* XPathResult::iterateNext(ExceptionState& exceptionState)
(...skipping 11 matching lines...) Expand all
198 if (m_nodeSetPosition + 1 > nodeSet().size()) 198 if (m_nodeSetPosition + 1 > nodeSet().size())
199 return 0; 199 return 0;
200 200
201 Node* node = nodeSet()[m_nodeSetPosition]; 201 Node* node = nodeSet()[m_nodeSetPosition];
202 202
203 m_nodeSetPosition++; 203 m_nodeSetPosition++;
204 204
205 return node; 205 return node;
206 } 206 }
207 207
208 Node* XPathResult::snapshotItem(unsigned long index, ExceptionState& exceptionSt ate) 208 Node* XPathResult::snapshotItem(unsigned index, ExceptionState& exceptionState)
209 { 209 {
210 if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_ NODE_SNAPSHOT_TYPE) { 210 if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_ NODE_SNAPSHOT_TYPE) {
211 exceptionState.throwTypeError("The result type is not a snapshot."); 211 exceptionState.throwTypeError("The result type is not a snapshot.");
212 return 0; 212 return 0;
213 } 213 }
214 214
215 const NodeSet& nodes = m_value.toNodeSet(0); 215 const NodeSet& nodes = m_value.toNodeSet(0);
216 if (index >= nodes.size()) 216 if (index >= nodes.size())
217 return 0; 217 return 0;
218 218
219 return nodes[index]; 219 return nodes[index];
220 } 220 }
221 221
222 } 222 }
OLDNEW
« no previous file with comments | « Source/core/xml/XPathResult.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698