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

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

Issue 19315005: Introduce toHTMLCanvasElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/rendering/RenderHTMLCanvas.cpp » ('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) 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
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
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
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/rendering/RenderHTMLCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698