| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (m_enabled) | 303 if (m_enabled) |
| 304 return true; | 304 return true; |
| 305 *errorString = "Canvas agent is not enabled"; | 305 *errorString = "Canvas agent is not enabled"; |
| 306 return false; | 306 return false; |
| 307 } | 307 } |
| 308 | 308 |
| 309 void InspectorCanvasAgent::didCommitLoad(LocalFrame*, DocumentLoader* loader) | 309 void InspectorCanvasAgent::didCommitLoad(LocalFrame*, DocumentLoader* loader) |
| 310 { | 310 { |
| 311 if (!m_enabled) | 311 if (!m_enabled) |
| 312 return; | 312 return; |
| 313 LocalFrame* frame = loader->frame(); | 313 Frame* frame = loader->frame(); |
| 314 if (frame == m_pageAgent->mainFrame()) { | 314 if (frame == m_pageAgent->mainFrame()) { |
| 315 for (FramesWithUninstrumentedCanvases::iterator it = m_framesWithUninstr
umentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it) | 315 for (FramesWithUninstrumentedCanvases::iterator it = m_framesWithUninstr
umentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it) |
| 316 it->value = false; | 316 it->value = false; |
| 317 m_frontend->traceLogsRemoved(0, 0); | 317 m_frontend->traceLogsRemoved(0, 0); |
| 318 } else { | 318 } else { |
| 319 while (frame) { | 319 while (frame) { |
| 320 if (m_framesWithUninstrumentedCanvases.contains(frame)) | 320 if (frame->isLocalFrame()) { |
| 321 m_framesWithUninstrumentedCanvases.set(frame, false); | 321 LocalFrame* localFrame = toLocalFrame(frame); |
| 322 if (m_pageAgent->hasIdForFrame(frame)) { | 322 if (m_framesWithUninstrumentedCanvases.contains(localFrame)) |
| 323 String frameId = m_pageAgent->frameId(frame); | 323 m_framesWithUninstrumentedCanvases.set(localFrame, false); |
| 324 m_frontend->traceLogsRemoved(&frameId, 0); | 324 if (m_pageAgent->hasIdForFrame(localFrame)) { |
| 325 String frameId = m_pageAgent->frameId(localFrame); |
| 326 m_frontend->traceLogsRemoved(&frameId, 0); |
| 327 } |
| 325 } | 328 } |
| 326 frame = frame->tree().traverseNext(); | 329 frame = frame->tree().traverseNext(); |
| 327 } | 330 } |
| 328 } | 331 } |
| 329 } | 332 } |
| 330 | 333 |
| 331 void InspectorCanvasAgent::frameDetachedFromParent(LocalFrame* frame) | 334 void InspectorCanvasAgent::frameDetachedFromParent(LocalFrame* frame) |
| 332 { | 335 { |
| 333 if (m_enabled) | 336 if (m_enabled) |
| 334 m_framesWithUninstrumentedCanvases.remove(frame); | 337 m_framesWithUninstrumentedCanvases.remove(frame); |
| 335 } | 338 } |
| 336 | 339 |
| 337 void InspectorCanvasAgent::didBeginFrame() | 340 void InspectorCanvasAgent::didBeginFrame() |
| 338 { | 341 { |
| 339 if (!m_enabled) | 342 if (!m_enabled) |
| 340 return; | 343 return; |
| 341 ErrorString error; | 344 ErrorString error; |
| 342 for (FramesWithUninstrumentedCanvases::const_iterator it = m_framesWithUnins
trumentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it)
{ | 345 for (FramesWithUninstrumentedCanvases::const_iterator it = m_framesWithUnins
trumentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it)
{ |
| 343 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S
criptState::forMainWorld(it->key)); | 346 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S
criptState::forMainWorld(it->key)); |
| 344 if (!module.isEmpty()) | 347 if (!module.isEmpty()) |
| 345 module.markFrameEnd(); | 348 module.markFrameEnd(); |
| 346 } | 349 } |
| 347 } | 350 } |
| 348 | 351 |
| 349 } // namespace WebCore | 352 } // namespace WebCore |
| 350 | 353 |
| OLD | NEW |