~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/inspector/InspectorCanvasAgent.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without
 
5
 * modification, are permitted provided that the following conditions are
 
6
 * met:
 
7
 *
 
8
 *     * Redistributions of source code must retain the above copyright
 
9
 * notice, this list of conditions and the following disclaimer.
 
10
 *     * Redistributions in binary form must reproduce the above
 
11
 * copyright notice, this list of conditions and the following disclaimer
 
12
 * in the documentation and/or other materials provided with the
 
13
 * distribution.
 
14
 *     * Neither the name of Google Inc. nor the names of its
 
15
 * contributors may be used to endorse or promote products derived from
 
16
 * this software without specific prior written permission.
 
17
 *
 
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
29
 */
 
30
 
 
31
#ifndef InspectorCanvasAgent_h
 
32
#define InspectorCanvasAgent_h
 
33
 
 
34
#if ENABLE(INSPECTOR)
 
35
 
 
36
#include "InspectorBaseAgent.h"
 
37
#include "InspectorFrontend.h"
 
38
#include "InspectorTypeBuilder.h"
 
39
#include "ScriptState.h"
 
40
#include <wtf/PassOwnPtr.h>
 
41
#include <wtf/PassRefPtr.h>
 
42
#include <wtf/text/WTFString.h>
 
43
 
 
44
namespace WebCore {
 
45
 
 
46
class InjectedScriptCanvasModule;
 
47
class InjectedScriptManager;
 
48
class InspectorState;
 
49
class InstrumentingAgents;
 
50
class Page;
 
51
class ScriptObject;
 
52
 
 
53
typedef String ErrorString;
 
54
 
 
55
class InspectorCanvasAgent : public InspectorBaseAgent<InspectorCanvasAgent>, public InspectorBackendDispatcher::CanvasCommandHandler {
 
56
public:
 
57
    static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager)
 
58
    {
 
59
        return adoptPtr(new InspectorCanvasAgent(instrumentingAgents, state, page, injectedScriptManager));
 
60
    }
 
61
    ~InspectorCanvasAgent();
 
62
 
 
63
    virtual void setFrontend(InspectorFrontend*);
 
64
    virtual void clearFrontend();
 
65
    virtual void restore();
 
66
 
 
67
    // Called from InspectorCanvasInstrumentation
 
68
    ScriptObject wrapCanvas2DRenderingContextForInstrumentation(const ScriptObject&);
 
69
#if ENABLE(WEBGL)
 
70
    ScriptObject wrapWebGLRenderingContextForInstrumentation(const ScriptObject&);
 
71
#endif
 
72
 
 
73
    // Called from the front-end.
 
74
    virtual void enable(ErrorString*);
 
75
    virtual void disable(ErrorString*);
 
76
    virtual void dropTraceLog(ErrorString*, const String&);
 
77
    virtual void captureFrame(ErrorString*, String*);
 
78
    virtual void startCapturing(ErrorString*, String*);
 
79
    virtual void stopCapturing(ErrorString*, const String&);
 
80
    virtual void getTraceLog(ErrorString*, const String&, const int*, RefPtr<TypeBuilder::Canvas::TraceLog>&);
 
81
    virtual void replayTraceLog(ErrorString*, const String&, int, String*);
 
82
 
 
83
private:
 
84
    InspectorCanvasAgent(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*);
 
85
 
 
86
    InjectedScriptCanvasModule injectedScriptCanvasModuleForTraceLogId(ErrorString*, const String&);
 
87
 
 
88
    Page* m_inspectedPage;
 
89
    InjectedScriptManager* m_injectedScriptManager;
 
90
    InspectorFrontend::Canvas* m_frontend;
 
91
};
 
92
 
 
93
} // namespace WebCore
 
94
 
 
95
#endif // ENABLE(INSPECTOR)
 
96
 
 
97
#endif // !defined(InspectorCanvasAgent_h)