| 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 21 matching lines...) Expand all Loading... |
| 32 #include "HTMLImageElement.h" | 32 #include "HTMLImageElement.h" |
| 33 #include "HTMLVideoElement.h" | 33 #include "HTMLVideoElement.h" |
| 34 #include "KURL.h" | 34 #include "KURL.h" |
| 35 #include "SecurityOrigin.h" | 35 #include "SecurityOrigin.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas) | 39 CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas) |
| 40 : m_canvas(canvas) | 40 : m_canvas(canvas) |
| 41 { | 41 { |
| 42 ScriptWrappable::init(this); |
| 42 } | 43 } |
| 43 | 44 |
| 44 bool CanvasRenderingContext::wouldTaintOrigin(const CanvasPattern* pattern) | 45 bool CanvasRenderingContext::wouldTaintOrigin(const CanvasPattern* pattern) |
| 45 { | 46 { |
| 46 if (canvas()->originClean() && pattern && !pattern->originClean()) | 47 if (canvas()->originClean() && pattern && !pattern->originClean()) |
| 47 return true; | 48 return true; |
| 48 return false; | 49 return false; |
| 49 } | 50 } |
| 50 | 51 |
| 51 bool CanvasRenderingContext::wouldTaintOrigin(const HTMLCanvasElement* sourceCan
vas) | 52 bool CanvasRenderingContext::wouldTaintOrigin(const HTMLCanvasElement* sourceCan
vas) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return false; | 106 return false; |
| 106 } | 107 } |
| 107 | 108 |
| 108 void CanvasRenderingContext::checkOrigin(const KURL& url) | 109 void CanvasRenderingContext::checkOrigin(const KURL& url) |
| 109 { | 110 { |
| 110 if (wouldTaintOrigin(url)) | 111 if (wouldTaintOrigin(url)) |
| 111 canvas()->setOriginTainted(); | 112 canvas()->setOriginTainted(); |
| 112 } | 113 } |
| 113 | 114 |
| 114 } // namespace WebCore | 115 } // namespace WebCore |
| OLD | NEW |