Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp

Issue 1662423002: Make CanvasRenderingContext not inherit from ActiveDOMObject (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make the function pure virtual Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698