| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class Frame; | 45 class Frame; |
| 46 class DocumentLoader; | 46 class DocumentLoader; |
| 47 class InjectedScriptCanvasModule; | 47 class InjectedScriptCanvasModule; |
| 48 class InjectedScriptManager; | 48 class InjectedScriptManager; |
| 49 class InspectorPageAgent; | 49 class InspectorPageAgent; |
| 50 class InstrumentingAgents; | 50 class InstrumentingAgents; |
| 51 class ScriptObject; | 51 class ScriptObject; |
| 52 | 52 |
| 53 typedef String ErrorString; | 53 typedef String ErrorString; |
| 54 | 54 |
| 55 class InspectorCanvasAgent : public InspectorBaseAgent<InspectorCanvasAgent>, pu
blic InspectorBackendDispatcher::CanvasCommandHandler { | 55 class InspectorCanvasAgent FINAL : public InspectorBaseAgent<InspectorCanvasAgen
t>, public InspectorBackendDispatcher::CanvasCommandHandler { |
| 56 public: | 56 public: |
| 57 static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrume
ntingAgents, InspectorCompositeState* state, InspectorPageAgent* pageAgent, Inje
ctedScriptManager* injectedScriptManager) | 57 static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrume
ntingAgents, InspectorCompositeState* state, InspectorPageAgent* pageAgent, Inje
ctedScriptManager* injectedScriptManager) |
| 58 { | 58 { |
| 59 return adoptPtr(new InspectorCanvasAgent(instrumentingAgents, state, pag
eAgent, injectedScriptManager)); | 59 return adoptPtr(new InspectorCanvasAgent(instrumentingAgents, state, pag
eAgent, injectedScriptManager)); |
| 60 } | 60 } |
| 61 ~InspectorCanvasAgent(); | 61 virtual ~InspectorCanvasAgent(); |
| 62 | 62 |
| 63 virtual void setFrontend(InspectorFrontend*); | 63 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
| 64 virtual void clearFrontend(); | 64 virtual void clearFrontend() OVERRIDE; |
| 65 virtual void restore(); | 65 virtual void restore() OVERRIDE; |
| 66 | 66 |
| 67 void didCommitLoad(Frame*, DocumentLoader*); | 67 void didCommitLoad(Frame*, DocumentLoader*); |
| 68 void frameDetachedFromParent(Frame*); | 68 void frameDetachedFromParent(Frame*); |
| 69 void didBeginFrame(); | 69 void didBeginFrame(); |
| 70 | 70 |
| 71 // Called from InspectorCanvasInstrumentation. | 71 // Called from InspectorCanvasInstrumentation. |
| 72 ScriptObject wrapCanvas2DRenderingContextForInstrumentation(const ScriptObje
ct&); | 72 ScriptObject wrapCanvas2DRenderingContextForInstrumentation(const ScriptObje
ct&); |
| 73 ScriptObject wrapWebGLRenderingContextForInstrumentation(const ScriptObject&
); | 73 ScriptObject wrapWebGLRenderingContextForInstrumentation(const ScriptObject&
); |
| 74 | 74 |
| 75 // Called from the front-end. | 75 // Called from the front-end. |
| 76 virtual void enable(ErrorString*); | 76 virtual void enable(ErrorString*) OVERRIDE; |
| 77 virtual void disable(ErrorString*); | 77 virtual void disable(ErrorString*) OVERRIDE; |
| 78 virtual void dropTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogI
d&); | 78 virtual void dropTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogI
d&) OVERRIDE; |
| 79 virtual void hasUninstrumentedCanvases(ErrorString*, bool*); | 79 virtual void hasUninstrumentedCanvases(ErrorString*, bool*) OVERRIDE; |
| 80 virtual void captureFrame(ErrorString*, const TypeBuilder::Page::FrameId*, T
ypeBuilder::Canvas::TraceLogId*); | 80 virtual void captureFrame(ErrorString*, const TypeBuilder::Page::FrameId*, T
ypeBuilder::Canvas::TraceLogId*) OVERRIDE; |
| 81 virtual void startCapturing(ErrorString*, const TypeBuilder::Page::FrameId*,
TypeBuilder::Canvas::TraceLogId*); | 81 virtual void startCapturing(ErrorString*, const TypeBuilder::Page::FrameId*,
TypeBuilder::Canvas::TraceLogId*) OVERRIDE; |
| 82 virtual void stopCapturing(ErrorString*, const TypeBuilder::Canvas::TraceLog
Id&); | 82 virtual void stopCapturing(ErrorString*, const TypeBuilder::Canvas::TraceLog
Id&) OVERRIDE; |
| 83 virtual void getTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId
&, const int*, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>&); | 83 virtual void getTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId
&, const int*, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>&) OVERRIDE; |
| 84 virtual void replayTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLo
gId&, int, RefPtr<TypeBuilder::Canvas::ResourceState>&, double*); | 84 virtual void replayTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLo
gId&, int, RefPtr<TypeBuilder::Canvas::ResourceState>&, double*) OVERRIDE; |
| 85 virtual void getResourceState(ErrorString*, const TypeBuilder::Canvas::Trace
LogId&, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::Reso
urceState>&); | 85 virtual void getResourceState(ErrorString*, const TypeBuilder::Canvas::Trace
LogId&, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::Reso
urceState>&) OVERRIDE; |
| 86 virtual void evaluateTraceLogCallArgument(ErrorString*, const TypeBuilder::C
anvas::TraceLogId&, int, int, const String*, RefPtr<TypeBuilder::Runtime::Remote
Object>&, RefPtr<TypeBuilder::Canvas::ResourceState>&); | 86 virtual void evaluateTraceLogCallArgument(ErrorString*, const TypeBuilder::C
anvas::TraceLogId&, int, int, const String*, RefPtr<TypeBuilder::Runtime::Remote
Object>&, RefPtr<TypeBuilder::Canvas::ResourceState>&) OVERRIDE; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 InspectorCanvasAgent(InstrumentingAgents*, InspectorCompositeState*, Inspect
orPageAgent*, InjectedScriptManager*); | 89 InspectorCanvasAgent(InstrumentingAgents*, InspectorCompositeState*, Inspect
orPageAgent*, InjectedScriptManager*); |
| 90 | 90 |
| 91 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, ScriptSt
ate*); | 91 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, ScriptSt
ate*); |
| 92 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const Sc
riptObject&); | 92 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const Sc
riptObject&); |
| 93 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const St
ring&); | 93 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const St
ring&); |
| 94 | 94 |
| 95 void findFramesWithUninstrumentedCanvases(); | 95 void findFramesWithUninstrumentedCanvases(); |
| 96 bool checkIsEnabled(ErrorString*) const; | 96 bool checkIsEnabled(ErrorString*) const; |
| 97 ScriptObject notifyRenderingContextWasWrapped(const ScriptObject&); | 97 ScriptObject notifyRenderingContextWasWrapped(const ScriptObject&); |
| 98 | 98 |
| 99 InspectorPageAgent* m_pageAgent; | 99 InspectorPageAgent* m_pageAgent; |
| 100 InjectedScriptManager* m_injectedScriptManager; | 100 InjectedScriptManager* m_injectedScriptManager; |
| 101 InspectorFrontend::Canvas* m_frontend; | 101 InspectorFrontend::Canvas* m_frontend; |
| 102 bool m_enabled; | 102 bool m_enabled; |
| 103 // Contains all frames with canvases, value is true only for frames that hav
e an uninstrumented canvas. | 103 // Contains all frames with canvases, value is true only for frames that hav
e an uninstrumented canvas. |
| 104 typedef HashMap<Frame*, bool> FramesWithUninstrumentedCanvases; | 104 typedef HashMap<Frame*, bool> FramesWithUninstrumentedCanvases; |
| 105 FramesWithUninstrumentedCanvases m_framesWithUninstrumentedCanvases; | 105 FramesWithUninstrumentedCanvases m_framesWithUninstrumentedCanvases; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace WebCore | 108 } // namespace WebCore |
| 109 | 109 |
| 110 | 110 |
| 111 #endif // !defined(InspectorCanvasAgent_h) | 111 #endif // !defined(InspectorCanvasAgent_h) |
| OLD | NEW |