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

Issue 2784323002: MD Settings: Second try at fixing ResetSettingsHandler crash (Closed)

Created:
3 years, 8 months ago by tommycli
Modified:
3 years, 8 months ago
Reviewers:
dschuyler, Dan Beam, battre
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, scottchen, Dan Beam
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: Second try at fixing ResetSettingsHandler crash ResetSettingsHandler::ResetProfile is run as a callback owned by the |config_fetcher_| member. However, |config_fetcher_| is also deleted by the ResetProfile method. Since ResetProfile takes a const-ref parameter that's owned by |config_fetcher_|, it clobbers its own parameter. This CL fixes that issue by moving the callback to the stack before the object is deleted from the heap. BUG=660847 Review-Url: https://codereview.chromium.org/2784323002 Cr-Commit-Position: refs/heads/master@{#462122} Committed: https://chromium.googlesource.com/chromium/src/+/890cfea7950ebc5910372deb91ebcbf665362817

Patch Set 1 #

Total comments: 3

Patch Set 2 : fix up here #

Patch Set 3 : fix #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -5 lines) Patch
M chrome/browser/profile_resetter/brandcode_config_fetcher.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/settings/reset_settings_handler.cc View 1 1 chunk +3 lines, -3 lines 3 comments Download

Messages

Total messages: 43 (25 generated)
tommycli
dschuyler: PTAL, thanks! https://codereview.chromium.org/2784323002/diff/1/chrome/browser/ui/webui/settings/reset_settings_handler.cc File chrome/browser/ui/webui/settings/reset_settings_handler.cc (right): https://codereview.chromium.org/2784323002/diff/1/chrome/browser/ui/webui/settings/reset_settings_handler.cc#newcode148 chrome/browser/ui/webui/settings/reset_settings_handler.cc:148: config_fetcher_->SetCallback(base::Bind(&ResetSettingsHandler::ResetProfile, This just reverts the previous ...
3 years, 8 months ago (2017-03-30 15:26:26 UTC) #2
dschuyler
https://codereview.chromium.org/2784323002/diff/1/chrome/browser/ui/webui/settings/reset_settings_handler.cc File chrome/browser/ui/webui/settings/reset_settings_handler.cc (right): https://codereview.chromium.org/2784323002/diff/1/chrome/browser/ui/webui/settings/reset_settings_handler.cc#newcode253 chrome/browser/ui/webui/settings/reset_settings_handler.cc:253: weak_ptr_factory_.GetWeakPtr(), callback_id, send_settings, I'm missing how this is really ...
3 years, 8 months ago (2017-03-30 22:32:07 UTC) #7
dschuyler
https://codereview.chromium.org/2784323002/diff/1/chrome/browser/ui/webui/settings/reset_settings_handler.cc File chrome/browser/ui/webui/settings/reset_settings_handler.cc (right): https://codereview.chromium.org/2784323002/diff/1/chrome/browser/ui/webui/settings/reset_settings_handler.cc#newcode253 chrome/browser/ui/webui/settings/reset_settings_handler.cc:253: weak_ptr_factory_.GetWeakPtr(), callback_id, send_settings, On 2017/03/30 22:32:07, dschuyler wrote: > ...
3 years, 8 months ago (2017-03-30 22:56:01 UTC) #8
Dan Beam
i'm not really sure what's going on here but it seems more legit than that ...
3 years, 8 months ago (2017-03-31 00:20:09 UTC) #10
tommycli
PTAL, hey guys, I dug into this some more this morning, and I'm sure now ...
3 years, 8 months ago (2017-03-31 16:35:24 UTC) #17
dschuyler
I like the direction this is going :) ResetAndReturn() is handy to know about. https://codereview.chromium.org/2784323002/diff/40001/chrome/browser/ui/webui/settings/reset_settings_handler.cc ...
3 years, 8 months ago (2017-03-31 19:21:39 UTC) #20
tommycli
comment below. thanks! https://codereview.chromium.org/2784323002/diff/40001/chrome/browser/ui/webui/settings/reset_settings_handler.cc File chrome/browser/ui/webui/settings/reset_settings_handler.cc (right): https://codereview.chromium.org/2784323002/diff/40001/chrome/browser/ui/webui/settings/reset_settings_handler.cc#newcode239 chrome/browser/ui/webui/settings/reset_settings_handler.cc:239: default_settings = config_fetcher_->GetSettings(); On 2017/03/31 19:21:39, ...
3 years, 8 months ago (2017-04-03 15:34:23 UTC) #23
Dan Beam
because most of our CLs have been speculative while watching for new crashes, I'm happy ...
3 years, 8 months ago (2017-04-03 18:20:14 UTC) #27
dschuyler
lgtm https://codereview.chromium.org/2784323002/diff/40001/chrome/browser/ui/webui/settings/reset_settings_handler.cc File chrome/browser/ui/webui/settings/reset_settings_handler.cc (right): https://codereview.chromium.org/2784323002/diff/40001/chrome/browser/ui/webui/settings/reset_settings_handler.cc#newcode239 chrome/browser/ui/webui/settings/reset_settings_handler.cc:239: default_settings = config_fetcher_->GetSettings(); On 2017/04/03 15:34:23, tommycli wrote: ...
3 years, 8 months ago (2017-04-03 18:27:10 UTC) #28
tommycli
On 2017/04/03 18:27:10, dschuyler wrote: > lgtm > > https://codereview.chromium.org/2784323002/diff/40001/chrome/browser/ui/webui/settings/reset_settings_handler.cc > File chrome/browser/ui/webui/settings/reset_settings_handler.cc (right): > ...
3 years, 8 months ago (2017-04-03 18:31:14 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2784323002/40001
3 years, 8 months ago (2017-04-03 18:32:18 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/401169)
3 years, 8 months ago (2017-04-03 18:54:00 UTC) #33
tommycli
battre: PTAL, thanks!
3 years, 8 months ago (2017-04-03 19:01:55 UTC) #35
tommycli
On 2017/04/03 19:01:55, tommycli wrote: > battre: PTAL, thanks! battre: ping, thanks!
3 years, 8 months ago (2017-04-04 23:18:44 UTC) #36
battre
LGTM I wonder though, whether a simpler/cleaner way would be to asynchronously call the callback ...
3 years, 8 months ago (2017-04-05 12:31:36 UTC) #37
tommycli
On 2017/04/05 12:31:36, battre wrote: > LGTM > > I wonder though, whether a simpler/cleaner ...
3 years, 8 months ago (2017-04-05 16:07:15 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2784323002/40001
3 years, 8 months ago (2017-04-05 16:08:08 UTC) #40
commit-bot: I haz the power
3 years, 8 months ago (2017-04-05 17:04:35 UTC) #43
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/890cfea7950ebc5910372deb91eb...

Powered by Google App Engine
This is Rietveld 408576698