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

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

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) Created 6 years, 10 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
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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 if (exceptionState.hadException() || !nodeList) 1032 if (exceptionState.hadException() || !nodeList)
1033 continue; 1033 continue;
1034 1034
1035 unsigned size = nodeList->length(); 1035 unsigned size = nodeList->length();
1036 for (unsigned i = 0; i < size; ++i) 1036 for (unsigned i = 0; i < size; ++i)
1037 resultCollector.add(nodeList->item(i)); 1037 resultCollector.add(nodeList->item(i));
1038 } 1038 }
1039 } 1039 }
1040 1040
1041 *searchId = IdentifiersFactory::createIdentifier(); 1041 *searchId = IdentifiersFactory::createIdentifier();
1042 SearchResults::iterator resultsIt = m_searchResults.add(*searchId, Vector<Re fPtr<Node> >()).iterator; 1042 Vector<RefPtr<Node> >* resultsIt = &m_searchResults.add(*searchId, Vector<Re fPtr<Node> >()).storedValue->value;
1043 1043
1044 for (ListHashSet<Node*>::iterator it = resultCollector.begin(); it != result Collector.end(); ++it) 1044 for (ListHashSet<Node*>::iterator it = resultCollector.begin(); it != result Collector.end(); ++it)
1045 resultsIt->value.append(*it); 1045 resultsIt->append(*it);
1046 1046
1047 *resultCount = resultsIt->value.size(); 1047 *resultCount = resultsIt->size();
1048 } 1048 }
1049 1049
1050 void InspectorDOMAgent::getSearchResults(ErrorString* errorString, const String& searchId, int fromIndex, int toIndex, RefPtr<TypeBuilder::Array<int> >& nodeIds ) 1050 void InspectorDOMAgent::getSearchResults(ErrorString* errorString, const String& searchId, int fromIndex, int toIndex, RefPtr<TypeBuilder::Array<int> >& nodeIds )
1051 { 1051 {
1052 SearchResults::iterator it = m_searchResults.find(searchId); 1052 SearchResults::iterator it = m_searchResults.find(searchId);
1053 if (it == m_searchResults.end()) { 1053 if (it == m_searchResults.end()) {
1054 *errorString = "No search session with given id found"; 1054 *errorString = "No search session with given id found";
1055 return; 1055 return;
1056 } 1056 }
1057 1057
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 if (!m_documentNodeToIdMap.contains(m_document)) { 2050 if (!m_documentNodeToIdMap.contains(m_document)) {
2051 RefPtr<TypeBuilder::DOM::Node> root; 2051 RefPtr<TypeBuilder::DOM::Node> root;
2052 getDocument(errorString, root); 2052 getDocument(errorString, root);
2053 return errorString->isEmpty(); 2053 return errorString->isEmpty();
2054 } 2054 }
2055 return true; 2055 return true;
2056 } 2056 }
2057 2057
2058 } // namespace WebCore 2058 } // namespace WebCore
2059 2059
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorConsoleAgent.cpp ('k') | Source/core/inspector/InspectorDebuggerAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698