| 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 24 matching lines...) Expand all Loading... |
| 35 #include "bindings/v8/ScriptValue.h" | 35 #include "bindings/v8/ScriptValue.h" |
| 36 #include "core/html/HTMLCanvasElement.h" | 36 #include "core/html/HTMLCanvasElement.h" |
| 37 #include "core/inspector/BindingVisitors.h" | 37 #include "core/inspector/BindingVisitors.h" |
| 38 #include "core/inspector/InjectedScript.h" | 38 #include "core/inspector/InjectedScript.h" |
| 39 #include "core/inspector/InjectedScriptCanvasModule.h" | 39 #include "core/inspector/InjectedScriptCanvasModule.h" |
| 40 #include "core/inspector/InjectedScriptManager.h" | 40 #include "core/inspector/InjectedScriptManager.h" |
| 41 #include "core/inspector/InspectorPageAgent.h" | 41 #include "core/inspector/InspectorPageAgent.h" |
| 42 #include "core/inspector/InspectorState.h" | 42 #include "core/inspector/InspectorState.h" |
| 43 #include "core/inspector/InstrumentingAgents.h" | 43 #include "core/inspector/InstrumentingAgents.h" |
| 44 #include "core/loader/DocumentLoader.h" | 44 #include "core/loader/DocumentLoader.h" |
| 45 #include "core/frame/DOMWindow.h" | 45 #include "core/frame/LocalDOMWindow.h" |
| 46 #include "core/frame/LocalFrame.h" | 46 #include "core/frame/LocalFrame.h" |
| 47 | 47 |
| 48 using WebCore::TypeBuilder::Array; | 48 using WebCore::TypeBuilder::Array; |
| 49 using WebCore::TypeBuilder::Canvas::ResourceId; | 49 using WebCore::TypeBuilder::Canvas::ResourceId; |
| 50 using WebCore::TypeBuilder::Canvas::ResourceState; | 50 using WebCore::TypeBuilder::Canvas::ResourceState; |
| 51 using WebCore::TypeBuilder::Canvas::TraceLog; | 51 using WebCore::TypeBuilder::Canvas::TraceLog; |
| 52 using WebCore::TypeBuilder::Canvas::TraceLogId; | 52 using WebCore::TypeBuilder::Canvas::TraceLogId; |
| 53 using WebCore::TypeBuilder::Page::FrameId; | 53 using WebCore::TypeBuilder::Page::FrameId; |
| 54 using WebCore::TypeBuilder::Runtime::RemoteObject; | 54 using WebCore::TypeBuilder::Runtime::RemoteObject; |
| 55 | 55 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, glCon
text); | 202 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, glCon
text); |
| 203 if (module.isEmpty()) | 203 if (module.isEmpty()) |
| 204 return ScriptValue(); | 204 return ScriptValue(); |
| 205 return notifyRenderingContextWasWrapped(module.wrapWebGLContext(glContext)); | 205 return notifyRenderingContextWasWrapped(module.wrapWebGLContext(glContext)); |
| 206 } | 206 } |
| 207 | 207 |
| 208 ScriptValue InspectorCanvasAgent::notifyRenderingContextWasWrapped(const ScriptV
alue& wrappedContext) | 208 ScriptValue InspectorCanvasAgent::notifyRenderingContextWasWrapped(const ScriptV
alue& wrappedContext) |
| 209 { | 209 { |
| 210 ASSERT(m_frontend); | 210 ASSERT(m_frontend); |
| 211 ScriptState* scriptState = wrappedContext.scriptState(); | 211 ScriptState* scriptState = wrappedContext.scriptState(); |
| 212 DOMWindow* domWindow = 0; | 212 LocalDOMWindow* domWindow = 0; |
| 213 if (scriptState) | 213 if (scriptState) |
| 214 domWindow = scriptState->domWindow(); | 214 domWindow = scriptState->domWindow(); |
| 215 LocalFrame* frame = domWindow ? domWindow->frame() : 0; | 215 LocalFrame* frame = domWindow ? domWindow->frame() : 0; |
| 216 if (frame && !m_framesWithUninstrumentedCanvases.contains(frame)) | 216 if (frame && !m_framesWithUninstrumentedCanvases.contains(frame)) |
| 217 m_framesWithUninstrumentedCanvases.set(frame, false); | 217 m_framesWithUninstrumentedCanvases.set(frame, false); |
| 218 String frameId = m_pageAgent->frameId(frame); | 218 String frameId = m_pageAgent->frameId(frame); |
| 219 if (!frameId.isEmpty()) | 219 if (!frameId.isEmpty()) |
| 220 m_frontend->contextCreated(frameId); | 220 m_frontend->contextCreated(frameId); |
| 221 return wrappedContext; | 221 return wrappedContext; |
| 222 } | 222 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 ErrorString error; | 344 ErrorString error; |
| 345 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)
{ |
| 346 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S
criptState::forMainWorld(it->key)); | 346 InjectedScriptCanvasModule module = injectedScriptCanvasModule(&error, S
criptState::forMainWorld(it->key)); |
| 347 if (!module.isEmpty()) | 347 if (!module.isEmpty()) |
| 348 module.markFrameEnd(); | 348 module.markFrameEnd(); |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace WebCore | 352 } // namespace WebCore |
| 353 | 353 |
| OLD | NEW |