OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/html/HTMLCanvasElement.h" | 29 #include "core/html/HTMLCanvasElement.h" |
30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
31 #include "wtf/HashSet.h" | 31 #include "wtf/HashSet.h" |
32 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
33 #include "wtf/text/StringHash.h" | 33 #include "wtf/text/StringHash.h" |
34 | 34 |
35 namespace blink { class WebLayer; } | 35 namespace blink { class WebLayer; } |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
| 39 class CanvasImageSource; |
39 class HTMLCanvasElement; | 40 class HTMLCanvasElement; |
40 class KURL; | 41 class KURL; |
41 class WebGLObject; | 42 class WebGLObject; |
42 | 43 |
43 class CanvasRenderingContext : public NoBaseWillBeGarbageCollectedFinalized<Canv
asRenderingContext> { | 44 class CanvasRenderingContext : public NoBaseWillBeGarbageCollectedFinalized<Canv
asRenderingContext> { |
44 WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); | 45 WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); |
45 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 46 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
46 public: | 47 public: |
47 virtual ~CanvasRenderingContext() { } | 48 virtual ~CanvasRenderingContext() { } |
48 | 49 |
49 #if !ENABLE(OILPAN) | 50 #if !ENABLE(OILPAN) |
50 void ref() { m_canvas->ref(); } | 51 void ref() { m_canvas->ref(); } |
51 void deref() { m_canvas->deref(); } | 52 void deref() { m_canvas->deref(); } |
52 #endif | 53 #endif |
53 | 54 |
54 HTMLCanvasElement* canvas() const { return m_canvas; } | 55 HTMLCanvasElement* canvas() const { return m_canvas; } |
55 | 56 |
56 virtual bool is2d() const { return false; } | 57 virtual bool is2d() const { return false; } |
57 virtual bool is3d() const { return false; } | 58 virtual bool is3d() const { return false; } |
58 virtual bool isAccelerated() const { return false; } | 59 virtual bool isAccelerated() const { return false; } |
59 virtual bool hasAlpha() const { return true; } | 60 virtual bool hasAlpha() const { return true; } |
60 | 61 |
61 virtual void paintRenderingResultsToCanvas() {} | 62 virtual void paintRenderingResultsToCanvas() {} |
62 | 63 |
63 virtual blink::WebLayer* platformLayer() const { return 0; } | 64 virtual blink::WebLayer* platformLayer() const { return 0; } |
64 | 65 |
65 virtual void trace(Visitor* visitor) { visitor->trace(m_canvas); } | 66 virtual void trace(Visitor* visitor) { visitor->trace(m_canvas); } |
66 | 67 |
| 68 bool wouldTaintOrigin(CanvasImageSource*); |
| 69 |
67 protected: | 70 protected: |
68 CanvasRenderingContext(HTMLCanvasElement*); | 71 CanvasRenderingContext(HTMLCanvasElement*); |
69 | 72 |
70 private: | 73 private: |
71 RawPtrWillBeMember<HTMLCanvasElement> m_canvas; | 74 RawPtrWillBeMember<HTMLCanvasElement> m_canvas; |
| 75 HashSet<String> m_cleanURLs; |
| 76 HashSet<String> m_dirtyURLs; |
72 }; | 77 }; |
73 | 78 |
74 } // namespace WebCore | 79 } // namespace WebCore |
75 | 80 |
76 #endif | 81 #endif |
OLD | NEW |