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

Side by Side Diff: third_party/WebKit/Source/core/html/ImageData.h

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: remove unused checks Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 15 matching lines...) Expand all
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef ImageData_h 29 #ifndef ImageData_h
30 #define ImageData_h 30 #define ImageData_h
31 31
32 #include "bindings/core/v8/ScriptWrappable.h" 32 #include "bindings/core/v8/ScriptWrappable.h"
33 #include "bindings/core/v8/Uint8ClampedArrayOrUint16ArrayOrFloat32Array.h" 33 #include "bindings/core/v8/Uint8ClampedArrayOrUint16ArrayOrFloat32Array.h"
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "core/dom/DOMTypedArray.h" 35 #include "core/dom/DOMTypedArray.h"
36 #include "core/dom/NotShared.h"
36 #include "core/html/ImageDataColorSettings.h" 37 #include "core/html/ImageDataColorSettings.h"
37 #include "core/html/canvas/CanvasRenderingContext.h" 38 #include "core/html/canvas/CanvasRenderingContext.h"
38 #include "core/imagebitmap/ImageBitmapSource.h" 39 #include "core/imagebitmap/ImageBitmapSource.h"
39 #include "platform/geometry/IntRect.h" 40 #include "platform/geometry/IntRect.h"
40 #include "platform/geometry/IntSize.h" 41 #include "platform/geometry/IntSize.h"
41 #include "platform/heap/Handle.h" 42 #include "platform/heap/Handle.h"
42 #include "third_party/skia/include/core/SkColorSpace.h" 43 #include "third_party/skia/include/core/SkColorSpace.h"
43 #include "wtf/CheckedNumeric.h" 44 #include "wtf/CheckedNumeric.h"
44 #include "wtf/Compiler.h" 45 #include "wtf/Compiler.h"
45 #include "wtf/text/WTFString.h" 46 #include "wtf/text/WTFString.h"
(...skipping 27 matching lines...) Expand all
73 constexpr const char* kUint16ArrayStorageFormatName = "uint16"; 74 constexpr const char* kUint16ArrayStorageFormatName = "uint16";
74 constexpr const char* kFloat32ArrayStorageFormatName = "float32"; 75 constexpr const char* kFloat32ArrayStorageFormatName = "float32";
75 76
76 class CORE_EXPORT ImageData final : public GarbageCollectedFinalized<ImageData>, 77 class CORE_EXPORT ImageData final : public GarbageCollectedFinalized<ImageData>,
77 public ScriptWrappable, 78 public ScriptWrappable,
78 public ImageBitmapSource { 79 public ImageBitmapSource {
79 DEFINE_WRAPPERTYPEINFO(); 80 DEFINE_WRAPPERTYPEINFO();
80 81
81 public: 82 public:
82 static ImageData* create(const IntSize&); 83 static ImageData* create(const IntSize&);
83 static ImageData* create(const IntSize&, DOMUint8ClampedArray*); 84 static ImageData* create(const IntSize&,
84 85 const NotShared<DOMUint8ClampedArray>&);
85 static ImageData* create(unsigned width, unsigned height, ExceptionState&); 86 static ImageData* create(unsigned width, unsigned height, ExceptionState&);
86 static ImageData* create(DOMUint8ClampedArray*, 87 static ImageData* create(const NotShared<DOMUint8ClampedArray>&,
87 unsigned width, 88 unsigned width,
88 ExceptionState&); 89 ExceptionState&);
89 static ImageData* create(DOMUint8ClampedArray*, 90 static ImageData* create(const NotShared<DOMUint8ClampedArray>&,
90 unsigned width, 91 unsigned width,
91 unsigned height, 92 unsigned height,
92 ExceptionState&); 93 ExceptionState&);
93 94
94 static ImageData* createForTest(const IntSize&); 95 static ImageData* createForTest(const IntSize&);
95 96
96 ImageData* createImageData(unsigned width, 97 ImageData* createImageData(unsigned width,
97 unsigned height, 98 unsigned height,
98 const ImageDataColorSettings&, 99 const ImageDataColorSettings&,
99 ExceptionState&); 100 ExceptionState&);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 161
161 static DOMArrayBufferView* allocateAndValidateDataArray( 162 static DOMArrayBufferView* allocateAndValidateDataArray(
162 const unsigned&, 163 const unsigned&,
163 ImageDataStorageFormat, 164 ImageDataStorageFormat,
164 ExceptionState* = nullptr); 165 ExceptionState* = nullptr);
165 }; 166 };
166 167
167 } // namespace blink 168 } // namespace blink
168 169
169 #endif // ImageData_h 170 #endif // ImageData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698