OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CanvasRenderingContextFactory_h | 5 #ifndef CanvasRenderingContextFactory_h |
6 #define CanvasRenderingContextFactory_h | 6 #define CanvasRenderingContextFactory_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 10 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
11 #include "core/html/canvas/CanvasRenderingContext.h" | 11 #include "core/html/canvas/CanvasRenderingContext.h" |
| 12 #include "wtf/Allocator.h" |
12 #include "wtf/PassRefPtr.h" | 13 #include "wtf/PassRefPtr.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 class HTMLCanvasElement; | 17 class HTMLCanvasElement; |
17 | 18 |
18 class CORE_EXPORT CanvasRenderingContextFactory { | 19 class CORE_EXPORT CanvasRenderingContextFactory { |
| 20 WTF_MAKE_FAST_ALLOCATED(CanvasRenderingContextFactory); |
| 21 WTF_MAKE_NONCOPYABLE(CanvasRenderingContextFactory); |
19 public: | 22 public: |
| 23 CanvasRenderingContextFactory() = default; |
20 virtual ~CanvasRenderingContextFactory() { } | 24 virtual ~CanvasRenderingContextFactory() { } |
21 | 25 |
22 virtual PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElem
ent*, const CanvasContextCreationAttributes&, Document&) = 0; | 26 virtual PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElem
ent*, const CanvasContextCreationAttributes&, Document&) = 0; |
23 virtual CanvasRenderingContext::ContextType contextType() const = 0; | 27 virtual CanvasRenderingContext::ContextType contextType() const = 0; |
24 virtual void onError(HTMLCanvasElement*, const String& error) = 0; | 28 virtual void onError(HTMLCanvasElement*, const String& error) = 0; |
25 }; | 29 }; |
26 | 30 |
27 } // namespace blink | 31 } // namespace blink |
28 | 32 |
29 #endif // CanvasRenderingContextFactory_h | 33 #endif // CanvasRenderingContextFactory_h |
OLD | NEW |