summaryrefslogtreecommitdiffstats
path: root/components/proximity_auth
diff options
context:
space:
mode:
authortengs <tengs@chromium.org>2015-08-07 13:48:54 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-07 20:49:29 +0000
commitfeed9b6913eccb5988b1c25e676c44c87acf178a (patch)
tree497b7767fb567e74e80e799086cf38932a882e00 /components/proximity_auth
parente884c3ab04a7cb1901660f45dfba1c4223bbfa8d (diff)
downloadchromium_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.cc7
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(