by magreenblatt » Wed Nov 25, 2015 1:01 pm
They provide an abstraction for platform-specific implementations and functional layering. For example, the platform-specific window classes (BrowserWindowOsrWin, BrowserWindowStdWin, etc.) implement BrowserWindow. Whatever owns the browser window (in this case RootWindow) then implements BrowserWindow::Delegate to be notified of important events. The alternative would be passing a RootWindow pointer to BrowserWindow which might then lead to the creation of accidental dependency loops or incorrect access to RootWindow members from the BrowserWindow implementation.