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

Issue 12548008: Really fix crash when dragging and dropping in chrome://settings/startup (Closed)

Created:
7 years, 9 months ago by dcheng
Modified:
7 years, 9 months ago
Reviewers:
James Hawkins, Dan Beam
CC:
chromium-reviews, dbeam+watch-options_chromium.org, arv+watch_chromium.org
Visibility:
Public.

Description

Really fix crash when dragging and dropping in chrome://settings/startup The root cause of this crash was that dropping in the <input> field dispatches a DragDropStartupPage event to the C++ handler. Since the <input> field doesn't have a corresponding index in the C++ model, CustomHomePagesModel would attempt to dereference an index past the end of |entries_|. The fix is to suppress drop events on the <input> field from triggering the C++ handler, since you can't move the <input> field anyway. Also clean up the code to use ints (and remove conversions to/from strings) where appropriate. BUG=132974 TBR=jhawkins Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187153

Patch Set 1 #

Total comments: 5

Patch Set 2 : ints are awesome #

Patch Set 3 : Less Strings #

Patch Set 4 : Snip #

Total comments: 5

Patch Set 5 : Fixes #

Patch Set 6 : Trim quotes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -36 lines) Patch
M chrome/browser/custom_home_pages_table_model.cc View 1 2 3 4 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/browser/resources/options/browser_options_startup_page_list.js View 1 2 3 4 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/resources/options/startup_overlay.js View 1 2 3 4 5 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/ui/webui/options/startup_pages_handler.cc View 1 6 chunks +6 lines, -20 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
dcheng
The original fix didn't actually work because the model might not actually be empty. Oops. ...
7 years, 9 months ago (2013-03-06 22:32:07 UTC) #1
Dan Beam
can you explain how this fixes the crash? I don't know what pageinfo nor modelindex ...
7 years, 9 months ago (2013-03-07 01:20:02 UTC) #2
dcheng
The problem is that when you drag and drop over the input box, we dispatch ...
7 years, 9 months ago (2013-03-07 06:16:32 UTC) #3
Dan Beam
https://codereview.chromium.org/12548008/diff/1/chrome/browser/resources/options/browser_options_startup_page_list.js File chrome/browser/resources/options/browser_options_startup_page_list.js (right): https://codereview.chromium.org/12548008/diff/1/chrome/browser/resources/options/browser_options_startup_page_list.js#newcode238 chrome/browser/resources/options/browser_options_startup_page_list.js:238: dropTarget.pageInfo_.modelIndex == -1) On 2013/03/07 06:16:32, dcheng wrote: > ...
7 years, 9 months ago (2013-03-07 16:56:28 UTC) #4
Dan Beam
lgtm w/nits https://chromiumcodereview.appspot.com/12548008/diff/9001/chrome/browser/custom_home_pages_table_model.cc File chrome/browser/custom_home_pages_table_model.cc (right): https://chromiumcodereview.appspot.com/12548008/diff/9001/chrome/browser/custom_home_pages_table_model.cc#newcode101 chrome/browser/custom_home_pages_table_model.cc:101: << "Index out of range: " << ...
7 years, 9 months ago (2013-03-09 00:22:04 UTC) #5
dcheng
TBRing jhawkins. https://codereview.chromium.org/12548008/diff/9001/chrome/browser/custom_home_pages_table_model.cc File chrome/browser/custom_home_pages_table_model.cc (right): https://codereview.chromium.org/12548008/diff/9001/chrome/browser/custom_home_pages_table_model.cc#newcode101 chrome/browser/custom_home_pages_table_model.cc:101: << "Index out of range: " << ...
7 years, 9 months ago (2013-03-09 01:06:22 UTC) #6
Dan Beam
slgtm
7 years, 9 months ago (2013-03-09 01:21:00 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dcheng@chromium.org/12548008/21002
7 years, 9 months ago (2013-03-09 04:49:14 UTC) #8
commit-bot: I haz the power
7 years, 9 months ago (2013-03-09 14:46:44 UTC) #9
Message was sent while issue was closed.
Change committed as 187153

Powered by Google App Engine
This is Rietveld 408576698