From 9118e93ad88c2809973d1b2f97299cfe1601f20c Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Tue, 26 Oct 2010 18:54:58 +0000 Subject: Part 2 of immutable Extension refactor. I made Extension a refcounted object, and privitized the existing con/destructor and InitFromValue. The only way to get an Extension is to call a factory method. In the next CL, I plan to make the factory method return a const Extension, to guarantee that no one can modify the Extension object after creation. Note: There was a tricky part of this CL because of the difference in semantics between scoped_ptr and scoped_refptr. I had to be careful not to use ptr.release(), since that would result in leaks (an un-Released AddRef). BUG=56558 TEST=no functional change Review URL: http://codereview.chromium.org/3982001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63919 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_menu_manager_unittest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'chrome/browser/extensions/extension_menu_manager_unittest.cc') diff --git a/chrome/browser/extensions/extension_menu_manager_unittest.cc b/chrome/browser/extensions/extension_menu_manager_unittest.cc index 0b653ba..489b5c6 100644 --- a/chrome/browser/extensions/extension_menu_manager_unittest.cc +++ b/chrome/browser/extensions/extension_menu_manager_unittest.cc @@ -44,14 +44,14 @@ class ExtensionMenuManagerTest : public testing::Test { // Creates and returns a test Extension. The caller does *not* own the return // value. Extension* AddExtension(std::string name) { - Extension* extension = prefs_.AddExtension(name); + scoped_refptr extension = prefs_.AddExtension(name); extensions_.push_back(extension); return extension; } protected: ExtensionMenuManager manager_; - ScopedVector extensions_; + ExtensionList extensions_; TestExtensionPrefs prefs_; int next_id_; -- cgit v1.1