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

Unified Diff: chrome/browser/custom_home_pages_table_model.cc

Issue 12548008: Really fix crash when dragging and dropping in chrome://settings/startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Snip Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/custom_home_pages_table_model.cc
diff --git a/chrome/browser/custom_home_pages_table_model.cc b/chrome/browser/custom_home_pages_table_model.cc
index 54f1c08779141c1cd68ea67c94de41a9737c06a7..4325c4c190ee65957ee98071bcd9b908cecbabd4 100644
--- a/chrome/browser/custom_home_pages_table_model.cc
+++ b/chrome/browser/custom_home_pages_table_model.cc
@@ -96,11 +96,9 @@ void CustomHomePagesTableModel::SetURLs(const std::vector<GURL>& urls) {
*/
void CustomHomePagesTableModel::MoveURLs(int insert_before,
const std::vector<int>& index_list) {
- // Was causing crashes when just a DCHECK(), see http://crbug.com/136576.
- if (index_list.empty() || insert_before < 0 || insert_before > RowCount()) {
- NOTREACHED();
- return;
- }
+ DCHECK(!index_list.empty());
+ DCHECK(insert_before >= 0 && insert_before <= RowCount())
+ << "Index out of range: " << insert_before;
Dan Beam 2013/03/09 00:22:04 is this meant to stay here or debugging code? I'd
dcheng 2013/03/09 01:06:22 I figured it didn't matter since it was only going
// The range of elements that needs to be reshuffled is [ |first|, |last| ).
int first = std::min(insert_before, index_list.front());

Powered by Google App Engine
This is Rietveld 408576698