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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForOb
jectId(objectId); | 259 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForOb
jectId(objectId); |
260 if (injectedScript.isEmpty()) { | 260 if (injectedScript.isEmpty()) { |
261 *errorString = "Inspected frame has gone"; | 261 *errorString = "Inspected frame has gone"; |
262 return InjectedScriptCanvasModule(); | 262 return InjectedScriptCanvasModule(); |
263 } | 263 } |
264 return injectedScriptCanvasModule(errorString, injectedScript.scriptState())
; | 264 return injectedScriptCanvasModule(errorString, injectedScript.scriptState())
; |
265 } | 265 } |
266 | 266 |
267 void InspectorCanvasAgent::findFramesWithUninstrumentedCanvases() | 267 void InspectorCanvasAgent::findFramesWithUninstrumentedCanvases() |
268 { | 268 { |
269 class NodeVisitor FINAL : public WrappedNodeVisitor { | 269 class NodeVisitor final : public WrappedNodeVisitor { |
270 public: | 270 public: |
271 NodeVisitor(Page* page, FramesWithUninstrumentedCanvases& result) | 271 NodeVisitor(Page* page, FramesWithUninstrumentedCanvases& result) |
272 : m_page(page) | 272 : m_page(page) |
273 , m_framesWithUninstrumentedCanvases(result) | 273 , m_framesWithUninstrumentedCanvases(result) |
274 { | 274 { |
275 } | 275 } |
276 | 276 |
277 virtual void visitNode(Node* node) OVERRIDE | 277 virtual void visitNode(Node* node) override |
278 { | 278 { |
279 ASSERT(node); | 279 ASSERT(node); |
280 if (!isHTMLCanvasElement(*node) || !node->document().frame()) | 280 if (!isHTMLCanvasElement(*node) || !node->document().frame()) |
281 return; | 281 return; |
282 | 282 |
283 LocalFrame* frame = node->document().frame(); | 283 LocalFrame* frame = node->document().frame(); |
284 if (frame->page() != m_page) | 284 if (frame->page() != m_page) |
285 return; | 285 return; |
286 | 286 |
287 if (toHTMLCanvasElement(node)->renderingContext()) | 287 if (toHTMLCanvasElement(node)->renderingContext()) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 ErrorString error; | 351 ErrorString error; |
352 for (FramesWithUninstrumentedCanvases::const_iterator it = m_framesWithUnins
trumentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it)
{ | 352 for (FramesWithUninstrumentedCanvases::const_iterator it = m_framesWithUnins
trumentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it)
{ |
353 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S
criptState::forMainWorld(it->key)); | 353 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S
criptState::forMainWorld(it->key)); |
354 if (!module.isEmpty()) | 354 if (!module.isEmpty()) |
355 module.markFrameEnd(); | 355 module.markFrameEnd(); |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 } // namespace blink | 359 } // namespace blink |
360 | 360 |
OLD | NEW |