Chromium Code Reviews| 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 SegmentReader_h | |
| 6 #define SegmentReader_h | |
| 7 | |
| 8 #include "third_party/skia/include/core/SkData.h" | |
| 9 #include "wtf/Noncopyable.h" | |
| 10 #include "wtf/PassRefPtr.h" | |
| 11 #include "wtf/RefCounted.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 // Interface that looks like SharedBuffer. Used by ImageDecoders to use various | |
| 16 // sources of input including: | |
| 17 // - SharedBuffer | |
| 18 // - for when the caller already has a SharedBuffer | |
| 19 // - SkData | |
| 20 // - for when the caller already has an SkData | |
| 21 // - SkROBuffer | |
| 22 // - for when the caller wants to read/write in different threads | |
| 23 // | |
| 24 // Unlike SharedBuffer, this is a read-only interface. There is no way to | |
| 25 // modify the underlying data source. | |
| 26 class SegmentReader : public RefCounted<SegmentReader> { | |
| 27 WTF_MAKE_NONCOPYABLE(SegmentReader); | |
| 28 public: | |
| 29 SegmentReader() {} | |
| 30 virtual ~SegmentReader() {} | |
| 31 virtual size_t size() const = 0; | |
| 32 virtual size_t getSomeData(const char*& data, size_t position) const = 0; | |
|
Peter Kasting
2016/03/23 02:42:59
Maybe for clarity at the callers this should take
scroggo_chromium
2016/03/24 13:59:46
I'm not opposed to that in theory, but a goal is t
Peter Kasting
2016/03/24 22:05:43
Yeah, that seems sane. Up to you whether you thin
scroggo_chromium
2016/03/25 01:05:10
Acknowledged.
| |
| 33 virtual PassRefPtr<SkData> getAsSkData() const = 0; | |
| 34 }; | |
| 35 | |
| 36 } // namespace blink | |
| 37 #endif // SegmentReader_h | |
| OLD | NEW |