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 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #include "core/html/canvas/CanvasRenderingContext.h" | 26 #include "core/html/canvas/CanvasRenderingContext.h" |
27 | 27 |
28 #include "core/html/canvas/CanvasImageSource.h" | 28 #include "core/html/canvas/CanvasImageSource.h" |
29 #include "platform/weborigin/SecurityOrigin.h" | 29 #include "platform/weborigin/SecurityOrigin.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas) | 33 CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas) |
34 : ActiveDOMObject(&canvas->document()) | 34 : m_canvas(canvas) |
35 , m_canvas(canvas) | |
36 { | 35 { |
37 suspendIfNeeded(); | |
38 } | 36 } |
39 | 37 |
40 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId(co
nst String& id) | 38 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId(co
nst String& id) |
41 { | 39 { |
42 if (id == "2d") | 40 if (id == "2d") |
43 return Context2d; | 41 return Context2d; |
44 if (id == "experimental-webgl") | 42 if (id == "experimental-webgl") |
45 return ContextExperimentalWebgl; | 43 return ContextExperimentalWebgl; |
46 if (id == "webgl") | 44 if (id == "webgl") |
47 return ContextWebgl; | 45 return ContextWebgl; |
(...skipping 29 matching lines...) Expand all Loading... |
77 m_dirtyURLs.add(sourceURL.string()); | 75 m_dirtyURLs.add(sourceURL.string()); |
78 else | 76 else |
79 m_cleanURLs.add(sourceURL.string()); | 77 m_cleanURLs.add(sourceURL.string()); |
80 } | 78 } |
81 return taintOrigin; | 79 return taintOrigin; |
82 } | 80 } |
83 | 81 |
84 DEFINE_TRACE(CanvasRenderingContext) | 82 DEFINE_TRACE(CanvasRenderingContext) |
85 { | 83 { |
86 visitor->trace(m_canvas); | 84 visitor->trace(m_canvas); |
87 ActiveDOMObject::trace(visitor); | |
88 } | |
89 | |
90 bool CanvasRenderingContext::hasPendingActivity() const | |
91 { | |
92 return false; | |
93 } | |
94 | |
95 void CanvasRenderingContext::didMoveToNewDocument(Document* document) | |
96 { | |
97 ActiveDOMObject::didMoveToNewExecutionContext(document); | |
98 } | 85 } |
99 | 86 |
100 } // namespace blink | 87 } // namespace blink |
OLD | NEW |