Skip to content

Commit

Permalink
ExtensionInputMethodEventRouter: DCHECK -> early exit
Browse files Browse the repository at this point in the history
Bug: 752315
Change-Id: Iaee8b7f66471482f08dc3c310523e6fb88bb7a50
Reviewed-on: https://chromium-review.googlesource.com/c/1260015
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597254}
  • Loading branch information
stevenjb authored and Commit Bot committed Oct 5, 2018
1 parent 625f4a7 commit fa842d4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ void ExtensionInputMethodEventRouter::InputMethodChanged(
input_method::InputMethodManager* manager,
Profile* profile,
bool show_message) {
// This should probably be CHECK, as delivering event to a wrong
// profile means delivering it to a wrong extension instance.
DCHECK(profile->IsSameProfile(Profile::FromBrowserContext(context_)));
extensions::EventRouter* router = extensions::EventRouter::Get(context_);
// If an event is recieved from a different profile, e.g. while switching
// between multiple profiles, ignore it.
if (!profile->IsSameProfile(Profile::FromBrowserContext(context_)))
return;

extensions::EventRouter* router = extensions::EventRouter::Get(context_);
if (!router->HasEventListener(OnChanged::kEventName))
return;

Expand Down

0 comments on commit fa842d4

Please sign in to comment.