| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef TransferableImageBitmap_h | |
| 6 #define TransferableImageBitmap_h | |
| 7 | |
| 8 #include "bindings/core/v8/Transferable.h" | |
| 9 #include "core/CoreExport.h" | |
| 10 #include "core/frame/ImageBitmap.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class CORE_EXPORT TransferableImageBitmap : public Transferable { | |
| 15 public: | |
| 16 ~TransferableImageBitmap() override { } | |
| 17 void append(ImageBitmap* imageBitmap) | |
| 18 { | |
| 19 m_imageBitmapArray.append(imageBitmap); | |
| 20 } | |
| 21 bool contains(ImageBitmap* imageBitmap) | |
| 22 { | |
| 23 return m_imageBitmapArray.contains(imageBitmap); | |
| 24 } | |
| 25 static TransferableImageBitmap* ensure(TransferableArray& transferables) | |
| 26 { | |
| 27 if (transferables.size() <= TransferableImageBitmapType) { | |
| 28 transferables.resize(TransferableImageBitmapType + 1); | |
| 29 transferables[TransferableImageBitmapType] = new TransferableImageBi
tmap(); | |
| 30 } | |
| 31 return static_cast<TransferableImageBitmap*>(transferables[TransferableI
mageBitmapType].get()); | |
| 32 } | |
| 33 static TransferableImageBitmap* get(TransferableArray& transferables) | |
| 34 { | |
| 35 if (transferables.size() <= TransferableImageBitmapType) | |
| 36 return nullptr; | |
| 37 return static_cast<TransferableImageBitmap*>(transferables[TransferableI
mageBitmapType].get()); | |
| 38 } | |
| 39 HeapVector<Member<ImageBitmap>, 1>& getArray() | |
| 40 { | |
| 41 return m_imageBitmapArray; | |
| 42 } | |
| 43 DEFINE_INLINE_TRACE() | |
| 44 { | |
| 45 visitor->trace(m_imageBitmapArray); | |
| 46 Transferable::trace(visitor); | |
| 47 } | |
| 48 private: | |
| 49 HeapVector<Member<ImageBitmap>, 1> m_imageBitmapArray; | |
| 50 }; | |
| 51 | |
| 52 } // namespace blink | |
| 53 | |
| 54 #endif // TransferableImageBitmap_h | |
| OLD | NEW |