Chromium Code Reviews| 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 if (m_framesWithUninstrumentedCanvases.contains(toLocalFrame(fra me))) |
|
yurys
2014/06/02 07:56:27
Please extract toLocalFrame(frame) into a variable
kenrb
2014/06/02 15:20:48
Done.
| |
| 322 if (m_pageAgent->hasIdForFrame(frame)) { | 322 m_framesWithUninstrumentedCanvases.set(toLocalFrame(frame), false); |
| 323 String frameId = m_pageAgent->frameId(frame); | 323 if (m_pageAgent->hasIdForFrame(toLocalFrame(frame))) { |
| 324 m_frontend->traceLogsRemoved(&frameId, 0); | 324 String frameId = m_pageAgent->frameId(toLocalFrame(frame)); |
| 325 m_frontend->traceLogsRemoved(&frameId, 0); | |
| 326 } | |
| 325 } | 327 } |
| 326 frame = frame->tree().traverseNext(); | 328 frame = frame->tree().traverseNext(); |
| 327 } | 329 } |
| 328 } | 330 } |
| 329 } | 331 } |
| 330 | 332 |
| 331 void InspectorCanvasAgent::frameDetachedFromParent(LocalFrame* frame) | 333 void InspectorCanvasAgent::frameDetachedFromParent(LocalFrame* frame) |
| 332 { | 334 { |
| 333 if (m_enabled) | 335 if (m_enabled) |
| 334 m_framesWithUninstrumentedCanvases.remove(frame); | 336 m_framesWithUninstrumentedCanvases.remove(frame); |
| 335 } | 337 } |
| 336 | 338 |
| 337 void InspectorCanvasAgent::didBeginFrame() | 339 void InspectorCanvasAgent::didBeginFrame() |
| 338 { | 340 { |
| 339 if (!m_enabled) | 341 if (!m_enabled) |
| 340 return; | 342 return; |
| 341 ErrorString error; | 343 ErrorString error; |
| 342 for (FramesWithUninstrumentedCanvases::const_iterator it = m_framesWithUnins trumentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it) { | 344 for (FramesWithUninstrumentedCanvases::const_iterator it = m_framesWithUnins trumentedCanvases.begin(); it != m_framesWithUninstrumentedCanvases.end(); ++it) { |
| 343 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S criptState::forMainWorld(it->key)); | 345 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S criptState::forMainWorld(it->key)); |
| 344 if (!module.isEmpty()) | 346 if (!module.isEmpty()) |
| 345 module.markFrameEnd(); | 347 module.markFrameEnd(); |
| 346 } | 348 } |
| 347 } | 349 } |
| 348 | 350 |
| 349 } // namespace WebCore | 351 } // namespace WebCore |
| 350 | 352 |
| OLD | NEW |