From 844bf242eb8cf058a52dd523164278bfbde23f42 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Tue, 26 Oct 2010 23:29:19 +0000 Subject: Revert 63962 (broke chromeos and chromium linux builder) - Unrevert r63919: "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 Original Review URL: http://codereview.chromium.org/3982001 TBR=aa Review URL: http://codereview.chromium.org/4186002 TBR=mpcomplete@chromium.org Review URL: http://codereview.chromium.org/4130004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63976 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tabs/tab_strip_model_unittest.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'chrome/browser/tabs') diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 906119c..976509f 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -1511,13 +1511,12 @@ TEST_F(TabStripModelTest, Apps) { #elif defined(OS_POSIX) FilePath path(FILE_PATH_LITERAL("/foo")); #endif - scoped_refptr extension_app(new Extension(path, - Extension::INVALID)); - extension_app->mutable_static_data_->launch_web_url = "http://www.google.com"; + Extension extension_app(path); + extension_app.mutable_static_data_->launch_web_url = "http://www.google.com"; TabContents* contents1 = CreateTabContents(); - contents1->SetExtensionApp(extension_app); + contents1->SetExtensionApp(&extension_app); TabContents* contents2 = CreateTabContents(); - contents2->SetExtensionApp(extension_app); + contents2->SetExtensionApp(&extension_app); TabContents* contents3 = CreateTabContents(); SetID(contents1, 1); -- cgit v1.1