CefRegistration
Header: cef_registration.h
Category: System Utilities
Overview
Tasks, threads, parsers, streams, cookies, URL requests, scheme registration, and constant tables.
CefRegistration
Source File: include/cef_registration.h
Process / Thread Context: Browser Process / UI Thread (typical usage context; the class itself imposes no threading constraint — it is a lifetime token).
Purpose: Generic, opaque, ref-counted handle whose lifetime controls the duration of an associated registration (observer subscription, media-route registration, preference observer, etc.). Destroying the last reference unregisters the associated observer. Carries no public methods — it is purely a lifetime token.
Usage Example
cpp
class MyApp {
CefRefPtr<CefRegistration> media_obs_reg_;
void Start() {
auto router = CefMediaRouter::GetGlobalMediaRouter(nullptr);
media_obs_reg_ = router->AddObserver(new MyMediaObserver);
}
void Stop() {
// Releasing the last reference unregisters the observer.
media_obs_reg_ = nullptr;
}
};