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

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

Issue 1024423002: Turn the InspectorHighlight builder into a stack allocated object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | Source/core/inspector/InspectorHighlight.h » ('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 2237 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 renderer = renderer->container(); 2248 renderer = renderer->container();
2249 Node* resultNode = renderer ? renderer->generatingNode() : node->ownerDocume nt(); 2249 Node* resultNode = renderer ? renderer->generatingNode() : node->ownerDocume nt();
2250 *relayoutBoundaryNodeId = pushNodePathToFrontend(resultNode); 2250 *relayoutBoundaryNodeId = pushNodePathToFrontend(resultNode);
2251 } 2251 }
2252 2252
2253 void InspectorDOMAgent::getHighlightObjectForTest(ErrorString* errorString, int nodeId, RefPtr<JSONObject>& result) 2253 void InspectorDOMAgent::getHighlightObjectForTest(ErrorString* errorString, int nodeId, RefPtr<JSONObject>& result)
2254 { 2254 {
2255 Node* node = assertNode(errorString, nodeId); 2255 Node* node = assertNode(errorString, nodeId);
2256 if (!node) 2256 if (!node)
2257 return; 2257 return;
2258 OwnPtrWillBeRawPtr<InspectorHighlight> highlight = InspectorHighlight::creat e(node, InspectorHighlight::defaultConfig(), true); 2258 InspectorHighlight highlight(node, InspectorHighlight::defaultConfig(), true );
2259 result = highlight->asJSONObject(); 2259 result = highlight.asJSONObject();
2260 } 2260 }
2261 2261
2262 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(No de* node, const String& objectGroup) 2262 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(No de* node, const String& objectGroup)
2263 { 2263 {
2264 Document* document = node->isDocumentNode() ? &node->document() : node->owne rDocument(); 2264 Document* document = node->isDocumentNode() ? &node->document() : node->owne rDocument();
2265 LocalFrame* frame = document ? document->frame() : nullptr; 2265 LocalFrame* frame = document ? document->frame() : nullptr;
2266 if (!frame) 2266 if (!frame)
2267 return nullptr; 2267 return nullptr;
2268 2268
2269 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(S criptState::forMainWorld(frame)); 2269 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(S criptState::forMainWorld(frame));
(...skipping 29 matching lines...) Expand all
2299 visitor->trace(m_searchResults); 2299 visitor->trace(m_searchResults);
2300 #endif 2300 #endif
2301 visitor->trace(m_hoveredNodeForInspectMode); 2301 visitor->trace(m_hoveredNodeForInspectMode);
2302 visitor->trace(m_history); 2302 visitor->trace(m_history);
2303 visitor->trace(m_domEditor); 2303 visitor->trace(m_domEditor);
2304 visitor->trace(m_listener); 2304 visitor->trace(m_listener);
2305 InspectorBaseAgent::trace(visitor); 2305 InspectorBaseAgent::trace(visitor);
2306 } 2306 }
2307 2307
2308 } // namespace blink 2308 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorHighlight.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698