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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 class LocalFrame; | 45 class LocalFrame; |
| 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 ScriptValue; | 51 class ScriptValue; |
| 52 | 52 |
| 53 typedef String ErrorString; | 53 typedef String ErrorString; |
| 54 | 54 |
| 55 class InspectorCanvasAgent FINAL : public InspectorBaseAgent<InspectorCanvasAgen t>, public InspectorBackendDispatcher::CanvasCommandHandler { | 55 class InspectorCanvasAgent final : public InspectorBaseAgent<InspectorCanvasAgen t>, public InspectorBackendDispatcher::CanvasCommandHandler { |
| 56 public: | 56 public: |
| 57 static PassOwnPtrWillBeRawPtr<InspectorCanvasAgent> create(InspectorPageAgen t* pageAgent, InjectedScriptManager* injectedScriptManager) | 57 static PassOwnPtrWillBeRawPtr<InspectorCanvasAgent> create(InspectorPageAgen t* pageAgent, InjectedScriptManager* injectedScriptManager) |
| 58 { | 58 { |
| 59 return adoptPtrWillBeNoop(new InspectorCanvasAgent(pageAgent, injectedSc riptManager)); | 59 return adoptPtrWillBeNoop(new InspectorCanvasAgent(pageAgent, injectedSc riptManager)); |
| 60 } | 60 } |
| 61 virtual ~InspectorCanvasAgent(); | 61 virtual ~InspectorCanvasAgent(); |
| 62 virtual void trace(Visitor*) OVERRIDE; | 62 virtual void trace(Visitor*) override; |
| 63 | 63 |
| 64 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 64 virtual void setFrontend(InspectorFrontend*) override; |
| 65 virtual void clearFrontend() OVERRIDE; | 65 virtual void clearFrontend() override; |
| 66 virtual void restore() OVERRIDE; | 66 virtual void restore() override; |
| 67 | 67 |
| 68 void didCommitLoad(LocalFrame*, DocumentLoader*); | 68 void didCommitLoad(LocalFrame*, DocumentLoader*); |
| 69 void frameDetachedFromParent(LocalFrame*); | 69 void frameDetachedFromParent(LocalFrame*); |
| 70 void didBeginFrame(); | 70 void didBeginFrame(); |
| 71 | 71 |
| 72 // Called from InspectorCanvasInstrumentation. | 72 // Called from InspectorCanvasInstrumentation. |
| 73 ScriptValue wrapCanvas2DRenderingContextForInstrumentation(const ScriptValue &); | 73 ScriptValue wrapCanvas2DRenderingContextForInstrumentation(const ScriptValue &); |
| 74 ScriptValue wrapWebGLRenderingContextForInstrumentation(const ScriptValue&); | 74 ScriptValue wrapWebGLRenderingContextForInstrumentation(const ScriptValue&); |
| 75 | 75 |
| 76 // Called from the front-end. | 76 // Called from the front-end. |
| 77 virtual void enable(ErrorString*) OVERRIDE; | 77 virtual void enable(ErrorString*) override; |
| 78 virtual void disable(ErrorString*) OVERRIDE; | 78 virtual void disable(ErrorString*) override; |
| 79 virtual void dropTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogI d&) OVERRIDE; | 79 virtual void dropTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogI d&) override; |
| 80 virtual void hasUninstrumentedCanvases(ErrorString*, bool*) OVERRIDE; | 80 virtual void hasUninstrumentedCanvases(ErrorString*, bool*) override; |
| 81 virtual void captureFrame(ErrorString*, const TypeBuilder::Page::FrameId*, T ypeBuilder::Canvas::TraceLogId*) OVERRIDE; | 81 virtual void captureFrame(ErrorString*, const TypeBuilder::Page::FrameId*, T ypeBuilder::Canvas::TraceLogId*) override; |
| 82 virtual void startCapturing(ErrorString*, const TypeBuilder::Page::FrameId*, TypeBuilder::Canvas::TraceLogId*) OVERRIDE; | 82 virtual void startCapturing(ErrorString*, const TypeBuilder::Page::FrameId*, TypeBuilder::Canvas::TraceLogId*) override; |
| 83 virtual void stopCapturing(ErrorString*, const TypeBuilder::Canvas::TraceLog Id&) OVERRIDE; | 83 virtual void stopCapturing(ErrorString*, const TypeBuilder::Canvas::TraceLog Id&) override; |
| 84 virtual void getTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId &, const int*, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>&) OVERRIDE; | 84 virtual void getTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLogId &, const int*, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>&) override; |
| 85 virtual void replayTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLo gId&, int, RefPtr<TypeBuilder::Canvas::ResourceState>&, double*) OVERRIDE; | 85 virtual void replayTraceLog(ErrorString*, const TypeBuilder::Canvas::TraceLo gId&, int, RefPtr<TypeBuilder::Canvas::ResourceState>&, double*) override; |
| 86 virtual void getResourceState(ErrorString*, const TypeBuilder::Canvas::Trace LogId&, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::Reso urceState>&) OVERRIDE; | 86 virtual void getResourceState(ErrorString*, const TypeBuilder::Canvas::Trace LogId&, const TypeBuilder::Canvas::ResourceId&, RefPtr<TypeBuilder::Canvas::Reso urceState>&) override; |
| 87 virtual void evaluateTraceLogCallArgument(ErrorString*, const TypeBuilder::C anvas::TraceLogId&, int, int, const String*, RefPtr<TypeBuilder::Runtime::Remote Object>&, RefPtr<TypeBuilder::Canvas::ResourceState>&) OVERRIDE; | 87 virtual void evaluateTraceLogCallArgument(ErrorString*, const TypeBuilder::C anvas::TraceLogId&, int, int, const String*, RefPtr<TypeBuilder::Runtime::Remote Object>&, RefPtr<TypeBuilder::Canvas::ResourceState>&) override; |
|
Mike West
2014/10/07 13:37:15
Nit: Trailing whitespace?
MRV
2014/10/07 13:59:48
Done.
| |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 InspectorCanvasAgent(InspectorPageAgent*, InjectedScriptManager*); | 90 InspectorCanvasAgent(InspectorPageAgent*, InjectedScriptManager*); |
| 91 | 91 |
| 92 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, ScriptSt ate*); | 92 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, ScriptSt ate*); |
| 93 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const Sc riptValue&); | 93 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const Sc riptValue&); |
| 94 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const St ring&); | 94 InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const St ring&); |
| 95 | 95 |
| 96 void findFramesWithUninstrumentedCanvases(); | 96 void findFramesWithUninstrumentedCanvases(); |
| 97 bool checkIsEnabled(ErrorString*) const; | 97 bool checkIsEnabled(ErrorString*) const; |
| 98 ScriptValue notifyRenderingContextWasWrapped(const ScriptValue&); | 98 ScriptValue notifyRenderingContextWasWrapped(const ScriptValue&); |
| 99 | 99 |
| 100 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | 100 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 101 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; | 101 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; |
| 102 InspectorFrontend::Canvas* m_frontend; | 102 InspectorFrontend::Canvas* m_frontend; |
| 103 bool m_enabled; | 103 bool m_enabled; |
| 104 // Contains all frames with canvases, value is true only for frames that hav e an uninstrumented canvas. | 104 // Contains all frames with canvases, value is true only for frames that hav e an uninstrumented canvas. |
| 105 typedef HashMap<LocalFrame*, bool> FramesWithUninstrumentedCanvases; | 105 typedef HashMap<LocalFrame*, bool> FramesWithUninstrumentedCanvases; |
| 106 FramesWithUninstrumentedCanvases m_framesWithUninstrumentedCanvases; | 106 FramesWithUninstrumentedCanvases m_framesWithUninstrumentedCanvases; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace blink | 109 } // namespace blink |
| 110 | 110 |
| 111 | 111 |
| 112 #endif // !defined(InspectorCanvasAgent_h) | 112 #endif // !defined(InspectorCanvasAgent_h) |
| OLD | NEW |