Skip to content

Commit

Permalink
Fix the compile errors in image-decoders
Browse files Browse the repository at this point in the history
In preparation for moving this code to components/, fix the compiler
errors when they are compiled as new files.

- error: [chromium-style] Classes that are ref-counted should have destructors that are declared protected or private.

-error: [chromium-style] virtual methods with non-empty bodies shouldn't be declared inline.

Bug: 1462922
Change-Id: Ic7540f67c88cbd6b41be0810a5f93c5c73cf2b5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4795549
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185483}
  • Loading branch information
Maggie Chen authored and Chromium LUCI CQ committed Aug 19, 2023
1 parent f14c12e commit f60d2de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ absl::optional<gfx::HDRMetadata> ImageDecoder::GetHDRMetadata() const {
return absl::nullopt;
}

gfx::Size ImageDecoder::FrameSizeAtIndex(wtf_size_t) const {
return Size();
}

cc::ImageHeaderMetadata ImageDecoder::MakeMetadataForDecodeAcceleration()
const {
DCHECK(IsDecodedSizeAvailable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class PLATFORM_EXPORT ImageDecoder {
// sizes. This does NOT differ from Size() for GIF or WebP, since
// decoding GIF or WebP composites any smaller frames against previous
// frames to create full-size frames.
virtual gfx::Size FrameSizeAtIndex(wtf_size_t) const { return Size(); }
virtual gfx::Size FrameSizeAtIndex(wtf_size_t) const;

// Returns whether the size is legal (i.e. not going to result in
// overflow elsewhere). If not, marks decoding as failed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ class PLATFORM_EXPORT SegmentReader
SegmentReader() = default;
SegmentReader(const SegmentReader&) = delete;
SegmentReader& operator=(const SegmentReader&) = delete;
virtual ~SegmentReader() = default;
virtual size_t size() const = 0;
virtual size_t GetSomeData(const char*& data, size_t position) const = 0;
virtual sk_sp<SkData> GetAsSkData() const = 0;
virtual void LockData() {}
virtual void UnlockData() {}

protected:
friend class ThreadSafeRefCounted<SegmentReader>;
virtual ~SegmentReader() = default;
};

} // namespace blink
Expand Down

0 comments on commit f60d2de

Please sign in to comment.