Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Issue 24195005: Fix ImportDataHandler crash. (Closed)

Created:
7 years, 3 months ago by gab
Modified:
7 years, 3 months ago
Reviewers:
Evan Stade
CC:
chromium-reviews, dbeam+watch-options_chromium.org, tfarina, Ilya Sherman
Visibility:
Public.

Description

Fix ImportDataHandler crash. The same ImportDataHandler lives throughout the browser process and handles all imports. The following could thus result in derefing a NULL pointer: 1) Importer1 launches (and importer_host_ is set to it) 2) Importer2 launches (and importer_host_ is set to it) 3) Importer2 is done and notifies us via ImportEnded 4) This results in us setting importer_host_ = NULL; 5) Importer1 is done and notifies us via ImportEnded 6) This result in us calling importer_host_->set_observer(NULL); when importer_host_ is NULL This CL makes it so that on a new import request if importer_host_ is not NULL we do importer_host_->set_observer(NULL) in order to let the ongoing import finish silently without bothering us when it's done. The current UI is such that it is possible to spam-click the import button and generate multiple identical imports; perhaps this should be fixed, but as a fix for M30 I think this is the simplest we can do. This problem was also present in another method added in http://crrev.com/216947; moved some code around to fix both issues at once. BUG=292791 TEST=Repro steps @ https://code.google.com/p/chromium/issues/detail?id=292791#c4 no longer result in crash. R=estade@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=223933

Patch Set 1 #

Total comments: 2

Patch Set 2 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -29 lines) Patch
M chrome/browser/ui/webui/options/import_data_handler.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/options/import_data_handler.cc View 1 3 chunks +32 lines, -29 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
gab
Evan, please take a look. Thanks! Gab
7 years, 3 months ago (2013-09-17 22:50:30 UTC) #1
Evan Stade
lgtm https://chromiumcodereview.appspot.com/24195005/diff/1/chrome/browser/ui/webui/options/import_data_handler.cc File chrome/browser/ui/webui/options/import_data_handler.cc (right): https://chromiumcodereview.appspot.com/24195005/diff/1/chrome/browser/ui/webui/options/import_data_handler.cc#newcode220 chrome/browser/ui/webui/options/import_data_handler.cc:220: void* /* params */) { nit: int /*index*/ ...
7 years, 3 months ago (2013-09-17 23:20:09 UTC) #2
gab
Thanks! https://chromiumcodereview.appspot.com/24195005/diff/1/chrome/browser/ui/webui/options/import_data_handler.cc File chrome/browser/ui/webui/options/import_data_handler.cc (right): https://chromiumcodereview.appspot.com/24195005/diff/1/chrome/browser/ui/webui/options/import_data_handler.cc#newcode220 chrome/browser/ui/webui/options/import_data_handler.cc:220: void* /* params */) { On 2013/09/17 23:20:10, ...
7 years, 3 months ago (2013-09-18 14:32:35 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/24195005/7001
7 years, 3 months ago (2013-09-18 14:33:02 UTC) #4
gab
7 years, 3 months ago (2013-09-18 20:37:38 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 manually as r223933 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698