diff options
author | tengs <tengs@chromium.org> | 2015-08-07 13:48:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 20:49:29 +0000 |
commit | feed9b6913eccb5988b1c25e676c44c87acf178a (patch) | |
tree | 497b7767fb567e74e80e799086cf38932a882e00 /components/proximity_auth | |
parent | e884c3ab04a7cb1901660f45dfba1c4223bbfa8d (diff) | |
download | chromium_src-feed9b6913eccb5988b1c25e676c44c87acf178a.zip chromium_src-feed9b6913eccb5988b1c25e676c44c87acf178a.tar.gz chromium_src-feed9b6913eccb5988b1c25e676c44c87acf178a.tar.bz2 |
Fix crash in chrome://proximity-auth.
BUG=516625
TEST=manual
Review URL: https://codereview.chromium.org/1280613004
Cr-Commit-Position: refs/heads/master@{#342435}
Diffstat (limited to 'components/proximity_auth')
-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( |