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

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

Issue 308963002: Minimize calls to Node::nodeType() as it is virtual (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 { 304 {
305 if (!node) 305 if (!node)
306 return; 306 return;
307 Document* document = node->ownerDocument(); 307 Document* document = node->ownerDocument();
308 if (!document) 308 if (!document)
309 return; 309 return;
310 LocalFrame* frame = document->frame(); 310 LocalFrame* frame = document->frame();
311 if (!frame) 311 if (!frame)
312 return; 312 return;
313 313
314 if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCU MENT_NODE) 314 if (!node->isElementNode() && !node->isDocumentNode())
315 node = node->parentNode(); 315 node = node->parentNode();
316 316
317 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(S criptState::forMainWorld(frame)); 317 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(S criptState::forMainWorld(frame));
318 if (injectedScript.isEmpty()) 318 if (injectedScript.isEmpty())
319 return; 319 return;
320 injectedScript.inspectNode(node); 320 injectedScript.inspectNode(node);
321 } 321 }
322 322
323 void InspectorController::setInjectedScriptForOrigin(const String& origin, const String& source) 323 void InspectorController::setInjectedScriptForOrigin(const String& origin, const String& source)
324 { 324 {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 m_layerTreeAgent->willAddPageOverlay(layer); 474 m_layerTreeAgent->willAddPageOverlay(layer);
475 } 475 }
476 476
477 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer) 477 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer)
478 { 478 {
479 if (m_layerTreeAgent) 479 if (m_layerTreeAgent)
480 m_layerTreeAgent->didRemovePageOverlay(layer); 480 m_layerTreeAgent->didRemovePageOverlay(layer);
481 } 481 }
482 482
483 } // namespace WebCore 483 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698