Commit fa842d42 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

ExtensionInputMethodEventRouter: DCHECK -> early exit

Bug: 752315
Change-Id: Iaee8b7f66471482f08dc3c310523e6fb88bb7a50
Reviewed-on: https://chromium-review.googlesource.com/c/1260015Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597254}
parent 625f4a72
...@@ -35,11 +35,12 @@ void ExtensionInputMethodEventRouter::InputMethodChanged( ...@@ -35,11 +35,12 @@ void ExtensionInputMethodEventRouter::InputMethodChanged(
input_method::InputMethodManager* manager, input_method::InputMethodManager* manager,
Profile* profile, Profile* profile,
bool show_message) { bool show_message) {
// This should probably be CHECK, as delivering event to a wrong // If an event is recieved from a different profile, e.g. while switching
// profile means delivering it to a wrong extension instance. // between multiple profiles, ignore it.
DCHECK(profile->IsSameProfile(Profile::FromBrowserContext(context_))); if (!profile->IsSameProfile(Profile::FromBrowserContext(context_)))
extensions::EventRouter* router = extensions::EventRouter::Get(context_); return;
extensions::EventRouter* router = extensions::EventRouter::Get(context_);
if (!router->HasEventListener(OnChanged::kEventName)) if (!router->HasEventListener(OnChanged::kEventName))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment