| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" | 5 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/UnionTypesModules.h" | 7 #include "bindings/modules/v8/UnionTypesModules.h" |
| 8 #include "core/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.h" |
| 9 #include "platform/graphics/ImageBuffer.h" | 9 #include "platform/graphics/ImageBuffer.h" |
| 10 #include "platform/graphics/StaticBitmapImage.h" | 10 #include "platform/graphics/StaticBitmapImage.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 { | 40 { |
| 41 return getOffscreenCanvas()->setOriginTainted(); | 41 return getOffscreenCanvas()->setOriginTainted(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* sour
ce, ExecutionContext* executionContext) | 44 bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* sour
ce, ExecutionContext* executionContext) |
| 45 { | 45 { |
| 46 if (executionContext->isWorkerGlobalScope()) { | 46 if (executionContext->isWorkerGlobalScope()) { |
| 47 // Currently, we only support passing in ImageBitmap as source image in | 47 // Currently, we only support passing in ImageBitmap as source image in |
| 48 // drawImage() or createPattern() in a OffscreenCanvas2d in worker. | 48 // drawImage() or createPattern() in a OffscreenCanvas2d in worker. |
| 49 ASSERT(source->isImageBitmap()); | 49 ASSERT(source->isImageBitmap()); |
| 50 // ImageBitmap wouldTaintOrigin doesn't consider destinationSecurityOrig
in. | |
| 51 return source->wouldTaintOrigin(nullptr); | |
| 52 } | 50 } |
| 53 | 51 |
| 54 // TODO(crbug.com/606925): implement wouldTaintOrigin for OffscreenCanvas2d | 52 return CanvasRenderingContext::wouldTaintOrigin(source, executionContext->ge
tSecurityOrigin()); |
| 55 // on main thread | |
| 56 NOTIMPLEMENTED(); | |
| 57 return true; | |
| 58 } | 53 } |
| 59 | 54 |
| 60 int OffscreenCanvasRenderingContext2D::width() const | 55 int OffscreenCanvasRenderingContext2D::width() const |
| 61 { | 56 { |
| 62 return getOffscreenCanvas()->width(); | 57 return getOffscreenCanvas()->width(); |
| 63 } | 58 } |
| 64 | 59 |
| 65 int OffscreenCanvasRenderingContext2D::height() const | 60 int OffscreenCanvasRenderingContext2D::height() const |
| 66 { | 61 { |
| 67 return getOffscreenCanvas()->height(); | 62 return getOffscreenCanvas()->height(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 152 } |
| 158 #endif | 153 #endif |
| 159 } | 154 } |
| 160 | 155 |
| 161 bool OffscreenCanvasRenderingContext2D::isContextLost() const | 156 bool OffscreenCanvasRenderingContext2D::isContextLost() const |
| 162 { | 157 { |
| 163 return false; | 158 return false; |
| 164 } | 159 } |
| 165 | 160 |
| 166 } | 161 } |
| OLD | NEW |