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

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 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
« no previous file with comments | « Source/core/html/track/TextTrackCue.cpp ('k') | Source/core/page/FocusController.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 Vector<Document*> docs = documents(); 947 Vector<Document*> docs = documents();
948 ListHashSet<Node*> resultCollector; 948 ListHashSet<Node*> resultCollector;
949 949
950 for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++it) { 950 for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++it) {
951 Document* document = *it; 951 Document* document = *it;
952 Node* node = document->documentElement(); 952 Node* node = document->documentElement();
953 if (!node) 953 if (!node)
954 continue; 954 continue;
955 955
956 // Manual plain text search. 956 // Manual plain text search.
957 while ((node = NodeTraversal::next(node, document->documentElement()))) { 957 while ((node = NodeTraversal::next(*node, document->documentElement()))) {
958 switch (node->nodeType()) { 958 switch (node->nodeType()) {
959 case Node::TEXT_NODE: 959 case Node::TEXT_NODE:
960 case Node::COMMENT_NODE: 960 case Node::COMMENT_NODE:
961 case Node::CDATA_SECTION_NODE: { 961 case Node::CDATA_SECTION_NODE: {
962 String text = node->nodeValue(); 962 String text = node->nodeValue();
963 if (text.findIgnoringCase(whitespaceTrimmedQuery) != kNotFound) 963 if (text.findIgnoringCase(whitespaceTrimmedQuery) != kNotFound)
964 resultCollector.add(node); 964 resultCollector.add(node);
965 break; 965 break;
966 } 966 }
967 case Node::ELEMENT_NODE: { 967 case Node::ELEMENT_NODE: {
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
2017 if (!m_documentNodeToIdMap.contains(m_document)) { 2017 if (!m_documentNodeToIdMap.contains(m_document)) {
2018 RefPtr<TypeBuilder::DOM::Node> root; 2018 RefPtr<TypeBuilder::DOM::Node> root;
2019 getDocument(errorString, root); 2019 getDocument(errorString, root);
2020 return errorString->isEmpty(); 2020 return errorString->isEmpty();
2021 } 2021 }
2022 return true; 2022 return true;
2023 } 2023 }
2024 2024
2025 } // namespace WebCore 2025 } // namespace WebCore
2026 2026
OLDNEW
« no previous file with comments | « Source/core/html/track/TextTrackCue.cpp ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698