summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:14:10 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:14:10 +0000
commit6cbf718e873eca34359cae7c220c408385fbc0b1 (patch)
tree9b0aea1c65804e351fd98368dfdd02a90cdd296d /views
parent00ad5cd4580cb8184a641d771a113abb0ab7ef4c (diff)
downloadchromium_src-6cbf718e873eca34359cae7c220c408385fbc0b1.zip
chromium_src-6cbf718e873eca34359cae7c220c408385fbc0b1.tar.gz
chromium_src-6cbf718e873eca34359cae7c220c408385fbc0b1.tar.bz2
Fixes unintialized read in networkmenu. Menu's constructor calls into
the delegate, making using 'this' in the member intializer list for creating a menu problematic. I've changed it to a scoped_ptr and created as needed. BUG=none TEST=none Review URL: http://codereview.chromium.org/552187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/menu/menu_2.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/views/controls/menu/menu_2.h b/views/controls/menu/menu_2.h
index 4bfe9b9..416c949 100644
--- a/views/controls/menu/menu_2.h
+++ b/views/controls/menu/menu_2.h
@@ -20,6 +20,12 @@ class NativeMenuGtk;
// A menu. Populated from a model, and relies on a delegate to execute commands.
class Menu2 {
public:
+ // Creates a new menu populated with the contents of |model|.
+ // WARNING: this populates the menu on construction by invoking methods on
+ // the model. As such, it is typically not safe to use this as the model
+ // from the constructor. EG:
+ // MyClass : menu_(this) {}
+ // is likely to have problems.
explicit Menu2(menus::MenuModel* model);
virtual ~Menu2() {}