Skip to content

Unify thread-assertion macros on CEF_REQUIRE_* and retire src/common/util.h #697

Description

@linesight

The codebase mixes two spellings of the same assertion: REQUIRE_UI_THREAD from src/common/util.h, and CEF_REQUIRE_UI_THREAD from the vendored include/wrapper/cef_helpers.h. Same meaning, two names — worth settling on one.

I'd suggest converging on the CEF_REQUIRE_* form rather than the bare one:

  • src/common/util.h is a stale verbatim copy of the old cef/tests/cefclient/util.h (the guard is still CEF_TESTS_CEFCLIENT_UTIL_H_); upstream replaced it with cef_helpers.h. cef_helpers.h ships with CEF and stays current.
  • util.h has already rotted: REQUIRE_FILE_THREAD() references TID_FILE, removed from CEF years ago. It survives because ASSERT under NDEBUG expands to ((void)0) and never parses its argument, whereas DCHECK keeps referencing the condition — so the CEF_ variants keep type-checking in release builds.
  • The current CEF_REQUIRE_UI_THREAD sites live in dialog_handler_gtk.cpp and print_handler_gtk.cpp, both maintained as upstream copies with .patch files. Rewriting them toward the bare form would enlarge the diff we re-sync against.
  • util.h also exposes a bare ASSERT macro through cefpython_public_api.h, which is collision-prone.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions