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

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

Issue 11190052: Merge 130910 - Web Inspector: protect node in the InspectorDOMNode::inspect (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 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 | 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) 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 if (!m_searchingForNode) 950 if (!m_searchingForNode)
951 return false; 951 return false;
952 952
953 if (Node* node = m_overlay->highlightedNode()) { 953 if (Node* node = m_overlay->highlightedNode()) {
954 inspect(node); 954 inspect(node);
955 return true; 955 return true;
956 } 956 }
957 return false; 957 return false;
958 } 958 }
959 959
960 void InspectorDOMAgent::inspect(Node* node) 960 void InspectorDOMAgent::inspect(Node* inspectedNode)
961 { 961 {
962 ErrorString error; 962 ErrorString error;
963 RefPtr<Node> node = inspectedNode;
963 setSearchingForNode(&error, false, 0); 964 setSearchingForNode(&error, false, 0);
964 965
965 if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCU MENT_NODE) 966 if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCU MENT_NODE)
966 node = node->parentNode(); 967 node = node->parentNode();
967 m_nodeToFocus = node; 968 m_nodeToFocus = node;
968 969
969 focusNode(); 970 focusNode();
970 } 971 }
971 972
972 void InspectorDOMAgent::focusNode() 973 void InspectorDOMAgent::focusNode()
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m ainWorldScriptState(frame)); 1585 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m ainWorldScriptState(frame));
1585 if (injectedScript.hasNoValue()) 1586 if (injectedScript.hasNoValue())
1586 return 0; 1587 return 0;
1587 1588
1588 return injectedScript.wrapNode(node, objectGroup); 1589 return injectedScript.wrapNode(node, objectGroup);
1589 } 1590 }
1590 1591
1591 } // namespace WebCore 1592 } // namespace WebCore
1592 1593
1593 #endif // ENABLE(INSPECTOR) 1594 #endif // ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698