Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Use FML_DCHECK in place of assert in codec utils#38365

Merged
cbracken merged 1 commit intoflutter:mainfrom
cbracken:fix-filename
Dec 17, 2022
Merged

Use FML_DCHECK in place of assert in codec utils#38365
cbracken merged 1 commit intoflutter:mainfrom
cbracken:fix-filename

Conversation

@cbracken
Copy link
Member

@cbracken cbracken commented Dec 16, 2022

Even though the file is pure C code, it's useful to use a C++ or Objective-C++ filename in order to use FML (assertions) in the implementation.

Three implementation changes:

  • Since the file is now C++, some implicit void* conversions now require an explicit cast.
  • A malloc/free of a buffer has been replaced with a std::vector.
  • An assert() was changed to FML_DCHECK for consistency with the rest of the embedder.

No test changes since there are no semantic changes.

Existing tests are in:
https://github.com/flutter/engine/blob/main/shell/platform/darwin/common/framework/Source/flutter_standard_codec_unittest.mm

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants