virtual void Visit ( const CefString& code ) override { // Limit to 2MiB for now to prevent freezes (TODO: Optimize that and increase later) if ( code.size () <= 2097152 ) { // Call callback on main thread g_pCore->GetWebCore ()->AddEventToEventQueue ( std::bind ( callback, code ), webView, "GetSourceCode_Visit" ); } }