summaryrefslogtreecommitdiffstats
path: root/ui/base/models
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-27 18:26:55 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-27 18:26:55 +0000
commitdac716a0ab0c600bfef13d2738ce749bdc13b03a (patch)
treeb43b908e29adeabdebd90cef463fb365bb9b1e0d /ui/base/models
parent7d38d49f4b858af03db25a13f95dfc42f40414a3 (diff)
downloadchromium_src-dac716a0ab0c600bfef13d2738ce749bdc13b03a.zip
chromium_src-dac716a0ab0c600bfef13d2738ce749bdc13b03a.tar.gz
chromium_src-dac716a0ab0c600bfef13d2738ce749bdc13b03a.tar.bz2
Reverts debugging code that was added to find a crasher. Crash went
away. BUG=95851 TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/8044033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/models')
-rw-r--r--ui/base/models/simple_menu_model.cc54
1 files changed, 11 insertions, 43 deletions
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index 39a732f..90121452 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -12,30 +12,7 @@ namespace ui {
const int kSeparatorId = -1;
-// The instance is alive.
-static const uint32 kMagicIdAlive = 0xCa11ab1e;
-
- // The instance has been deleted.
-static const uint32 kMagicIdDead = 0xDECEA5ED;
-
struct SimpleMenuModel::Item {
-
-// TODO(sky): Remove this when done investigating 95851.
-#if defined(COMPILER_MSVC)
-#pragma optimize("", off)
-MSVC_PUSH_DISABLE_WARNING(4748)
-#endif
-
- ~Item() {
- CHECK_EQ(magic_id, kMagicIdAlive);
- magic_id = kMagicIdDead;
- }
-
-#if defined(COMPILER_MSVC)
-MSVC_POP_WARNING()
-#pragma optimize("", on)
-#endif
-
int command_id;
string16 label;
SkBitmap icon;
@@ -43,7 +20,6 @@ MSVC_POP_WARNING()
int group_id;
MenuModel* submenu;
ButtonMenuItemModel* button_model;
- uint32 magic_id;
};
////////////////////////////////////////////////////////////////////////////////
@@ -91,13 +67,10 @@ SimpleMenuModel::SimpleMenuModel(Delegate* delegate)
}
SimpleMenuModel::~SimpleMenuModel() {
- for (size_t i = 0; i < items_.size(); ++i)
- CHECK_EQ(kMagicIdAlive, items_[i].magic_id) << i;
}
void SimpleMenuModel::AddItem(int command_id, const string16& label) {
- Item item = { command_id, label, SkBitmap(), TYPE_COMMAND, -1, NULL, NULL,
- kMagicIdAlive};
+ Item item = { command_id, label, SkBitmap(), TYPE_COMMAND, -1, NULL, NULL };
AppendItem(item);
}
@@ -107,13 +80,12 @@ void SimpleMenuModel::AddItemWithStringId(int command_id, int string_id) {
void SimpleMenuModel::AddSeparator() {
Item item = { kSeparatorId, string16(), SkBitmap(), TYPE_SEPARATOR, -1,
- NULL, NULL, kMagicIdAlive };
+ NULL, NULL };
AppendItem(item);
}
void SimpleMenuModel::AddCheckItem(int command_id, const string16& label) {
- Item item = { command_id, label, SkBitmap(), TYPE_CHECK, -1, NULL,
- NULL, kMagicIdAlive };
+ Item item = { command_id, label, SkBitmap(), TYPE_CHECK, -1, NULL, NULL };
AppendItem(item);
}
@@ -124,7 +96,7 @@ void SimpleMenuModel::AddCheckItemWithStringId(int command_id, int string_id) {
void SimpleMenuModel::AddRadioItem(int command_id, const string16& label,
int group_id) {
Item item = { command_id, label, SkBitmap(), TYPE_RADIO, group_id, NULL,
- NULL, kMagicIdAlive };
+ NULL };
AppendItem(item);
}
@@ -136,14 +108,13 @@ void SimpleMenuModel::AddRadioItemWithStringId(int command_id, int string_id,
void SimpleMenuModel::AddButtonItem(int command_id,
ButtonMenuItemModel* model) {
Item item = { command_id, string16(), SkBitmap(), TYPE_BUTTON_ITEM, -1, NULL,
- model, kMagicIdAlive };
+ model };
AppendItem(item);
}
void SimpleMenuModel::AddSubMenu(int command_id, const string16& label,
MenuModel* model) {
- Item item = { command_id, label, SkBitmap(), TYPE_SUBMENU, -1, model, NULL,
- kMagicIdAlive };
+ Item item = { command_id, label, SkBitmap(), TYPE_SUBMENU, -1, model, NULL };
AppendItem(item);
}
@@ -154,8 +125,7 @@ void SimpleMenuModel::AddSubMenuWithStringId(int command_id,
void SimpleMenuModel::InsertItemAt(
int index, int command_id, const string16& label) {
- Item item = { command_id, label, SkBitmap(), TYPE_COMMAND, -1, NULL, NULL,
- kMagicIdAlive };
+ Item item = { command_id, label, SkBitmap(), TYPE_COMMAND, -1, NULL, NULL };
InsertItemAtIndex(item, index);
}
@@ -166,14 +136,13 @@ void SimpleMenuModel::InsertItemWithStringIdAt(
void SimpleMenuModel::InsertSeparatorAt(int index) {
Item item = { kSeparatorId, string16(), SkBitmap(), TYPE_SEPARATOR, -1,
- NULL, NULL, kMagicIdAlive };
+ NULL, NULL };
InsertItemAtIndex(item, index);
}
void SimpleMenuModel::InsertCheckItemAt(
int index, int command_id, const string16& label) {
- Item item = { command_id, label, SkBitmap(), TYPE_CHECK, -1, NULL, NULL,
- kMagicIdAlive };
+ Item item = { command_id, label, SkBitmap(), TYPE_CHECK, -1, NULL, NULL };
InsertItemAtIndex(item, index);
}
@@ -186,7 +155,7 @@ void SimpleMenuModel::InsertCheckItemWithStringIdAt(
void SimpleMenuModel::InsertRadioItemAt(
int index, int command_id, const string16& label, int group_id) {
Item item = { command_id, label, SkBitmap(), TYPE_RADIO, group_id, NULL,
- NULL, kMagicIdAlive };
+ NULL };
InsertItemAtIndex(item, index);
}
@@ -198,8 +167,7 @@ void SimpleMenuModel::InsertRadioItemWithStringIdAt(
void SimpleMenuModel::InsertSubMenuAt(
int index, int command_id, const string16& label, MenuModel* model) {
- Item item = { command_id, label, SkBitmap(), TYPE_SUBMENU, -1, model, NULL,
- kMagicIdAlive };
+ Item item = { command_id, label, SkBitmap(), TYPE_SUBMENU, -1, model, NULL };
InsertItemAtIndex(item, index);
}