| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 virtual void visitNode(Node* node) OVERRIDE | 273 virtual void visitNode(Node* node) OVERRIDE |
| 274 { | 274 { |
| 275 if (!node->hasTagName(HTMLNames::canvasTag) || !node->document() ||
!node->document()->frame()) | 275 if (!node->hasTagName(HTMLNames::canvasTag) || !node->document() ||
!node->document()->frame()) |
| 276 return; | 276 return; |
| 277 | 277 |
| 278 Frame* frame = node->document()->frame(); | 278 Frame* frame = node->document()->frame(); |
| 279 if (frame->page() != m_page) | 279 if (frame->page() != m_page) |
| 280 return; | 280 return; |
| 281 | 281 |
| 282 HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(node); | 282 if (toHTMLCanvasElement(node)->renderingContext()) |
| 283 if (canvas->renderingContext()) | |
| 284 m_framesWithUninstrumentedCanvases.set(frame, true); | 283 m_framesWithUninstrumentedCanvases.set(frame, true); |
| 285 } | 284 } |
| 286 | 285 |
| 287 private: | 286 private: |
| 288 Page* m_page; | 287 Page* m_page; |
| 289 FramesWithUninstrumentedCanvases& m_framesWithUninstrumentedCanvases; | 288 FramesWithUninstrumentedCanvases& m_framesWithUninstrumentedCanvases; |
| 290 } nodeVisitor(m_pageAgent->page(), m_framesWithUninstrumentedCanvases); | 289 } nodeVisitor(m_pageAgent->page(), m_framesWithUninstrumentedCanvases); |
| 291 | 290 |
| 292 m_framesWithUninstrumentedCanvases.clear(); | 291 m_framesWithUninstrumentedCanvases.clear(); |
| 293 ScriptProfiler::visitNodeWrappers(&nodeVisitor); | 292 ScriptProfiler::visitNodeWrappers(&nodeVisitor); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 ErrorString error; | 343 ErrorString error; |
| 345 for (FramesWithUninstrumentedCanvases::iterator it = m_framesWithUninstrumen
tedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it) { | 344 for (FramesWithUninstrumentedCanvases::iterator it = m_framesWithUninstrumen
tedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it) { |
| 346 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, m
ainWorldScriptState(it->key)); | 345 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, m
ainWorldScriptState(it->key)); |
| 347 if (!module.hasNoValue()) | 346 if (!module.hasNoValue()) |
| 348 module.markFrameEnd(); | 347 module.markFrameEnd(); |
| 349 } | 348 } |
| 350 } | 349 } |
| 351 | 350 |
| 352 } // namespace WebCore | 351 } // namespace WebCore |
| 353 | 352 |
| OLD | NEW |