diff options
-rw-r--r-- | components/proximity_auth/webui/proximity_auth_webui_handler.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/proximity_auth/webui/proximity_auth_webui_handler.cc b/components/proximity_auth/webui/proximity_auth_webui_handler.cc index a63671c..4a313be 100644 --- a/components/proximity_auth/webui/proximity_auth_webui_handler.cc +++ b/components/proximity_auth/webui/proximity_auth_webui_handler.cc @@ -154,10 +154,15 @@ void ProximityAuthWebUIHandler::RegisterMessages() { base::Bind(&ProximityAuthWebUIHandler::ToggleConnection, base::Unretained(this))); - LogBuffer::GetInstance()->AddObserver(this); InitGCMManager(); InitEnrollmentManager(); InitDeviceManager(); + + // Note: We add the observer for the logs after initializing the managers + // because when this function is called, the WebUI's underlying WebContents + // has not been initialized, so calling any JavaScript function will crash + // Chrome. + LogBuffer::GetInstance()->AddObserver(this); } void ProximityAuthWebUIHandler::OnLogMessageAdded( |