diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 16:46:36 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 16:46:36 +0000 |
commit | cadac62e5c2b9f5fef59ce0326bb2cd79ffbe622 (patch) | |
tree | 7b95f103fce509de887c8c5e643604855b57c0ba /chrome | |
parent | 9f6e673c7f43f6ee414f72a74585dad8ebaceec3 (diff) | |
download | chromium_src-cadac62e5c2b9f5fef59ce0326bb2cd79ffbe622.zip chromium_src-cadac62e5c2b9f5fef59ce0326bb2cd79ffbe622.tar.gz chromium_src-cadac62e5c2b9f5fef59ce0326bb2cd79ffbe622.tar.bz2 |
Call scoped_refptr<T>::get() rather than relying on implicit "operator T*"
This upates calls to bound temporary objects to also use get().
While it has the same semantic equivalence to the existing code, this generally
represents a dangerous pattern - indeed, part of the whole motivation for this
change is to make this anti-pattern very visible to authors.
This change simply updates all of the call sites, to allow the "operator T*"
to be removed and preventing new instances. The existing instances will then be
reviewed for "suspicious" changes and updated to use/pass scoped_refptr<T>
rather than T*, as appropriate.
BUG=110610
TBR=darin
Review URL: https://codereview.chromium.org/15984016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
166 files changed, 593 insertions, 509 deletions
diff --git a/chrome/browser/autocomplete/extension_app_provider.cc b/chrome/browser/autocomplete/extension_app_provider.cc index a004ed9..be923c8 100644 --- a/chrome/browser/autocomplete/extension_app_provider.cc +++ b/chrome/browser/autocomplete/extension_app_provider.cc @@ -155,7 +155,7 @@ void ExtensionAppProvider::RefreshAppList() { extension_apps_.clear(); for (ExtensionSet::const_iterator iter = extensions->begin(); iter != extensions->end(); ++iter) { - const extensions::Extension* app = *iter; + const extensions::Extension* app = iter->get(); if (!app->ShouldDisplayInAppLauncher()) continue; // Note: Apps that appear in the NTP only are not added here since this diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index bbce096..ef43b5c 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -210,7 +210,7 @@ bool AutomationProvider::InitializeChannel(const std::string& channel_id) { effective_channel_id, GetChannelMode(use_named_interface), this, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); channel_->AddFilter(automation_resource_message_filter_.get()); #if defined(OS_CHROMEOS) diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index f31c2dd..7a7823d 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -1765,8 +1765,9 @@ std::vector<DictionaryValue*>* GetAppInfoFromExtensions( // Only return information about extensions that are actually apps. if ((*ext)->is_app()) { DictionaryValue* app_info = new DictionaryValue(); - AppLauncherHandler::CreateAppInfo(*ext, ext_service, app_info); - app_info->SetBoolean("is_component_extension", + AppLauncherHandler::CreateAppInfo(ext->get(), ext_service, app_info); + app_info->SetBoolean( + "is_component_extension", (*ext)->location() == extensions::Manifest::COMPONENT); // Convert the launch_type integer into a more descriptive string. diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index e44edb8..bc3f676 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -1286,7 +1286,7 @@ void TestingAutomationProvider::GetBookmarksAsJSON( scoped_refptr<BookmarkStorage> storage( new BookmarkStorage(browser->profile(), bookmark_model, - browser->profile()->GetIOTaskRunner())); + browser->profile()->GetIOTaskRunner().get())); if (!storage->SerializeData(&bookmarks_as_json)) { reply.SendError("Failed to serialize bookmarks"); return; @@ -3109,7 +3109,8 @@ void TestingAutomationProvider::GetPluginsInfoCallback( DictionaryValue* args, IPC::Message* reply_message, const std::vector<webkit::WebPluginInfo>& plugins) { - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile()); + PluginPrefs* plugin_prefs = + PluginPrefs::GetForProfile(browser->profile()).get(); ListValue* items = new ListValue; for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin(); @@ -3162,10 +3163,16 @@ void TestingAutomationProvider::EnablePlugin(Browser* browser, AutomationJSONReply(this, reply_message).SendError("path not specified."); return; } - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile()); - plugin_prefs->EnablePlugin(true, base::FilePath(path), - base::Bind(&DidEnablePlugin, AsWeakPtr(), reply_message, - path, "Could not enable plugin for path %s.")); + PluginPrefs* plugin_prefs = + PluginPrefs::GetForProfile(browser->profile()).get(); + plugin_prefs->EnablePlugin( + true, + base::FilePath(path), + base::Bind(&DidEnablePlugin, + AsWeakPtr(), + reply_message, + path, + "Could not enable plugin for path %s.")); } // Sample json input: @@ -3179,10 +3186,16 @@ void TestingAutomationProvider::DisablePlugin(Browser* browser, AutomationJSONReply(this, reply_message).SendError("path not specified."); return; } - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile()); - plugin_prefs->EnablePlugin(false, base::FilePath(path), - base::Bind(&DidEnablePlugin, AsWeakPtr(), reply_message, - path, "Could not disable plugin for path %s.")); + PluginPrefs* plugin_prefs = + PluginPrefs::GetForProfile(browser->profile()).get(); + plugin_prefs->EnablePlugin( + false, + base::FilePath(path), + base::Bind(&DidEnablePlugin, + AsWeakPtr(), + reply_message, + path, + "Could not disable plugin for path %s.")); } // Sample json input: @@ -3361,7 +3374,7 @@ void TestingAutomationProvider::AddSavedPassword( // Use IMPLICIT_ACCESS since new passwords aren't added in incognito mode. PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - browser->profile(), Profile::IMPLICIT_ACCESS); + browser->profile(), Profile::IMPLICIT_ACCESS).get(); // The password store does not exist for an incognito window. if (password_store == NULL) { @@ -3407,7 +3420,7 @@ void TestingAutomationProvider::RemoveSavedPassword( // Use EXPLICIT_ACCESS since passwords can be removed in incognito mode. PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - browser->profile(), Profile::EXPLICIT_ACCESS); + browser->profile(), Profile::EXPLICIT_ACCESS).get(); if (password_store == NULL) { AutomationJSONReply(this, reply_message).SendError( "Unable to get password store."); @@ -3433,7 +3446,7 @@ void TestingAutomationProvider::GetSavedPasswords( // Use EXPLICIT_ACCESS since saved passwords can be retrieved in // incognito mode. PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - browser->profile(), Profile::EXPLICIT_ACCESS); + browser->profile(), Profile::EXPLICIT_ACCESS).get(); if (password_store == NULL) { AutomationJSONReply reply(this, reply_message); diff --git a/chrome/browser/background/background_application_list_model.cc b/chrome/browser/background/background_application_list_model.cc index 0b6b07a..ffd372a 100644 --- a/chrome/browser/background/background_application_list_model.cc +++ b/chrome/browser/background/background_application_list_model.cc @@ -90,7 +90,7 @@ void GetServiceApplications(ExtensionService* service, for (ExtensionSet::const_iterator cursor = extensions->begin(); cursor != extensions->end(); ++cursor) { - const Extension* extension = *cursor; + const Extension* extension = cursor->get(); if (BackgroundApplicationListModel::IsBackgroundApp(*extension, service->profile())) { applications_result->push_back(extension); @@ -103,7 +103,7 @@ void GetServiceApplications(ExtensionService* service, for (ExtensionSet::const_iterator cursor = extensions->begin(); cursor != extensions->end(); ++cursor) { - const Extension* extension = *cursor; + const Extension* extension = cursor->get(); if (BackgroundApplicationListModel::IsBackgroundApp(*extension, service->profile())) { applications_result->push_back(extension); diff --git a/chrome/browser/background/background_application_list_model_unittest.cc b/chrome/browser/background/background_application_list_model_unittest.cc index a40f27d..de09c28 100644 --- a/chrome/browser/background/background_application_list_model_unittest.cc +++ b/chrome/browser/background/background_application_list_model_unittest.cc @@ -112,8 +112,8 @@ void RemoveBackgroundPermission(ExtensionService* service, service->profile())) { return; } - extensions::PermissionsUpdater(service->profile()).RemovePermissions( - extension, extension->GetActivePermissions()); + extensions::PermissionsUpdater(service->profile()) + .RemovePermissions(extension, extension->GetActivePermissions().get()); } } // namespace diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index baee3e3..9113a3b 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -517,7 +517,7 @@ void BackgroundContentsService::LoadBackgroundContentsFromManifests( extension_service()->extensions(); ExtensionSet::const_iterator iter = extensions->begin(); for (; iter != extensions->end(); ++iter) { - const Extension* extension = *iter; + const Extension* extension = iter->get(); if (extension->is_hosted_app() && BackgroundInfo::HasBackgroundPage(extension)) { LoadBackgroundContents(profile, diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc index de2017c..13c065d 100644 --- a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc +++ b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc @@ -23,8 +23,8 @@ using content::BrowserContext; // static BrowsingDataQuotaHelper* BrowsingDataQuotaHelper::Create(Profile* profile) { return new BrowsingDataQuotaHelperImpl( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), BrowserContext::GetDefaultStoragePartition(profile)->GetQuotaManager()); } diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc index 0c9827d..ce0b511 100644 --- a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc @@ -35,13 +35,14 @@ class BrowsingDataQuotaHelperTest : public testing::Test { virtual void SetUp() OVERRIDE { EXPECT_TRUE(dir_.CreateUniqueTempDir()); quota_manager_ = new quota::QuotaManager( - false, dir_.path(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + false, + dir_.path(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), NULL); helper_ = new BrowsingDataQuotaHelperImpl( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), quota_manager_.get()); } diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc index 3e880f7..1b74264 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.cc +++ b/chrome/browser/browsing_data/browsing_data_remover.cc @@ -454,7 +454,7 @@ void BrowsingDataRemover::RemoveImpl(int remove_mask, if (remove_mask & REMOVE_PASSWORDS) { content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - profile_, Profile::EXPLICIT_ACCESS); + profile_, Profile::EXPLICIT_ACCESS).get(); if (password_store) password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); @@ -689,7 +689,7 @@ void BrowsingDataRemover::ClearLoggedInPredictor() { return; predictors::LoggedInPredictorTable* logged_in_table = - predictor_db->logged_in_table(); + predictor_db->logged_in_table().get(); if (!logged_in_table) return; diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index 314fd0b..24b6f3a 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc @@ -627,8 +627,8 @@ class BrowsingDataRemoverTest : public testing::Test, quota_manager_ = new quota::MockQuotaManager( profile_->IsOffTheRecord(), profile_->GetPath(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), profile_->GetExtensionSpecialStoragePolicy()); } return quota_manager_.get(); diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc index 825b99f..07fd27b 100644 --- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc +++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc @@ -1111,7 +1111,7 @@ TEST_F(CookiesTreeModelTest, ContentSettings) { HostContentSettingsMap* content_settings = profile.GetHostContentSettingsMap(); CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile(&profile); + CookieSettings::Factory::GetForProfile(&profile).get(); MockSettingsObserver observer; CookieTreeRootNode* root = diff --git a/chrome/browser/browsing_data/mock_browsing_data_quota_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_quota_helper.cc index 5d7f014..d026f5e 100644 --- a/chrome/browser/browsing_data/mock_browsing_data_quota_helper.cc +++ b/chrome/browser/browsing_data/mock_browsing_data_quota_helper.cc @@ -10,7 +10,7 @@ using content::BrowserThread; MockBrowsingDataQuotaHelper::MockBrowsingDataQuotaHelper(Profile* profile) : BrowsingDataQuotaHelper(BrowserThread::GetMessageLoopProxyForThread( - BrowserThread::IO)) {} + BrowserThread::IO).get()) {} MockBrowsingDataQuotaHelper::~MockBrowsingDataQuotaHelper() {} diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index d545ba3..017a818 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -1685,7 +1685,7 @@ void ChromeContentBrowserClient::RequestDesktopNotificationPermission( for (ExtensionSet::const_iterator iter = extensions.begin(); iter != extensions.end(); ++iter) { if (notification_service->IsExtensionEnabled((*iter)->id())) { - extension = *iter; + extension = iter->get(); break; } } @@ -1978,7 +1978,7 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs( #else // The user stylesheet watcher may not exist in a testing profile. UserStyleSheetWatcher* user_style_sheet_watcher = - UserStyleSheetWatcherFactory::GetForProfile(profile); + UserStyleSheetWatcherFactory::GetForProfile(profile).get(); if (user_style_sheet_watcher) { web_prefs->user_style_sheet_enabled = true; web_prefs->user_style_sheet_location = diff --git a/chrome/browser/chrome_plugin_browsertest.cc b/chrome/browser/chrome_plugin_browsertest.cc index 70aa4e4..fd6af37 100644 --- a/chrome/browser/chrome_plugin_browsertest.cc +++ b/chrome/browser/chrome_plugin_browsertest.cc @@ -129,7 +129,7 @@ class ChromePluginTest : public InProcessBrowserTest { GetFlashPath(&paths); ASSERT_FALSE(paths.empty()); - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile); + PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile).get(); scoped_refptr<content::MessageLoopRunner> runner = new content::MessageLoopRunner; scoped_refptr<CallbackBarrier> callback_barrier( diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc index d7e2ff2..f3eee77 100644 --- a/chrome/browser/component_updater/component_updater_service.cc +++ b/chrome/browser/component_updater/component_updater_service.cc @@ -706,9 +706,9 @@ void CrxUpdateService::ParseManifest(const std::string& xml) { CrxUpdateService::OnParseUpdateManifestSucceeded(manifest.results()); } } else { - UtilityProcessHost* host = UtilityProcessHost::Create( - new ManifestParserBridge(this), - base::MessageLoopProxy::current()); + UtilityProcessHost* host = + UtilityProcessHost::Create(new ManifestParserBridge(this), + base::MessageLoopProxy::current().get()); host->EnableZygote(); host->Send(new ChromeUtilityMsg_ParseUpdateManifest(xml)); } diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc index 38fbc00..3bb6c42 100644 --- a/chrome/browser/content_settings/content_settings_browsertest.cc +++ b/chrome/browser/content_settings/content_settings_browsertest.cc @@ -157,7 +157,7 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, AllowCookiesUsingExceptions) { ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL("files/setcookie.html"); CookieSettings* settings = - CookieSettings::Factory::GetForProfile(browser()->profile()); + CookieSettings::Factory::GetForProfile(browser()->profile()).get(); settings->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); ui_test_utils::NavigateToURL(browser(), url); @@ -176,10 +176,10 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, BlockCookiesUsingExceptions) { ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL("files/setcookie.html"); CookieSettings* settings = - CookieSettings::Factory::GetForProfile(browser()->profile()); - settings->SetCookieSetting( - ContentSettingsPattern::FromURL(url), - ContentSettingsPattern::Wildcard(), CONTENT_SETTING_BLOCK); + CookieSettings::Factory::GetForProfile(browser()->profile()).get(); + settings->SetCookieSetting(ContentSettingsPattern::FromURL(url), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTING_BLOCK); ui_test_utils::NavigateToURL(browser(), url); ASSERT_TRUE(GetCookies(browser()->profile(), url).empty()); @@ -204,7 +204,7 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, GURL url = URLRequestMockHTTPJob::GetMockUrl( base::FilePath(FILE_PATH_LITERAL("setcookie.html"))); CookieSettings* settings = - CookieSettings::Factory::GetForProfile(browser()->profile()); + CookieSettings::Factory::GetForProfile(browser()->profile()).get(); settings->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); ui_test_utils::NavigateToURL(browser(), url); diff --git a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc index 56dd993..c6527c1 100644 --- a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc +++ b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc @@ -29,8 +29,8 @@ InternalExtensionProvider::InternalExtensionProvider( const ExtensionSet* extensions = extension_service->extensions(); for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - if (extensions::PluginInfo::HasPlugins(*it)) - SetContentSettingForExtension(*it, CONTENT_SETTING_ALLOW); + if (extensions::PluginInfo::HasPlugins(it->get())) + SetContentSettingForExtension(it->get(), CONTENT_SETTING_ALLOW); } Profile* profile = extension_service->profile(); registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED, diff --git a/chrome/browser/content_settings/cookie_settings_unittest.cc b/chrome/browser/content_settings/cookie_settings_unittest.cc index 59d2d55..59f4570 100644 --- a/chrome/browser/content_settings/cookie_settings_unittest.cc +++ b/chrome/browser/content_settings/cookie_settings_unittest.cc @@ -22,17 +22,18 @@ namespace { class CookieSettingsTest : public testing::Test { public: - CookieSettingsTest() : - ui_thread_(BrowserThread::UI, &message_loop_), - cookie_settings_(CookieSettings::Factory::GetForProfile(&profile_)), - kBlockedSite("http://ads.thirdparty.com"), - kAllowedSite("http://good.allays.com"), - kFirstPartySite("http://cool.things.com"), - kBlockedFirstPartySite("http://no.thirdparties.com"), - kExtensionURL("chrome-extension://deadbeef"), - kHttpsSite("https://example.com"), - kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { -} + CookieSettingsTest() + : ui_thread_(BrowserThread::UI, &message_loop_), + cookie_settings_(CookieSettings::Factory::GetForProfile(&profile_) + .get()), + kBlockedSite("http://ads.thirdparty.com"), + kAllowedSite("http://good.allays.com"), + kFirstPartySite("http://cool.things.com"), + kBlockedFirstPartySite("http://no.thirdparties.com"), + kExtensionURL("chrome-extension://deadbeef"), + kHttpsSite("https://example.com"), + kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { + } protected: base::MessageLoop message_loop_; diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc index ed4f55d..78f5a39 100644 --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc @@ -395,7 +395,7 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { HostContentSettingsMap* host_content_settings_map = profile.GetHostContentSettingsMap(); CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile(&profile); + CookieSettings::Factory::GetForProfile(&profile).get(); ContentSettingsPattern pattern = ContentSettingsPattern::FromString("[*.]example.com"); diff --git a/chrome/browser/devtools/devtools_adb_bridge.cc b/chrome/browser/devtools/devtools_adb_bridge.cc index 39b5ecc..fb006f1 100644 --- a/chrome/browser/devtools/devtools_adb_bridge.cc +++ b/chrome/browser/devtools/devtools_adb_bridge.cc @@ -524,9 +524,8 @@ class AdbAttachCommand : public base::RefCounted<AdbAttachCommand> { else delegate = new AgentHostDelegate(id, serial_, bridge->adb_thread_, socket); - DevToolsWindow::OpenExternalFrontend(bridge->profile_, - frontend_url_, - delegate->GetAgentHost()); + DevToolsWindow::OpenExternalFrontend( + bridge->profile_, frontend_url_, delegate->GetAgentHost().get()); } base::WeakPtr<DevToolsAdbBridge> bridge_; diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc index c9107e3..7fe12e8 100644 --- a/chrome/browser/devtools/devtools_sanity_browsertest.cc +++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc @@ -622,14 +622,14 @@ IN_PROC_BROWSER_TEST_F(DevToolsAgentHostTest, TestAgentHostReleased) { ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); RenderViewHost* rvh = browser()->tab_strip_model()->GetWebContentsAt(0)-> GetRenderViewHost(); - DevToolsAgentHost* agent_raw = DevToolsAgentHost::GetOrCreateFor(rvh); + DevToolsAgentHost* agent_raw = DevToolsAgentHost::GetOrCreateFor(rvh).get(); const std::string agent_id = agent_raw->GetId(); ASSERT_EQ(agent_raw, DevToolsAgentHost::GetForId(agent_id)) << "DevToolsAgentHost cannot be found by id"; browser()->tab_strip_model()-> CloseWebContentsAt(0, TabStripModel::CLOSE_NONE); - ASSERT_FALSE(DevToolsAgentHost::GetForId(agent_id)) << - "DevToolsAgentHost is not released when the tab is closed"; + ASSERT_FALSE(DevToolsAgentHost::GetForId(agent_id).get()) + << "DevToolsAgentHost is not released when the tab is closed"; } class RemoteDebuggingTest: public ExtensionApiTest { diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index 98a2e25..78005c0 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc @@ -595,11 +595,13 @@ void DevToolsWindow::AddDevToolsExtensionsToClient() { for (ExtensionSet::const_iterator extension = extensions->begin(); extension != extensions->end(); ++extension) { - if (extensions::ManifestURL::GetDevToolsPage(*extension).is_empty()) + if (extensions::ManifestURL::GetDevToolsPage(extension->get()).is_empty()) continue; DictionaryValue* extension_info = new DictionaryValue(); - extension_info->Set("startPage", new StringValue( - extensions::ManifestURL::GetDevToolsPage(*extension).spec())); + extension_info->Set( + "startPage", + new StringValue( + extensions::ManifestURL::GetDevToolsPage(extension->get()).spec())); extension_info->Set("name", new StringValue((*extension)->name())); bool allow_experimental = (*extension)->HasAPIPermission( extensions::APIPermission::kExperimental); diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc index a11d8af..8a766d7 100644 --- a/chrome/browser/extensions/active_tab_permission_granter.cc +++ b/chrome/browser/extensions/active_tab_permission_granter.cc @@ -107,7 +107,7 @@ void ActiveTabPermissionGranter::ClearActiveExtensionsAndNotify() { for (ExtensionSet::const_iterator it = granted_extensions_.begin(); it != granted_extensions_.end(); ++it) { - PermissionsData::ClearTabSpecificPermissions(*it, tab_id_); + PermissionsData::ClearTabSpecificPermissions(it->get(), tab_id_); extension_ids.push_back((*it)->id()); } diff --git a/chrome/browser/extensions/activity_log/activity_log_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_unittest.cc index 265e866..3c7dadc 100644 --- a/chrome/browser/extensions/activity_log/activity_log_unittest.cc +++ b/chrome/browser/extensions/activity_log/activity_log_unittest.cc @@ -237,7 +237,7 @@ TEST_F(RenderViewActivityLogTest, LogPrerender) { .Set("version", "1.0.0") .Set("manifest_version", 2)) .Build(); - extension_service_->AddExtension(extension); + extension_service_->AddExtension(extension.get()); ActivityLog* activity_log = ActivityLog::GetInstance(profile()); ASSERT_TRUE(activity_log->IsLogEnabled()); GURL url("http://www.google.com"); diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chrome/browser/extensions/api/content_settings/content_settings_api.cc index 3f993a7..1f07c04 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_api.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_api.cc @@ -143,10 +143,10 @@ bool ContentSettingsContentSettingGetFunction::RunImpl() { } map = profile()->GetOffTheRecordProfile()->GetHostContentSettingsMap(); cookie_settings = CookieSettings::Factory::GetForProfile( - profile()->GetOffTheRecordProfile()); + profile()->GetOffTheRecordProfile()).get(); } else { map = profile()->GetHostContentSettingsMap(); - cookie_settings = CookieSettings::Factory::GetForProfile(profile()); + cookie_settings = CookieSettings::Factory::GetForProfile(profile()).get(); } ContentSetting setting; diff --git a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc index 034bb23..b142e36 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc @@ -25,7 +25,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) { HostContentSettingsMap* map = browser()->profile()->GetHostContentSettingsMap(); CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile(browser()->profile()); + CookieSettings::Factory::GetForProfile(browser()->profile()).get(); // Check default content settings by using an unknown URL. GURL example_url("http://www.example.com"); diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc index 25aecca..d111843 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.cc +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc @@ -277,7 +277,7 @@ base::Value* SerializePageInfo(RenderViewHost* rvh) { if (!web_contents) return NULL; - DevToolsAgentHost* agent_host = DevToolsAgentHost::GetOrCreateFor(rvh); + DevToolsAgentHost* agent_host = DevToolsAgentHost::GetOrCreateFor(rvh).get(); base::DictionaryValue* dictionary = new base::DictionaryValue(); diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 1642e47..4b7f549 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -98,7 +98,7 @@ const Extension* GetExtensionByPath(const ExtensionSet* extensions, for (ExtensionSet::const_iterator iter = extensions->begin(); iter != extensions->end(); ++iter) { if ((*iter)->path() == extension_path) - return *iter; + return iter->get(); } return NULL; } @@ -383,7 +383,7 @@ bool DeveloperPrivateGetItemsInfoFunction::RunImpl() { for (ExtensionSet::const_iterator iter = items.begin(); iter != items.end(); ++iter) { - const Extension& item = **iter; + const Extension& item = *iter->get(); // Don't show component extensions because they are only extensions as an // implementation detail of Chrome. diff --git a/chrome/browser/extensions/api/dial/dial_api.cc b/chrome/browser/extensions/api/dial/dial_api.cc index 5bb271c..5f6b779 100644 --- a/chrome/browser/extensions/api/dial/dial_api.cc +++ b/chrome/browser/extensions/api/dial/dial_api.cc @@ -152,7 +152,7 @@ DialDiscoverNowFunction::DialDiscoverNowFunction() bool DialDiscoverNowFunction::Prepare() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(profile()); - dial_ = DialAPIFactory::GetInstance()->GetForProfile(profile()); + dial_ = DialAPIFactory::GetInstance()->GetForProfile(profile()).get(); return true; } diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc index 9db5cb9..8eacf45 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc @@ -701,7 +701,7 @@ class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { network_delegate, blob_storage_controller_->GetBlobDataFromUrl(request->url()), file_system_context_, - base::MessageLoopProxy::current()); + base::MessageLoopProxy::current().get()); } private: diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 1540db0..468a1e99 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc @@ -927,7 +927,7 @@ class RemoveCachedAuthTokenFunctionTest : public ExtensionBrowserTest { bool InvalidateDefaultToken() { scoped_refptr<IdentityRemoveCachedAuthTokenFunction> func( new IdentityRemoveCachedAuthTokenFunction); - func->set_extension(utils::CreateEmptyExtension(kExtensionId)); + func->set_extension(utils::CreateEmptyExtension(kExtensionId).get()); return utils::RunFunction( func.get(), std::string("[{\"token\": \"") + kAccessToken + "\"}]", @@ -1061,8 +1061,8 @@ IN_PROC_BROWSER_TEST_F(LaunchWebAuthFlowFunctionTest, LoadFailed) { std::string args = "[{\"interactive\": true, \"url\": \"" + auth_url.spec() + "\"}]"; - std::string error = utils::RunFunctionAndReturnError(function, args, - browser()); + std::string error = + utils::RunFunctionAndReturnError(function.get(), args, browser()); EXPECT_EQ(std::string(errors::kPageLoadFailure), error); } diff --git a/chrome/browser/extensions/api/management/management_api.cc b/chrome/browser/extensions/api/management/management_api.cc index 4ad1ee6..c855b83 100644 --- a/chrome/browser/extensions/api/management/management_api.cc +++ b/chrome/browser/extensions/api/management/management_api.cc @@ -207,7 +207,7 @@ void AddExtensionInfo(const ExtensionSet& extensions, ExtensionInfoList* extension_list) { for (ExtensionSet::const_iterator iter = extensions.begin(); iter != extensions.end(); ++iter) { - const Extension& extension = **iter; + const Extension& extension = *iter->get(); if (extension.location() == Manifest::COMPONENT) continue; // Skip built-in extensions. @@ -297,10 +297,8 @@ class SafeManifestJSONParser : public UtilityProcessHostClient { void StartWorkOnIOThread() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - UtilityProcessHost* host = - UtilityProcessHost::Create( - this, - base::MessageLoopProxy::current()); + UtilityProcessHost* host = UtilityProcessHost::Create( + this, base::MessageLoopProxy::current().get()); host->EnableZygote(); host->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); } diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc index 6d0f68d..fa1246b 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc @@ -440,7 +440,7 @@ bool MediaGalleriesPrivateGetHandlersFunction::RunImpl() { for (ExtensionSet::const_iterator iter = service->extensions()->begin(); iter != service->extensions()->end(); ++iter) { - const Extension* extension = *iter; + const Extension* extension = iter->get(); if (profile_->IsOffTheRecord() && !service->IsIncognitoEnabled(extension->id())) continue; diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc index 2d53b2c..62a800e 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc @@ -103,8 +103,10 @@ void PageCaptureSaveAsMHTMLFunction::TemporaryFileCreated(bool success) { // Setup a ShareableFileReference so the temporary file gets deleted // once it is no longer used. mhtml_file_ = ShareableFileReference::GetOrCreate( - mhtml_path_, ShareableFileReference::DELETE_ON_FINAL_RELEASE, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); + mhtml_path_, + ShareableFileReference::DELETE_ON_FINAL_RELEASE, + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) + .get()); } BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, diff --git a/chrome/browser/extensions/api/permissions/permissions_api.cc b/chrome/browser/extensions/api/permissions/permissions_api.cc index f227114..c758578 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api.cc +++ b/chrome/browser/extensions/api/permissions/permissions_api.cc @@ -68,7 +68,7 @@ bool PermissionsContainsFunction::RunImpl() { bool PermissionsGetAllFunction::RunImpl() { scoped_ptr<Permissions> permissions = - helpers::PackPermissionSet(GetExtension()->GetActivePermissions()); + helpers::PackPermissionSet(GetExtension()->GetActivePermissions().get()); results_ = GetAll::Results::Create(*permissions); return true; } diff --git a/chrome/browser/extensions/api/preference/preference_helpers.cc b/chrome/browser/extensions/api/preference/preference_helpers.cc index 55297dd..7b18e78 100644 --- a/chrome/browser/extensions/api/preference/preference_helpers.cc +++ b/chrome/browser/extensions/api/preference/preference_helpers.cc @@ -99,8 +99,8 @@ void DispatchEventToExtensions( // TODO(bauerb): Only iterate over registered event listeners. if (router->ExtensionHasEventListener(extension_id, event_name) && (*it)->HasAPIPermission(permission) && - (!incognito || IncognitoInfo::IsSplitMode(*it) || - extension_service->CanCrossIncognito(*it))) { + (!incognito || IncognitoInfo::IsSplitMode(it->get()) || + extension_service->CanCrossIncognito(it->get()))) { // Inject level of control key-value. DictionaryValue* dict; bool rv = args->GetDictionary(0, &dict); @@ -115,7 +115,7 @@ void DispatchEventToExtensions( // incognito pref has not alredy been set Profile* restrict_to_profile = NULL; bool from_incognito = false; - if (IncognitoInfo::IsSplitMode(*it)) { + if (IncognitoInfo::IsSplitMode(it->get())) { if (incognito && extension_service->IsIncognitoEnabled(extension_id)) { restrict_to_profile = profile->GetOffTheRecordProfile(); } else if (!incognito && diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc index 4458538..5106e3b 100644 --- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc +++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc @@ -144,7 +144,7 @@ void ManagedValueStoreCache::ExtensionTracker::LoadSchemas( // and is valid. std::string error; scoped_ptr<policy::PolicySchema> schema = - StorageSchemaManifestHandler::GetSchema(*it, &error); + StorageSchemaManifestHandler::GetSchema(it->get(), &error); CHECK(schema) << error; descriptor->RegisterComponent((*it)->id(), schema.Pass()); } diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc index 80f67aa..df7109f 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc @@ -2251,7 +2251,7 @@ void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host) { profile->GetExtensionService()->extensions(); for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - if (profile->GetExtensionService()->HasUsedWebRequest(*it)) { + if (profile->GetExtensionService()->HasUsedWebRequest(it->get())) { if ((*it)->name().find("Adblock Plus") != std::string::npos) { adblock_plus = true; } else if ((*it)->name().find("AdBlock") != std::string::npos) { diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc index f52752f..0e58bdc 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc @@ -186,7 +186,7 @@ class ExtensionWebRequestTest : public testing::Test { new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); network_delegate_->set_profile(&profile_); network_delegate_->set_cookie_settings( - CookieSettings::Factory::GetForProfile(&profile_)); + CookieSettings::Factory::GetForProfile(&profile_).get()); context_.reset(new net::TestURLRequestContext(true)); context_->set_network_delegate(network_delegate_.get()); context_->Init(); @@ -504,10 +504,14 @@ void ExtensionWebRequestTest::FireURLRequestWithData( ScopedVector<net::UploadElementReader> element_readers; element_readers.push_back(new net::UploadBytesElementReader( &(bytes_1[0]), bytes_1.size())); - element_readers.push_back(new net::UploadFileElementReader( - base::MessageLoopProxy::current(), base::FilePath(), 0, 0, base::Time())); - element_readers.push_back(new net::UploadBytesElementReader( - &(bytes_2[0]), bytes_2.size())); + element_readers.push_back( + new net::UploadFileElementReader(base::MessageLoopProxy::current().get(), + base::FilePath(), + 0, + 0, + base::Time())); + element_readers.push_back( + new net::UploadBytesElementReader(&(bytes_2[0]), bytes_2.size())); request.set_upload(make_scoped_ptr( new net::UploadDataStream(&element_readers, 0))); ipc_sender_.PushTask(base::Bind(&base::DoNothing)); @@ -778,7 +782,7 @@ class ExtensionWebRequestHeaderModificationTest new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); network_delegate_->set_profile(&profile_); network_delegate_->set_cookie_settings( - CookieSettings::Factory::GetForProfile(&profile_)); + CookieSettings::Factory::GetForProfile(&profile_).get()); context_.reset(new net::TestURLRequestContext(true)); host_resolver_.reset(new net::MockHostResolver()); host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); diff --git a/chrome/browser/extensions/app_sync_bundle.cc b/chrome/browser/extensions/app_sync_bundle.cc index 1f5f312..e9a03ba 100644 --- a/chrome/browser/extensions/app_sync_bundle.cc +++ b/chrome/browser/extensions/app_sync_bundle.cc @@ -141,7 +141,7 @@ void AppSyncBundle::GetAppSyncDataListHelper( std::vector<AppSyncData>* sync_data_list) const { for (ExtensionSet::const_iterator it = extensions.begin(); it != extensions.end(); ++it) { - const Extension& extension = **it; + const Extension& extension = *it->get(); // If we have pending app data for this app, then this // version is out of date. We'll sync back the version we got from // sync. diff --git a/chrome/browser/extensions/blacklist.cc b/chrome/browser/extensions/blacklist.cc index e6bea2a..9e1ef1b 100644 --- a/chrome/browser/extensions/blacklist.cc +++ b/chrome/browser/extensions/blacklist.cc @@ -180,10 +180,9 @@ void Blacklist::GetBlacklistedIDs(const std::set<std::string>& ids, pref_blacklisted_ids.insert(*it); } - if (!g_database_manager.Get().get()) { + if (!g_database_manager.Get().get().get()) { base::MessageLoopProxy::current()->PostTask( - FROM_HERE, - base::Bind(callback, pref_blacklisted_ids)); + FROM_HERE, base::Bind(callback, pref_blacklisted_ids)); return; } diff --git a/chrome/browser/extensions/blacklist_unittest.cc b/chrome/browser/extensions/blacklist_unittest.cc index 953f9a1..ad52f41 100644 --- a/chrome/browser/extensions/blacklist_unittest.cc +++ b/chrome/browser/extensions/blacklist_unittest.cc @@ -19,14 +19,12 @@ namespace { class BlacklistTest : public testing::Test { public: BlacklistTest() - : prefs_(message_loop_.message_loop_proxy()), + : prefs_(message_loop_.message_loop_proxy().get()), ui_thread_(content::BrowserThread::UI, &message_loop_), io_thread_(content::BrowserThread::IO, &message_loop_), - safe_browsing_database_manager_( - new FakeSafeBrowsingDatabaseManager()), + safe_browsing_database_manager_(new FakeSafeBrowsingDatabaseManager()), scoped_blacklist_database_manager_(safe_browsing_database_manager_), - blacklist_(prefs_.prefs()) { - } + blacklist_(prefs_.prefs()) {} bool IsBlacklisted(const Extension* extension) { return TestBlacklist(&blacklist_).IsBlacklisted(extension->id()); diff --git a/chrome/browser/extensions/convert_web_app_unittest.cc b/chrome/browser/extensions/convert_web_app_unittest.cc index 7d21876..c6805be 100644 --- a/chrome/browser/extensions/convert_web_app_unittest.cc +++ b/chrome/browser/extensions/convert_web_app_unittest.cc @@ -131,7 +131,7 @@ TEST(ExtensionFromWebApp, Basic) { EXPECT_EQ("1978.12.11.0", extension->version()->GetString()); EXPECT_EQ(UTF16ToUTF8(web_app.title), extension->name()); EXPECT_EQ(UTF16ToUTF8(web_app.description), extension->description()); - EXPECT_EQ(web_app.app_url, AppLaunchInfo::GetFullLaunchURL(extension)); + EXPECT_EQ(web_app.app_url, AppLaunchInfo::GetFullLaunchURL(extension.get())); EXPECT_EQ(2u, extension->GetActivePermissions()->apis().size()); EXPECT_TRUE(extension->HasAPIPermission("geolocation")); EXPECT_TRUE(extension->HasAPIPermission("notifications")); @@ -181,7 +181,7 @@ TEST(ExtensionFromWebApp, Minimal) { EXPECT_EQ("1978.12.11.0", extension->version()->GetString()); EXPECT_EQ(UTF16ToUTF8(web_app.title), extension->name()); EXPECT_EQ("", extension->description()); - EXPECT_EQ(web_app.app_url, AppLaunchInfo::GetFullLaunchURL(extension)); + EXPECT_EQ(web_app.app_url, AppLaunchInfo::GetFullLaunchURL(extension.get())); EXPECT_EQ(0u, IconsInfo::GetIcons(extension.get()).map().size()); EXPECT_EQ(0u, extension->GetActivePermissions()->apis().size()); ASSERT_EQ(1u, extension->web_extent().patterns().size()); diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 3796e5e..424ef62 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -386,7 +386,7 @@ void CrxInstaller::OnUnpackSuccess(const base::FilePath& temp_dir, } if (client_) { - IconsInfo::DecodeIcon(installer_.extension(), + IconsInfo::DecodeIcon(installer_.extension().get(), extension_misc::EXTENSION_ICON_LARGE, ExtensionIconSet::MATCH_BIGGER, &install_icon_); @@ -595,7 +595,7 @@ void CrxInstaller::CompleteInstall() { version_dir, install_source_, extension()->creation_flags() | Extension::REQUIRE_KEY, - &error)); + &error).get()); if (extension()) { ReportSuccessFromFileThread(); diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h index 8a95f54..5de41a9 100644 --- a/chrome/browser/extensions/crx_installer.h +++ b/chrome/browser/extensions/crx_installer.h @@ -194,7 +194,7 @@ class CrxInstaller Profile* profile() { return installer_.profile(); } - const Extension* extension() { return installer_.extension(); } + const Extension* extension() { return installer_.extension().get(); } private: friend class ::ExtensionServiceTest; diff --git a/chrome/browser/extensions/event_router_forwarder_unittest.cc b/chrome/browser/extensions/event_router_forwarder_unittest.cc index 495c419..ee2bf3e 100644 --- a/chrome/browser/extensions/event_router_forwarder_unittest.cc +++ b/chrome/browser/extensions/event_router_forwarder_unittest.cc @@ -167,9 +167,8 @@ TEST_F(EventRouterForwarderTest, BroadcastRendererIO) { kEventName, url)); // Wait for IO thread's message loop to be processed - scoped_refptr<base::ThreadTestHelper> helper( - new base::ThreadTestHelper( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); + scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); ASSERT_TRUE(helper->Run()); base::MessageLoop::current()->RunUntilIdle(); diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index 1155f1d..af45c6c 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -281,7 +281,7 @@ const extensions::Extension* ExtensionApiTest::GetSingleLoadedExtension() { return NULL; } - extension = *it; + extension = it->get(); } if (!extension) { diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 0391286..c2ec75b 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -88,7 +88,7 @@ const Extension* ExtensionBrowserTest::GetExtensionByPath( for (ExtensionSet::const_iterator iter = extensions->begin(); iter != extensions->end(); ++iter) { if ((*iter)->path() == extension_path) { - return *iter; + return iter->get(); } } return NULL; diff --git a/chrome/browser/extensions/extension_context_menu_browsertest.cc b/chrome/browser/extensions/extension_context_menu_browsertest.cc index c1e7a2a..d48f953 100644 --- a/chrome/browser/extensions/extension_context_menu_browsertest.cc +++ b/chrome/browser/extensions/extension_context_menu_browsertest.cc @@ -128,7 +128,7 @@ class ExtensionContextMenuBrowserTest : public ExtensionBrowserTest { ExtensionSet::const_iterator i; for (i = extensions->begin(); i != extensions->end(); ++i) { if ((*i)->name() == name) { - return *i; + return i->get(); } } return NULL; diff --git a/chrome/browser/extensions/extension_disabled_ui_browsertest.cc b/chrome/browser/extensions/extension_disabled_ui_browsertest.cc index ba71d48..8eb5228 100644 --- a/chrome/browser/extensions/extension_disabled_ui_browsertest.cc +++ b/chrome/browser/extensions/extension_disabled_ui_browsertest.cc @@ -87,7 +87,7 @@ class ExtensionDisabledGlobalErrorTest : public ExtensionBrowserTest { if (service_->disabled_extensions()->size() != 1u) return NULL; - return *service_->disabled_extensions()->begin(); + return service_->disabled_extensions()->begin()->get(); } // Helper function to install an extension and upgrade it to a version diff --git a/chrome/browser/extensions/extension_keybinding_registry.cc b/chrome/browser/extensions/extension_keybinding_registry.cc index b2a3c84..e5cf544 100644 --- a/chrome/browser/extensions/extension_keybinding_registry.cc +++ b/chrome/browser/extensions/extension_keybinding_registry.cc @@ -43,8 +43,8 @@ void ExtensionKeybindingRegistry::Init() { const ExtensionSet* extensions = service->extensions(); ExtensionSet::const_iterator iter = extensions->begin(); for (; iter != extensions->end(); ++iter) - if (ExtensionMatchesFilter(*iter)) - AddExtensionKeybinding(*iter, std::string()); + if (ExtensionMatchesFilter(iter->get())) + AddExtensionKeybinding(iter->get(), std::string()); } bool ExtensionKeybindingRegistry::ShouldIgnoreCommand( diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc index 4e9f194..e307ff7 100644 --- a/chrome/browser/extensions/extension_prefs_unittest.cc +++ b/chrome/browser/extensions/extension_prefs_unittest.cc @@ -55,8 +55,7 @@ static void AddPattern(URLPatternSet* extent, const std::string& pattern) { ExtensionPrefsTest::ExtensionPrefsTest() : ui_thread_(BrowserThread::UI, &message_loop_), - prefs_(message_loop_.message_loop_proxy()) { -} + prefs_(message_loop_.message_loop_proxy().get()) {} ExtensionPrefsTest::~ExtensionPrefsTest() { } diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc index 8d67d77..4ef475d 100644 --- a/chrome/browser/extensions/extension_process_manager.cc +++ b/chrome/browser/extensions/extension_process_manager.cc @@ -702,7 +702,7 @@ void ExtensionProcessManager::CreateBackgroundHostsForProfileStartup() { ExtensionService* service = GetProfile()->GetExtensionService(); for (ExtensionSet::const_iterator extension = service->extensions()->begin(); extension != service->extensions()->end(); ++extension) { - CreateBackgroundHostForExtensionLoad(this, *extension); + CreateBackgroundHostForExtensionLoad(this, extension->get()); extensions::RuntimeEventRouter::DispatchOnStartupEvent( GetProfile(), (*extension)->id()); diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc index bd1c210..acffeeb 100644 --- a/chrome/browser/extensions/extension_protocols_unittest.cc +++ b/chrome/browser/extensions/extension_protocols_unittest.cc @@ -237,7 +237,7 @@ TEST_F(ExtensionProtocolTest, ResourceRequestResponseHeaders) { SetProtocolHandler(false); scoped_refptr<Extension> extension = CreateTestResponseHeaderExtension(); - extension_info_map_->AddExtension(extension, base::Time::Now(), false); + extension_info_map_->AddExtension(extension.get(), base::Time::Now(), false); { net::URLRequest request(extension->GetResourceURL("test.dat"), diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 1f7bde7..57b690c 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -792,7 +792,7 @@ bool ExtensionService::UninstallExtension( } GURL launch_web_url_origin( - extensions::AppLaunchInfo::GetLaunchWebURL(extension).GetOrigin()); + extensions::AppLaunchInfo::GetLaunchWebURL(extension.get()).GetOrigin()); bool is_storage_isolated = extensions::AppIsolationInfo::HasIsolatedStorage(extension.get()); @@ -1156,7 +1156,7 @@ void ExtensionService::CheckManagementPolicy() { // Loop through extensions list, unload installed extensions. for (ExtensionSet::const_iterator iter = extensions_.begin(); iter != extensions_.end(); ++iter) { - const Extension* extension = (*iter); + const Extension* extension = (iter->get()); if (!system_->management_policy()->UserMayLoad(extension, NULL)) to_be_removed.push_back(extension->id()); } @@ -1694,7 +1694,7 @@ bool ExtensionService::PopulateExtensionErrorUI( for (ExtensionSet::const_iterator iter = extensions_.begin(); iter != extensions_.end(); ++iter) { - const Extension* e = *iter; + const Extension* e = iter->get(); // Extensions disabled by policy. Note: this no longer includes blacklisted // extensions, though we still show the same UI. @@ -1754,7 +1754,7 @@ void ExtensionService::UpdateExternalExtensionAlert() { const Extension* extension = NULL; for (ExtensionSet::const_iterator iter = disabled_extensions_.begin(); iter != disabled_extensions_.end(); ++iter) { - const Extension* e = *iter; + const Extension* e = iter->get(); if (IsUnacknowledgedExternalExtension(e)) { extension = e; break; @@ -2118,9 +2118,8 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension, // that requires the user's approval. This could occur because the browser // upgraded and recognized additional privileges, or an extension upgrades // to a version that requires additional privileges. - is_privilege_increase = - granted_permissions->HasLessPrivilegesThan( - extension->GetActivePermissions()); + is_privilege_increase = granted_permissions->HasLessPrivilegesThan( + extension->GetActivePermissions().get()); } if (is_extension_upgrade) { @@ -2168,7 +2167,7 @@ void ExtensionService::UpdateActiveExtensionsInCrashReporter() { std::set<std::string> extension_ids; for (ExtensionSet::const_iterator iter = extensions_.begin(); iter != extensions_.end(); ++iter) { - const Extension* extension = *iter; + const Extension* extension = iter->get(); if (!extension->is_theme() && extension->location() != Manifest::COMPONENT) extension_ids.insert(extension->id()); } @@ -2583,7 +2582,7 @@ void ExtensionService::Observe(int type, iter != extensions_.end(); ++iter) { // Renderers don't need to know about themes. if (!(*iter)->is_theme()) - loaded_extensions.push_back(ExtensionMsg_Loaded_Params(*iter)); + loaded_extensions.push_back(ExtensionMsg_Loaded_Params(iter->get())); } process->Send(new ExtensionMsg_Loaded(loaded_extensions)); break; @@ -2790,11 +2789,9 @@ void ExtensionService::GarbageCollectIsolatedStorage() { new base::hash_set<base::FilePath>()); for (ExtensionSet::const_iterator it = extensions_.begin(); it != extensions_.end(); ++it) { - if (extensions::AppIsolationInfo::HasIsolatedStorage(*it)) { - active_paths->insert( - BrowserContext::GetStoragePartitionForSite( - profile_, - GetSiteForExtensionId((*it)->id()))->GetPath()); + if (extensions::AppIsolationInfo::HasIsolatedStorage(it->get())) { + active_paths->insert(BrowserContext::GetStoragePartitionForSite( + profile_, GetSiteForExtensionId((*it)->id()))->GetPath()); } } diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index add357a..477f36a 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -456,8 +456,7 @@ void ExtensionServiceTestBase::InitializeExtensionService( TestingProfile::Builder profile_builder; // Create a PrefService that only contains user defined preference values. PrefServiceMockBuilder builder; - builder.WithUserFilePrefs( - params.pref_file, loop_.message_loop_proxy()); + builder.WithUserFilePrefs(params.pref_file, loop_.message_loop_proxy().get()); scoped_refptr<user_prefs::PrefRegistrySyncable> registry( new user_prefs::PrefRegistrySyncable); scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry.get())); @@ -479,7 +478,7 @@ void ExtensionServiceTestBase::InitializeExtensionService( CommandLine::ForCurrentProcess(), params.extensions_install_dir, params.autoupdate_enabled); - service_->SetFileTaskRunnerForTesting(loop_.message_loop_proxy()); + service_->SetFileTaskRunnerForTesting(loop_.message_loop_proxy().get()); service_->set_extensions_enabled(true); service_->set_show_extensions_prompts(false); service_->set_install_updates_when_idle_for_test(false); @@ -1880,7 +1879,7 @@ TEST_F(ExtensionServiceTest, GrantedAPIAndHostPermissions) { service_->ReloadExtensions(); EXPECT_EQ(1u, service_->disabled_extensions()->size()); - extension = *service_->disabled_extensions()->begin(); + extension = service_->disabled_extensions()->begin()->get(); ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id)); ASSERT_FALSE(service_->IsExtensionEnabled(extension_id)); @@ -1923,7 +1922,7 @@ TEST_F(ExtensionServiceTest, GrantedAPIAndHostPermissions) { service_->ReloadExtensions(); EXPECT_EQ(1u, service_->disabled_extensions()->size()); - extension = *service_->disabled_extensions()->begin(); + extension = service_->disabled_extensions()->begin()->get(); ASSERT_TRUE(prefs->IsExtensionDisabled(extension_id)); ASSERT_FALSE(service_->IsExtensionEnabled(extension_id)); @@ -2198,7 +2197,7 @@ TEST_F(ExtensionServiceTest, LoadLocalizedTheme) { EXPECT_EQ(0u, GetErrors().size()); ASSERT_EQ(1u, loaded_.size()); EXPECT_EQ(1u, service_->extensions()->size()); - const Extension* theme = *service_->extensions()->begin(); + const Extension* theme = service_->extensions()->begin()->get(); EXPECT_EQ("name", theme->name()); EXPECT_EQ("description", theme->description()); @@ -3394,7 +3393,7 @@ TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsLoadFromPrefs) { extensions::InstalledLoader(service_).Load(extension_info, false); EXPECT_EQ(1u, service_->extensions()->size()); - const Extension* extension = *(service_->extensions()->begin()); + const Extension* extension = (service_->extensions()->begin())->get(); EXPECT_TRUE(service_->UninstallExtension(extension->id(), false, NULL)); EXPECT_EQ(0u, service_->extensions()->size()); diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc index 8e7ae0c..3ae4143 100644 --- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc +++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc @@ -316,7 +316,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, HasSessionOnlyOrigins) { TestingProfile profile; CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile(&profile); + CookieSettings::Factory::GetForProfile(&profile).get(); policy_ = new ExtensionSpecialStoragePolicy(cookie_settings); EXPECT_FALSE(policy_->HasSessionOnlyOrigins()); diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc index e45e865..ada7f89 100644 --- a/chrome/browser/extensions/extension_startup_browsertest.cc +++ b/chrome/browser/extensions/extension_startup_browsertest.cc @@ -189,8 +189,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, MAYBE_NoFileAccess) { it != service->extensions()->end(); ++it) { if ((*it)->location() == extensions::Manifest::COMPONENT) continue; - if (service->AllowFileAccess(*it)) - extension_list.push_back(*it); + if (service->AllowFileAccess(it->get())) + extension_list.push_back(it->get()); } for (size_t i = 0; i < extension_list.size(); ++i) { diff --git a/chrome/browser/extensions/extension_sync_bundle.cc b/chrome/browser/extensions/extension_sync_bundle.cc index 0725a6c..9cf2faf 100644 --- a/chrome/browser/extensions/extension_sync_bundle.cc +++ b/chrome/browser/extensions/extension_sync_bundle.cc @@ -144,7 +144,7 @@ void ExtensionSyncBundle::GetExtensionSyncDataListHelper( std::vector<ExtensionSyncData>* sync_data_list) const { for (ExtensionSet::const_iterator it = extensions.begin(); it != extensions.end(); ++it) { - const Extension& extension = **it; + const Extension& extension = *it->get(); // If we have pending extension data for this extension, then this // version is out of date. We'll sync back the version we got from // sync. diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc index a387e05..7805832 100644 --- a/chrome/browser/extensions/extension_toolbar_model.cc +++ b/chrome/browser/extensions/extension_toolbar_model.cc @@ -334,7 +334,7 @@ void ExtensionToolbarModel::Populate( // Create the lists. for (ExtensionSet::const_iterator it = service_->extensions()->begin(); it != service_->extensions()->end(); ++it) { - const Extension* extension = *it; + const Extension* extension = it->get(); if (!extension_action_manager->GetBrowserAction(*extension)) continue; if (!extensions::ExtensionActionAPI::GetBrowserActionVisibility( diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc index 01e21372..2fc4b46 100644 --- a/chrome/browser/extensions/installed_loader.cc +++ b/chrome/browser/extensions/installed_loader.cc @@ -302,9 +302,10 @@ void InstalledLoader::LoadAllExtensions() { (*ex)->manifest_version(), 10); if (type == Manifest::TYPE_EXTENSION) { - BackgroundPageType background_page_type = GetBackgroundPageType(*ex); - UMA_HISTOGRAM_ENUMERATION("Extensions.BackgroundPageType", - background_page_type, 10); + BackgroundPageType background_page_type = + GetBackgroundPageType(ex->get()); + UMA_HISTOGRAM_ENUMERATION( + "Extensions.BackgroundPageType", background_page_type, 10); } // Using an enumeration shows us the total installed ratio across all users. @@ -355,16 +356,16 @@ void InstalledLoader::LoadAllExtensions() { ++item_user_count; ExtensionActionManager* extension_action_manager = ExtensionActionManager::Get(extension_service_->profile()); - if (extension_action_manager->GetPageAction(**ex)) + if (extension_action_manager->GetPageAction(*ex->get())) ++page_action_count; - if (extension_action_manager->GetBrowserAction(**ex)) + if (extension_action_manager->GetBrowserAction(*ex->get())) ++browser_action_count; - if (extensions::ManagedModeInfo::IsContentPack(*ex)) + if (extensions::ManagedModeInfo::IsContentPack(ex->get())) ++content_pack_count; extension_service_->RecordPermissionMessagesHistogram( - *ex, "Extensions.Permissions_Load"); + ex->get(), "Extensions.Permissions_Load"); } const ExtensionSet* disabled_extensions = extension_service_->disabled_extensions(); diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index 56e24653..f9adbd9 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc @@ -43,12 +43,12 @@ namespace extensions { // Base class for tests. class MenuManagerTest : public testing::Test { public: - MenuManagerTest() : ui_thread_(BrowserThread::UI, &message_loop_), - file_thread_(BrowserThread::FILE, &message_loop_), - manager_(&profile_), - prefs_(message_loop_.message_loop_proxy()), - next_id_(1) { - } + MenuManagerTest() + : ui_thread_(BrowserThread::UI, &message_loop_), + file_thread_(BrowserThread::FILE, &message_loop_), + manager_(&profile_), + prefs_(message_loop_.message_loop_proxy().get()), + next_id_(1) {} virtual void TearDown() OVERRIDE { prefs_.pref_service()->CommitPendingWrite(); diff --git a/chrome/browser/extensions/page_action_controller.cc b/chrome/browser/extensions/page_action_controller.cc index b486e82..979518b 100644 --- a/chrome/browser/extensions/page_action_controller.cc +++ b/chrome/browser/extensions/page_action_controller.cc @@ -41,7 +41,8 @@ std::vector<ExtensionAction*> PageActionController::GetCurrentActions() const { for (ExtensionSet::const_iterator i = service->extensions()->begin(); i != service->extensions()->end(); ++i) { - ExtensionAction* action = extension_action_manager->GetPageAction(**i); + ExtensionAction* action = + extension_action_manager->GetPageAction(*i->get()); if (action) current_actions.push_back(action); } diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc index 02c1208..46bb60f 100644 --- a/chrome/browser/extensions/permissions_updater.cc +++ b/chrome/browser/extensions/permissions_updater.cc @@ -83,7 +83,7 @@ void PermissionsUpdater::GrantActivePermissions(const Extension* extension) { return; ExtensionPrefs::Get(profile_)->AddGrantedPermissions( - extension->id(), extension->GetActivePermissions()); + extension->id(), extension->GetActivePermissions().get()); } void PermissionsUpdater::UpdateActivePermissions( diff --git a/chrome/browser/extensions/permissions_updater_unittest.cc b/chrome/browser/extensions/permissions_updater_unittest.cc index b138886..cf55dc7 100644 --- a/chrome/browser/extensions/permissions_updater_unittest.cc +++ b/chrome/browser/extensions/permissions_updater_unittest.cc @@ -127,7 +127,8 @@ TEST_F(PermissionsUpdaterTest, AddAndRemovePermissions) { // Make sure it loaded properly. scoped_refptr<const PermissionSet> permissions = extension->GetActivePermissions(); - ASSERT_EQ(*default_permissions.get(), *extension->GetActivePermissions()); + ASSERT_EQ(*default_permissions.get(), + *extension->GetActivePermissions().get()); // Add a few permissions. APIPermissionSet apis; @@ -154,7 +155,8 @@ TEST_F(PermissionsUpdaterTest, AddAndRemovePermissions) { // Make sure the extension's active permissions reflect the change. scoped_refptr<PermissionSet> active_permissions = PermissionSet::CreateUnion(default_permissions.get(), delta.get()); - ASSERT_EQ(*active_permissions.get(), *extension->GetActivePermissions()); + ASSERT_EQ(*active_permissions.get(), + *extension->GetActivePermissions().get()); // Verify that the new granted and active permissions were also stored // in the extension preferences. In this case, the granted permissions should @@ -188,7 +190,8 @@ TEST_F(PermissionsUpdaterTest, AddAndRemovePermissions) { // Make sure the extension's active permissions reflect the change. active_permissions = PermissionSet::CreateDifference(active_permissions.get(), delta.get()); - ASSERT_EQ(*active_permissions.get(), *extension->GetActivePermissions()); + ASSERT_EQ(*active_permissions.get(), + *extension->GetActivePermissions().get()); // Verify that the extension prefs hold the new active permissions and the // same granted permissions. diff --git a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc index 7a8fbf2..092f8f49 100644 --- a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc +++ b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc @@ -100,12 +100,14 @@ class SandboxedUnpackerTest : public testing::Test { temp_dir_.path().AppendASCII("sandboxed_unpacker_test_Temp"); ASSERT_TRUE(file_util::CreateDirectory(temp_path_)); - sandboxed_unpacker_ = - new SandboxedUnpacker( - crx_path, false, Manifest::INTERNAL, Extension::NO_FLAGS, - extensions_dir_.path(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), - client_); + sandboxed_unpacker_ = new SandboxedUnpacker( + crx_path, + false, + Manifest::INTERNAL, + Extension::NO_FLAGS, + extensions_dir_.path(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), + client_); EXPECT_TRUE(PrepareUnpackerEnv()); } diff --git a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc index 05a00a0..d4f9605 100644 --- a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc +++ b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc @@ -20,9 +20,8 @@ class StandardManagementPolicyProviderTest : public testing::Test { StandardManagementPolicyProviderTest() : ui_thread_(content::BrowserThread::UI, &message_loop_), file_thread_(content::BrowserThread::FILE, &message_loop_), - prefs_(message_loop_.message_loop_proxy()), - provider_(prefs()) { - } + prefs_(message_loop_.message_loop_proxy().get()), + provider_(prefs()) {} protected: ExtensionPrefs* prefs() { diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc index 5c16906..059ccc9 100644 --- a/chrome/browser/extensions/tab_helper.cc +++ b/chrome/browser/extensions/tab_helper.cc @@ -212,7 +212,7 @@ void TabHelper::DidNavigateMainFrame( for (ExtensionSet::const_iterator it = service->extensions()->begin(); it != service->extensions()->end(); ++it) { ExtensionAction* browser_action = - extension_action_manager->GetBrowserAction(**it); + extension_action_manager->GetBrowserAction(*it->get()); if (browser_action) { browser_action->ClearAllValuesForTab(SessionID::IdForTab(web_contents())); content::NotificationService::current()->Notify( diff --git a/chrome/browser/extensions/unpacked_installer.cc b/chrome/browser/extensions/unpacked_installer.cc index 0cc8be4..b394f00 100644 --- a/chrome/browser/extensions/unpacked_installer.cc +++ b/chrome/browser/extensions/unpacked_installer.cc @@ -133,12 +133,9 @@ bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in, std::string error; installer_.set_extension(extension_file_util::LoadExtension( - extension_path_, - Manifest::COMMAND_LINE, - GetFlags(), - &error)); + extension_path_, Manifest::COMMAND_LINE, GetFlags(), &error).get()); - if (!installer_.extension()) { + if (!installer_.extension().get()) { ReportExtensionLoadError(error); return false; } @@ -156,12 +153,11 @@ void UnpackedInstaller::ShowInstallPrompt() { const ExtensionSet* disabled_extensions = service_weak_->disabled_extensions(); - if (service_weak_->show_extensions_prompts() && - prompt_for_plugins_ && - PluginInfo::HasPlugins(installer_.extension()) && + if (service_weak_->show_extensions_prompts() && prompt_for_plugins_ && + PluginInfo::HasPlugins(installer_.extension().get()) && !disabled_extensions->Contains(installer_.extension()->id())) { SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( - installer_.extension(), + installer_.extension().get(), installer_.profile(), base::Bind(&UnpackedInstaller::CallCheckRequirements, this)); prompt->ShowPrompt(); @@ -244,12 +240,9 @@ void UnpackedInstaller::LoadWithFileAccess(int flags) { std::string error; installer_.set_extension(extension_file_util::LoadExtension( - extension_path_, - Manifest::UNPACKED, - flags, - &error)); + extension_path_, Manifest::UNPACKED, flags, &error).get()); - if (!installer_.extension()) { + if (!installer_.extension().get()) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -279,13 +272,12 @@ void UnpackedInstaller::ConfirmInstall() { } PermissionsUpdater perms_updater(service_weak_->profile()); - perms_updater.GrantActivePermissions(installer_.extension()); + perms_updater.GrantActivePermissions(installer_.extension().get()); - service_weak_->OnExtensionInstalled( - installer_.extension(), - syncer::StringOrdinal(), - false /* no requirement errors */, - false /* don't wait for idle */); + service_weak_->OnExtensionInstalled(installer_.extension().get(), + syncer::StringOrdinal(), + false /* no requirement errors */, + false /* don't wait for idle */); } } // namespace extensions diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc index f983b98..1a861ae 100644 --- a/chrome/browser/extensions/updater/extension_updater.cc +++ b/chrome/browser/extensions/updater/extension_updater.cc @@ -302,7 +302,7 @@ void ExtensionUpdater::AddToDownloader( InProgressCheck& request = requests_in_progress_[request_id]; for (ExtensionSet::const_iterator extension_iter = extensions->begin(); extension_iter != extensions->end(); ++extension_iter) { - const Extension& extension = **extension_iter; + const Extension& extension = *extension_iter->get(); if (!Manifest::IsAutoUpdateableLocation(extension.location())) { VLOG(2) << "Extension " << extension.id() << " is not auto updateable"; continue; diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index c22bcdf..f0e4330 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -478,7 +478,7 @@ class ExtensionUpdaterTest : public testing::Test { } virtual void SetUp() OVERRIDE { - prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy())); + prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy().get())); } virtual void TearDown() OVERRIDE { @@ -1308,7 +1308,7 @@ class ExtensionUpdaterTest : public testing::Test { // Set up 2 mock extensions, one with a google.com update url and one // without. - prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy())); + prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy().get())); ServiceForManifestTests service(prefs_.get()); ExtensionList tmp; GURL url1("http://clients2.google.com/service/update2/crx"); diff --git a/chrome/browser/extensions/updater/safe_manifest_parser.cc b/chrome/browser/extensions/updater/safe_manifest_parser.cc index 920a2ff..ae571c7 100644 --- a/chrome/browser/extensions/updater/safe_manifest_parser.cc +++ b/chrome/browser/extensions/updater/safe_manifest_parser.cc @@ -51,7 +51,8 @@ void SafeManifestParser::ParseInSandbox() { !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); if (use_utility_process) { content::UtilityProcessHost* host = content::UtilityProcessHost::Create( - this, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); + this, + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get()); host->EnableZygote(); host->Send(new ChromeUtilityMsg_ParseUpdateManifest(xml_)); } else { diff --git a/chrome/browser/extensions/user_script_listener.cc b/chrome/browser/extensions/user_script_listener.cc index 3fffc6e..229aa40 100644 --- a/chrome/browser/extensions/user_script_listener.cc +++ b/chrome/browser/extensions/user_script_listener.cc @@ -231,8 +231,8 @@ void UserScriptListener::Observe(int type, ExtensionService* service = profile->GetExtensionService(); for (ExtensionSet::const_iterator it = service->extensions()->begin(); it != service->extensions()->end(); ++it) { - if (*it != unloaded_extension) - CollectURLPatterns(*it, &new_patterns); + if (it->get() != unloaded_extension) + CollectURLPatterns(it->get(), &new_patterns); } BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( &UserScriptListener::ReplaceURLPatterns, this, diff --git a/chrome/browser/extensions/webstore_install_helper.cc b/chrome/browser/extensions/webstore_install_helper.cc index 68b6049..67bbbf1 100644 --- a/chrome/browser/extensions/webstore_install_helper.cc +++ b/chrome/browser/extensions/webstore_install_helper.cc @@ -73,9 +73,8 @@ void WebstoreInstallHelper::Start() { void WebstoreInstallHelper::StartWorkOnIOThread() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - utility_host_ = - UtilityProcessHost::Create( - this, base::MessageLoopProxy::current())->AsWeakPtr(); + utility_host_ = UtilityProcessHost::Create( + this, base::MessageLoopProxy::current().get())->AsWeakPtr(); utility_host_->EnableZygote(); utility_host_->StartBatchMode(); diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc index 65facfe..37d691a 100644 --- a/chrome/browser/favicon/favicon_service.cc +++ b/chrome/browser/favicon/favicon_service.cc @@ -40,7 +40,7 @@ CancelableTaskTracker::TaskId RunWithEmptyResultAsync( const FaviconService::FaviconResultsCallback& callback, CancelableTaskTracker* tracker) { return tracker->PostTask( - base::MessageLoopProxy::current(), + base::MessageLoopProxy::current().get(), FROM_HERE, Bind(callback, std::vector<chrome::FaviconBitmapResult>())); } diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc index a2021b5..1e4361a 100644 --- a/chrome/browser/history/history_service.cc +++ b/chrome/browser/history/history_service.cc @@ -629,11 +629,15 @@ CancelableTaskTracker::TaskId HistoryService::GetFavicons( std::vector<chrome::FaviconBitmapResult>* results = new std::vector<chrome::FaviconBitmapResult>(); return tracker->PostTaskAndReply( - thread_->message_loop_proxy(), + thread_->message_loop_proxy().get(), FROM_HERE, base::Bind(&HistoryBackend::GetFavicons, - history_backend_.get(), icon_urls, icon_types, - desired_size_in_dip, desired_scale_factors, results), + history_backend_.get(), + icon_urls, + icon_types, + desired_size_in_dip, + desired_scale_factors, + results), base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); } @@ -650,11 +654,15 @@ CancelableTaskTracker::TaskId HistoryService::GetFaviconsForURL( std::vector<chrome::FaviconBitmapResult>* results = new std::vector<chrome::FaviconBitmapResult>(); return tracker->PostTaskAndReply( - thread_->message_loop_proxy(), + thread_->message_loop_proxy().get(), FROM_HERE, base::Bind(&HistoryBackend::GetFaviconsForURL, - history_backend_.get(), page_url, icon_types, - desired_size_in_dip, desired_scale_factors, results), + history_backend_.get(), + page_url, + icon_types, + desired_size_in_dip, + desired_scale_factors, + results), base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); } @@ -670,11 +678,14 @@ CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( std::vector<chrome::FaviconBitmapResult>* results = new std::vector<chrome::FaviconBitmapResult>(); return tracker->PostTaskAndReply( - thread_->message_loop_proxy(), + thread_->message_loop_proxy().get(), FROM_HERE, base::Bind(&HistoryBackend::GetFaviconForID, - history_backend_.get(), favicon_id, - desired_size_in_dip, desired_scale_factor, results), + history_backend_.get(), + favicon_id, + desired_size_in_dip, + desired_scale_factor, + results), base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); } @@ -692,11 +703,16 @@ CancelableTaskTracker::TaskId HistoryService::UpdateFaviconMappingsAndFetch( std::vector<chrome::FaviconBitmapResult>* results = new std::vector<chrome::FaviconBitmapResult>(); return tracker->PostTaskAndReply( - thread_->message_loop_proxy(), + thread_->message_loop_proxy().get(), FROM_HERE, base::Bind(&HistoryBackend::UpdateFaviconMappingsAndFetch, - history_backend_.get(), page_url, icon_urls, icon_types, - desired_size_in_dip, desired_scale_factors, results), + history_backend_.get(), + page_url, + icon_urls, + icon_types, + desired_size_in_dip, + desired_scale_factors, + results), base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); } @@ -1110,7 +1126,7 @@ void HistoryService::ExpireHistoryBetween( DCHECK(thread_); DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(history_backend_.get()); - tracker->PostTaskAndReply(thread_->message_loop_proxy(), + tracker->PostTaskAndReply(thread_->message_loop_proxy().get(), FROM_HERE, base::Bind(&HistoryBackend::ExpireHistoryBetween, history_backend_, @@ -1128,7 +1144,7 @@ void HistoryService::ExpireHistory( DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(history_backend_.get()); tracker->PostTaskAndReply( - thread_->message_loop_proxy(), + thread_->message_loop_proxy().get(), FROM_HERE, base::Bind(&HistoryBackend::ExpireHistory, history_backend_, expire_list), callback); diff --git a/chrome/browser/history/shortcuts_backend_unittest.cc b/chrome/browser/history/shortcuts_backend_unittest.cc index 60e7bd9..dbc4e83 100644 --- a/chrome/browser/history/shortcuts_backend_unittest.cc +++ b/chrome/browser/history/shortcuts_backend_unittest.cc @@ -74,7 +74,8 @@ void ShortcutsBackendTest::OnShortcutsChanged() { } void ShortcutsBackendTest::InitBackend() { - ShortcutsBackend* backend = ShortcutsBackendFactory::GetForProfile(&profile_); + ShortcutsBackend* backend = + ShortcutsBackendFactory::GetForProfile(&profile_).get(); ASSERT_TRUE(backend); ASSERT_FALSE(load_notified_); ASSERT_FALSE(backend_->initialized()); diff --git a/chrome/browser/history/top_sites_backend.cc b/chrome/browser/history/top_sites_backend.cc index e900cb5..bdf589c 100644 --- a/chrome/browser/history/top_sites_backend.cc +++ b/chrome/browser/history/top_sites_backend.cc @@ -41,10 +41,12 @@ void TopSitesBackend::GetMostVisitedThumbnails( bool* need_history_migration = new bool(false); tracker->PostTaskAndReply( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), FROM_HERE, base::Bind(&TopSitesBackend::GetMostVisitedThumbnailsOnDBThread, - this, thumbnails, need_history_migration), + this, + thumbnails, + need_history_migration), base::Bind(callback, thumbnails, base::Owned(need_history_migration))); } @@ -72,7 +74,7 @@ void TopSitesBackend::ResetDatabase() { void TopSitesBackend::DoEmptyRequest(const base::Closure& reply, CancelableTaskTracker* tracker) { tracker->PostTaskAndReply( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), FROM_HERE, base::Bind(&base::DoNothing), reply); diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc index d946cfe..56ee2e6 100644 --- a/chrome/browser/importer/external_process_importer_client.cc +++ b/chrome/browser/importer/external_process_importer_client.cc @@ -261,10 +261,9 @@ void ExternalProcessImporterClient::NotifyItemFinishedOnIOThread( void ExternalProcessImporterClient::StartProcessOnIOThread( BrowserThread::ID thread_id) { - utility_process_host_ = - UtilityProcessHost::Create( - this, - BrowserThread::GetMessageLoopProxyForThread(thread_id))->AsWeakPtr(); + utility_process_host_ = UtilityProcessHost::Create( + this, BrowserThread::GetMessageLoopProxyForThread(thread_id).get()) + ->AsWeakPtr(); utility_process_host_->DisableSandbox(); #if defined(OS_MACOSX) diff --git a/chrome/browser/importer/firefox_importer_browsertest.cc b/chrome/browser/importer/firefox_importer_browsertest.cc index 0a9290a..4042f35 100644 --- a/chrome/browser/importer/firefox_importer_browsertest.cc +++ b/chrome/browser/importer/firefox_importer_browsertest.cc @@ -276,8 +276,10 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest { host = new ImporterHost; #endif host->SetObserver(observer); - host->StartImportSettings(source_profile, browser()->profile(), - items, make_scoped_refptr(writer)); + host->StartImportSettings(source_profile, + browser()->profile(), + items, + make_scoped_refptr(writer).get()); base::MessageLoop::current()->Run(); } diff --git a/chrome/browser/managed_mode/managed_user_service.cc b/chrome/browser/managed_mode/managed_user_service.cc index 8a06b7e..d407d6e 100644 --- a/chrome/browser/managed_mode/managed_user_service.cc +++ b/chrome/browser/managed_mode/managed_user_service.cc @@ -318,7 +318,7 @@ ScopedVector<ManagedModeSiteList> ManagedUserService::GetActiveSiteLists() { const ExtensionSet* extensions = extension_service->extensions(); for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - const extensions::Extension* extension = *it; + const extensions::Extension* extension = it->get(); if (!extension_service->IsExtensionEnabled(extension->id())) continue; diff --git a/chrome/browser/memory_purger.cc b/chrome/browser/memory_purger.cc index 98ab301..44a04dd 100644 --- a/chrome/browser/memory_purger.cc +++ b/chrome/browser/memory_purger.cc @@ -120,7 +120,7 @@ void MemoryPurger::PurgeBrowser() { WebDataServiceWrapper* wds_wrapper = WebDataServiceFactory::GetForProfileIfExists( profiles[i], Profile::EXPLICIT_ACCESS); - if (wds_wrapper && wds_wrapper->GetWebData()) + if (wds_wrapper && wds_wrapper->GetWebData().get()) wds_wrapper->GetWebData()->UnloadDatabase(); BrowserContext::PurgeMemory(profiles[i]); diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index ff05220..75c68f1 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -192,7 +192,7 @@ PluginPrefs* GetPluginPrefs() { if (profiles.empty()) return NULL; - return PluginPrefs::GetForProfile(profiles.front()); + return PluginPrefs::GetForProfile(profiles.front()).get(); } // Fills |plugin| with the info contained in |plugin_info| and |plugin_prefs|. diff --git a/chrome/browser/nacl_host/nacl_browser.cc b/chrome/browser/nacl_host/nacl_browser.cc index c7be0f4..e6811d3 100644 --- a/chrome/browser/nacl_host/nacl_browser.cc +++ b/chrome/browser/nacl_host/nacl_browser.cc @@ -229,7 +229,8 @@ void NaClBrowser::EnsureIrtAvailable() { // TODO(ncbray) use blocking pool. if (!base::FileUtilProxy::CreateOrOpen( content::BrowserThread::GetMessageLoopProxyForThread( - content::BrowserThread::FILE), + content::BrowserThread::FILE) + .get(), irt_filepath_, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, base::Bind(&NaClBrowser::OnIrtOpened, diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index dccd4d9f..21f8ea7 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -827,7 +827,7 @@ void NaClProcessHost::OnPpapiChannelCreated( new IPC::ChannelProxy(channel_handle, IPC::Channel::MODE_CLIENT, &ipc_plugin_listener_, - base::MessageLoopProxy::current())); + base::MessageLoopProxy::current().get())); // Create the browser ppapi host and enable PPAPI message dispatching to the // browser process. ppapi_host_.reset(content::BrowserPpapiHost::CreateExternalPluginProcess( diff --git a/chrome/browser/nacl_host/pnacl_translation_cache.cc b/chrome/browser/nacl_host/pnacl_translation_cache.cc index e725e0b..f9a2c1a 100644 --- a/chrome/browser/nacl_host/pnacl_translation_cache.cc +++ b/chrome/browser/nacl_host/pnacl_translation_cache.cc @@ -163,7 +163,7 @@ void PNaClTranslationCacheEntry::WriteEntry(int offset, int len) { int rv = entry_->WriteData( 1, offset, - io_buf, + io_buf.get(), len, base::Bind(&PNaClTranslationCacheEntry::DispatchNext, this), false); @@ -176,7 +176,7 @@ void PNaClTranslationCacheEntry::ReadEntry(int offset, int len) { int rv = entry_->ReadData( 1, offset, - read_buf_, + read_buf_.get(), len, base::Bind(&PNaClTranslationCacheEntry::DispatchNext, this)); if (rv != net::ERR_IO_PENDING) @@ -315,7 +315,7 @@ int PNaClTranslationCache::Init(net::CacheType cache_type, cache_dir, cache_size, true /* force_initialize */, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE).get(), NULL, /* dummy net log */ &disk_cache_, base::Bind(&PNaClTranslationCache::OnCreateBackendComplete, AsWeakPtr())); diff --git a/chrome/browser/net/chrome_network_delegate_unittest.cc b/chrome/browser/net/chrome_network_delegate_unittest.cc index 356b62f..b0f2ccb 100644 --- a/chrome/browser/net/chrome_network_delegate_unittest.cc +++ b/chrome/browser/net/chrome_network_delegate_unittest.cc @@ -285,12 +285,12 @@ class ChromeNetworkDelegatePrivacyModeTest : public testing::Test { ChromeNetworkDelegatePrivacyModeTest() : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), forwarder_(new extensions::EventRouterForwarder()), - cookie_settings_(CookieSettings::Factory::GetForProfile(&profile_)), + cookie_settings_(CookieSettings::Factory::GetForProfile(&profile_) + .get()), kBlockedSite("http://ads.thirdparty.com"), kAllowedSite("http://good.allays.com"), kFirstPartySite("http://cool.things.com"), - kBlockedFirstPartySite("http://no.thirdparties.com") { - } + kBlockedFirstPartySite("http://no.thirdparties.com") {} virtual void SetUp() OVERRIDE { ChromeNetworkDelegate::InitializePrefsOnUIThread( diff --git a/chrome/browser/net/proxy_service_factory.cc b/chrome/browser/net/proxy_service_factory.cc index 8943104..9d30b1e 100644 --- a/chrome/browser/net/proxy_service_factory.cc +++ b/chrome/browser/net/proxy_service_factory.cc @@ -47,7 +47,7 @@ ChromeProxyConfigService* ProxyServiceFactory::CreateProxyConfigService() { // that code be moved to chrome/browser instead of being in net, so that it // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354. base_service = net::ProxyService::CreateSystemProxyConfigService( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE)); #endif // !defined(OS_CHROMEOS) diff --git a/chrome/browser/net/transport_security_persister.cc b/chrome/browser/net/transport_security_persister.cc index a0b513d..5c0097b 100644 --- a/chrome/browser/net/transport_security_persister.cc +++ b/chrome/browser/net/transport_security_persister.cc @@ -123,7 +123,8 @@ TransportSecurityPersister::TransportSecurityPersister( bool readonly) : transport_security_state_(state), writer_(profile_path.AppendASCII("TransportSecurity"), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) + .get()), readonly_(readonly), weak_ptr_factory_(this) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/chrome/browser/notifications/message_center_settings_controller.cc b/chrome/browser/notifications/message_center_settings_controller.cc index ea52be7..924c669 100644 --- a/chrome/browser/notifications/message_center_settings_controller.cc +++ b/chrome/browser/notifications/message_center_settings_controller.cc @@ -88,9 +88,9 @@ void MessageCenterSettingsController::GetNotifierList( profile, extension_misc::EXTENSION_ICON_SMALL, this)); for (ExtensionSet::const_iterator iter = extension_set->begin(); iter != extension_set->end(); ++iter) { - const extensions::Extension* extension = *iter; + const extensions::Extension* extension = iter->get(); if (!extension->HasAPIPermission( - extensions::APIPermission::kNotification)) { + extensions::APIPermission::kNotification)) { continue; } diff --git a/chrome/browser/password_manager/password_form_manager.cc b/chrome/browser/password_manager/password_form_manager.cc index 0389792..eac88b2 100644 --- a/chrome/browser/password_manager/password_form_manager.cc +++ b/chrome/browser/password_manager/password_form_manager.cc @@ -127,7 +127,7 @@ void PasswordFormManager::PermanentlyBlacklist() { if (!best_matches_.empty()) { PasswordFormMap::const_iterator iter; PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - profile_, Profile::EXPLICIT_ACCESS); + profile_, Profile::EXPLICIT_ACCESS).get(); if (!password_store) { NOTREACHED(); return; @@ -240,7 +240,7 @@ void PasswordFormManager::FetchMatchingLoginsFromPasswordStore() { DCHECK_EQ(state_, PRE_MATCHING_PHASE); state_ = MATCHING_PHASE; PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - profile_, Profile::EXPLICIT_ACCESS); + profile_, Profile::EXPLICIT_ACCESS).get(); if (!password_store) { NOTREACHED(); return; @@ -398,7 +398,7 @@ void PasswordFormManager::SaveAsNewLogin(bool reset_preferred_login) { DCHECK(!profile_->IsOffTheRecord()); PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - profile_, Profile::IMPLICIT_ACCESS); + profile_, Profile::IMPLICIT_ACCESS).get(); if (!password_store) { NOTREACHED(); return; @@ -456,7 +456,7 @@ void PasswordFormManager::UpdateLogin() { DCHECK(!profile_->IsOffTheRecord()); PasswordStore* password_store = PasswordStoreFactory::GetForProfile( - profile_, Profile::IMPLICIT_ACCESS); + profile_, Profile::IMPLICIT_ACCESS).get(); if (!password_store) { NOTREACHED(); return; diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index df1716b..1cf089c 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -1018,7 +1018,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DisabledPlugins) { const webkit::WebPluginInfo* flash = GetFlashPlugin(plugins); if (!flash) return; - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser()->profile()); + PluginPrefs* plugin_prefs = + PluginPrefs::GetForProfile(browser()->profile()).get(); EXPECT_TRUE(plugin_prefs->IsPluginEnabled(*flash)); EXPECT_TRUE(SetPluginEnabled(plugin_prefs, flash, false)); EXPECT_FALSE(plugin_prefs->IsPluginEnabled(*flash)); @@ -1048,7 +1049,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DisabledPluginsExceptions) { const webkit::WebPluginInfo* flash = GetFlashPlugin(plugins); if (!flash) return; - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser()->profile()); + PluginPrefs* plugin_prefs = + PluginPrefs::GetForProfile(browser()->profile()).get(); EXPECT_TRUE(plugin_prefs->IsPluginEnabled(*flash)); // Disable all plugins. @@ -1086,7 +1088,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, EnabledPlugins) { const webkit::WebPluginInfo* flash = GetFlashPlugin(plugins); if (!flash) return; - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser()->profile()); + PluginPrefs* plugin_prefs = + PluginPrefs::GetForProfile(browser()->profile()).get(); EXPECT_TRUE(plugin_prefs->IsPluginEnabled(*flash)); // The user disables it and then a policy forces it to be enabled. diff --git a/chrome/browser/prefs/chrome_pref_service_unittest.cc b/chrome/browser/prefs/chrome_pref_service_unittest.cc index 3afa38d..226c6cf 100644 --- a/chrome/browser/prefs/chrome_pref_service_unittest.cc +++ b/chrome/browser/prefs/chrome_pref_service_unittest.cc @@ -98,7 +98,8 @@ TEST_F(ChromePrefServiceUserFilePrefsTest, PreserveEmptyValue) { pref_file)); PrefServiceMockBuilder builder; - builder.WithUserFilePrefs(pref_file, message_loop_.message_loop_proxy()); + builder.WithUserFilePrefs(pref_file, + message_loop_.message_loop_proxy().get()); scoped_refptr<user_prefs::PrefRegistrySyncable> registry( new user_prefs::PrefRegistrySyncable); scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry.get())); diff --git a/chrome/browser/prefs/pref_service_syncable.cc b/chrome/browser/prefs/pref_service_syncable.cc index 82c18ba..0a4a455 100644 --- a/chrome/browser/prefs/pref_service_syncable.cc +++ b/chrome/browser/prefs/pref_service_syncable.cc @@ -96,7 +96,7 @@ PrefServiceSyncable* PrefServiceSyncable::CreateIncognitoPrefService( NULL, // command_line_prefs incognito_pref_store, NULL, // recommended - forked_registry->defaults(), + forked_registry->defaults().get(), pref_notifier), incognito_pref_store, forked_registry.get(), diff --git a/chrome/browser/prefs/pref_service_syncable_builder.cc b/chrome/browser/prefs/pref_service_syncable_builder.cc index 5dc83c3..69a090c 100644 --- a/chrome/browser/prefs/pref_service_syncable_builder.cc +++ b/chrome/browser/prefs/pref_service_syncable_builder.cc @@ -48,14 +48,13 @@ PrefServiceSyncable* PrefServiceSyncableBuilder::CreateSyncable( PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); PrefServiceSyncable* pref_service = new PrefServiceSyncable( pref_notifier, - new PrefValueStore( - managed_prefs_.get(), - extension_prefs_.get(), - command_line_prefs_.get(), - user_prefs_.get(), - recommended_prefs_.get(), - pref_registry->defaults(), - pref_notifier), + new PrefValueStore(managed_prefs_.get(), + extension_prefs_.get(), + command_line_prefs_.get(), + user_prefs_.get(), + recommended_prefs_.get(), + pref_registry->defaults().get(), + pref_notifier), user_prefs_.get(), pref_registry, read_error_callback_, diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index fd41ece..9fdeaa5 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -96,7 +96,7 @@ class TestServiceProcess : public ServiceProcess { ServiceProcessState* state); base::MessageLoopProxy* IOMessageLoopProxy() { - return io_thread_->message_loop_proxy(); + return io_thread_->message_loop_proxy().get(); } }; @@ -290,7 +290,7 @@ class CloudPrintProxyPolicyStartupTest : public base::MultiProcessTest, virtual void SetUp(); base::MessageLoopProxy* IOMessageLoopProxy() { - return io_thread_.message_loop_proxy(); + return io_thread_.message_loop_proxy().get(); } base::ProcessHandle Launch(const std::string& name); void WaitForConnect(); @@ -411,10 +411,12 @@ base::ProcessHandle CloudPrintProxyPolicyStartupTest::Launch( void CloudPrintProxyPolicyStartupTest::WaitForConnect() { observer_.Wait(); EXPECT_TRUE(CheckServiceProcessReady()); - EXPECT_TRUE(base::MessageLoopProxy::current()); - ServiceProcessControl::GetInstance()->SetChannel(new IPC::ChannelProxy( - GetServiceProcessChannel(), IPC::Channel::MODE_NAMED_CLIENT, - ServiceProcessControl::GetInstance(), IOMessageLoopProxy())); + EXPECT_TRUE(base::MessageLoopProxy::current().get()); + ServiceProcessControl::GetInstance()->SetChannel( + new IPC::ChannelProxy(GetServiceProcessChannel(), + IPC::Channel::MODE_NAMED_CLIENT, + ServiceProcessControl::GetInstance(), + IOMessageLoopProxy())); } bool CloudPrintProxyPolicyStartupTest::Send(IPC::Message* message) { diff --git a/chrome/browser/printing/print_dialog_gtk.cc b/chrome/browser/printing/print_dialog_gtk.cc index 8960a25..e4a6e5d 100644 --- a/chrome/browser/printing/print_dialog_gtk.cc +++ b/chrome/browser/printing/print_dialog_gtk.cc @@ -407,8 +407,10 @@ void PrintDialogGtk::OnJobCompleted(GtkPrintJob* print_job, GError* error) { if (print_job) g_object_unref(print_job); base::FileUtilProxy::Delete( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), - path_to_pdf_, false, base::FileUtilProxy::StatusCallback()); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), + path_to_pdf_, + false, + base::FileUtilProxy::StatusCallback()); // Printing finished. Matches AddRef() in PrintDocument(); Release(); } diff --git a/chrome/browser/process_singleton_linux_unittest.cc b/chrome/browser/process_singleton_linux_unittest.cc index 30042ae..06ae82a 100644 --- a/chrome/browser/process_singleton_linux_unittest.cc +++ b/chrome/browser/process_singleton_linux_unittest.cc @@ -87,7 +87,7 @@ class ProcessSingletonLinuxTest : public testing::Test { virtual void TearDown() { scoped_refptr<base::ThreadTestHelper> io_helper(new base::ThreadTestHelper( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); ASSERT_TRUE(io_helper->Run()); // Destruct the ProcessSingleton object before the IO thread so that its @@ -98,8 +98,8 @@ class ProcessSingletonLinuxTest : public testing::Test { base::Bind(&ProcessSingletonLinuxTest::DestructProcessSingleton, base::Unretained(this))); - scoped_refptr<base::ThreadTestHelper> helper( - new base::ThreadTestHelper(worker_thread_->message_loop_proxy())); + scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( + worker_thread_->message_loop_proxy().get())); ASSERT_TRUE(helper->Run()); } @@ -119,8 +119,7 @@ class ProcessSingletonLinuxTest : public testing::Test { base::Unretained(this))); scoped_refptr<base::ThreadTestHelper> helper( - new base::ThreadTestHelper( - worker_thread_->message_loop_proxy())); + new base::ThreadTestHelper(worker_thread_->message_loop_proxy().get())); ASSERT_TRUE(helper->Run()); } diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index 1212b87..592ed84 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc @@ -120,7 +120,8 @@ void OffTheRecordProfileImpl::Init() { #if defined(ENABLE_PLUGINS) ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( - PluginPrefs::GetForProfile(this), io_data_.GetResourceContextNoInit()); + PluginPrefs::GetForProfile(this).get(), + io_data_.GetResourceContextNoInit()); #endif BrowserThread::PostTask( @@ -246,7 +247,7 @@ net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { net::URLRequestContextGetter* OffTheRecordProfileImpl::CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers) { - return io_data_.CreateMainRequestContextGetter(protocol_handlers); + return io_data_.CreateMainRequestContextGetter(protocol_handlers).get(); } net::URLRequestContextGetter* @@ -274,12 +275,13 @@ net::URLRequestContextGetter* OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory) { - return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory); + return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory) + .get(); } net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContextForExtensions() { - return io_data_.GetExtensionsRequestContextGetter(); + return io_data_.GetExtensionsRequestContextGetter().get(); } net::URLRequestContextGetter* @@ -288,7 +290,7 @@ net::URLRequestContextGetter* bool in_memory, content::ProtocolHandlerMap* protocol_handlers) { return io_data_.CreateIsolatedAppRequestContextGetter( - partition_path, in_memory, protocol_handlers); + partition_path, in_memory, protocol_handlers).get(); } content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 4ae0c4e..a16a24a 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -536,7 +536,7 @@ void ProfileImpl::DoFinalInit() { #if defined(ENABLE_PLUGINS) ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( - PluginPrefs::GetForProfile(this), + PluginPrefs::GetForProfile(this).get(), io_data_.GetResourceContextNoInit()); #endif @@ -707,7 +707,7 @@ ExtensionSpecialStoragePolicy* if (!extension_special_storage_policy_.get()) { TRACE_EVENT0("browser", "ProfileImpl::GetExtensionSpecialStoragePolicy") extension_special_storage_policy_ = new ExtensionSpecialStoragePolicy( - CookieSettings::Factory::GetForProfile(this)); + CookieSettings::Factory::GetForProfile(this).get()); } return extension_special_storage_policy_.get(); } @@ -816,10 +816,10 @@ base::FilePath ProfileImpl::GetPrefFilePath() { net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers) { - return io_data_.CreateMainRequestContextGetter( - protocol_handlers, - g_browser_process->local_state(), - g_browser_process->io_thread()); + return io_data_ + .CreateMainRequestContextGetter(protocol_handlers, + g_browser_process->local_state(), + g_browser_process->io_thread()).get(); } net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { @@ -836,7 +836,7 @@ net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( net::URLRequestContextGetter* ProfileImpl::GetMediaRequestContext() { // Return the default media context. - return io_data_.GetMediaRequestContextGetter(); + return io_data_.GetMediaRequestContextGetter().get(); } net::URLRequestContextGetter* @@ -853,8 +853,8 @@ net::URLRequestContextGetter* ProfileImpl::GetMediaRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory) { - return io_data_.GetIsolatedMediaRequestContextGetter(partition_path, - in_memory); + return io_data_ + .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get(); } content::ResourceContext* ProfileImpl::GetResourceContext() { @@ -862,7 +862,7 @@ content::ResourceContext* ProfileImpl::GetResourceContext() { } net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { - return io_data_.GetExtensionsRequestContextGetter(); + return io_data_.GetExtensionsRequestContextGetter().get(); } net::URLRequestContextGetter* @@ -871,7 +871,7 @@ ProfileImpl::CreateRequestContextForStoragePartition( bool in_memory, content::ProtocolHandlerMap* protocol_handlers) { return io_data_.CreateIsolatedAppRequestContextGetter( - partition_path, in_memory, protocol_handlers); + partition_path, in_memory, protocol_handlers).get(); } net::SSLConfigService* ProfileImpl::GetSSLConfigService() { @@ -900,7 +900,7 @@ content::GeolocationPermissionContext* content::SpeechRecognitionPreferences* ProfileImpl::GetSpeechRecognitionPreferences() { #if defined(ENABLE_INPUT_SPEECH) - return ChromeSpeechRecognitionPreferences::GetForProfile(this); + return ChromeSpeechRecognitionPreferences::GetForProfile(this).get(); #else return NULL; #endif diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 59a7ab7..c153e25 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc @@ -415,7 +415,8 @@ void ProfileImplIOData::InitializeInternal( ChooseCacheBackendType(), lazy_params_->cache_path, lazy_params_->cache_max_size, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) + .get()); net::HttpNetworkSession::Params network_session_params; PopulateNetworkSessionParams(profile_params, &network_session_params); net::HttpCache* main_cache = new net::HttpCache( @@ -538,7 +539,8 @@ ProfileImplIOData::InitializeAppRequestContext( ChooseCacheBackendType(), cache_path, app_cache_max_size_, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) + .get()); } net::HttpNetworkSession* main_network_session = main_http_factory_->GetSession(); @@ -629,7 +631,8 @@ ProfileImplIOData::InitializeMediaRequestContext( ChooseCacheBackendType(), cache_path, cache_max_size, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) + .get()); net::HttpNetworkSession* main_network_session = main_http_factory_->GetSession(); scoped_ptr<net::HttpTransactionFactory> media_http_cache( diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index 879c373..3254a6cd 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc @@ -445,7 +445,7 @@ class SafeBrowsingServiceTest : public InProcessBrowserTest { // to wait for the SafeBrowsingService to finish loading/stopping. void WaitForIOThread() { scoped_refptr<base::ThreadTestHelper> io_helper(new base::ThreadTestHelper( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); ASSERT_TRUE(io_helper->Run()); } diff --git a/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc b/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc index fe03da2..3d93e67 100644 --- a/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc +++ b/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc @@ -117,8 +117,8 @@ void SandboxedZipAnalyzer::StartProcessOnIOThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); utility_process_host_ = content::UtilityProcessHost::Create( this, - BrowserThread::GetMessageLoopProxyForThread( - BrowserThread::IO))->AsWeakPtr(); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()) + ->AsWeakPtr(); utility_process_host_->Send(new ChromeUtilityMsg_StartupPing); // Wait for the startup notification before sending the main IPC to the // utility process, so that we can dup the file handle. diff --git a/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc b/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc index e2464c34..1d9e76a 100644 --- a/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc +++ b/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc @@ -77,7 +77,7 @@ TEST_F(TwoPhaseUploaderTest, UploadFile) { Delegate delegate; scoped_ptr<TwoPhaseUploader> uploader(TwoPhaseUploader::Create( url_request_context_getter_.get(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), test_server.GetURL("start"), "metadata", GetTestFilePath(), @@ -103,7 +103,7 @@ TEST_F(TwoPhaseUploaderTest, BadPhaseOneResponse) { Delegate delegate; scoped_ptr<TwoPhaseUploader> uploader(TwoPhaseUploader::Create( url_request_context_getter_.get(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), test_server.GetURL("start?p1code=500"), "metadata", GetTestFilePath(), @@ -125,7 +125,7 @@ TEST_F(TwoPhaseUploaderTest, BadPhaseTwoResponse) { Delegate delegate; scoped_ptr<TwoPhaseUploader> uploader(TwoPhaseUploader::Create( url_request_context_getter_.get(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), test_server.GetURL("start?p2code=500"), "metadata", GetTestFilePath(), @@ -151,7 +151,7 @@ TEST_F(TwoPhaseUploaderTest, PhaseOneConnectionClosed) { Delegate delegate; scoped_ptr<TwoPhaseUploader> uploader(TwoPhaseUploader::Create( url_request_context_getter_.get(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), test_server.GetURL("start?p1close=1"), "metadata", GetTestFilePath(), @@ -173,7 +173,7 @@ TEST_F(TwoPhaseUploaderTest, PhaseTwoConnectionClosed) { Delegate delegate; scoped_ptr<TwoPhaseUploader> uploader(TwoPhaseUploader::Create( url_request_context_getter_.get(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), test_server.GetURL("start?p2close=1"), "metadata", GetTestFilePath(), diff --git a/chrome/browser/safe_json_parser.cc b/chrome/browser/safe_json_parser.cc index df0ce00..f3a881f 100644 --- a/chrome/browser/safe_json_parser.cc +++ b/chrome/browser/safe_json_parser.cc @@ -31,8 +31,7 @@ SafeJsonParser::~SafeJsonParser() {} void SafeJsonParser::StartWorkOnIOThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); UtilityProcessHost* host = - UtilityProcessHost::Create( - this, base::MessageLoopProxy::current()); + UtilityProcessHost::Create(this, base::MessageLoopProxy::current().get()); host->EnableZygote(); host->Send(new ChromeUtilityMsg_ParseJSON(unsafe_json_)); } diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc index 2b04211..3c16d4f 100644 --- a/chrome/browser/service/service_process_control.cc +++ b/chrome/browser/service/service_process_control.cc @@ -48,8 +48,10 @@ void ServiceProcessControl::ConnectInternal() { // TODO(hclam): Handle error connecting to channel. const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); SetChannel(new IPC::ChannelProxy( - channel_id, IPC::Channel::MODE_NAMED_CLIENT, this, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); + channel_id, + IPC::Channel::MODE_NAMED_CLIENT, + this, + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); } void ServiceProcessControl::SetChannel(IPC::ChannelProxy* channel) { diff --git a/chrome/browser/signin/chrome_signin_manager_delegate.cc b/chrome/browser/signin/chrome_signin_manager_delegate.cc index 2b63603..71689b9 100644 --- a/chrome/browser/signin/chrome_signin_manager_delegate.cc +++ b/chrome/browser/signin/chrome_signin_manager_delegate.cc @@ -23,7 +23,7 @@ ChromeSigninManagerDelegate::~ChromeSigninManagerDelegate() { // static bool ChromeSigninManagerDelegate::ProfileAllowsSigninCookies(Profile* profile) { CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile(profile); + CookieSettings::Factory::GetForProfile(profile).get(); return SettingsAllowSigninCookies(cookie_settings); } diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc index fa7f944..ae3fa1d 100644 --- a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc +++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc @@ -68,7 +68,7 @@ void GetExtensionVoices(Profile* profile, std::vector<VoiceData>* out_voices) { const ExtensionSet* extensions = service->extensions(); ExtensionSet::const_iterator iter; for (iter = extensions->begin(); iter != extensions->end(); ++iter) { - const Extension* extension = *iter; + const Extension* extension = iter->get(); if (!event_router->ExtensionHasEventListener( extension->id(), tts_engine_events::kOnSpeak) || diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc index ba5a1be..a9d666a 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc @@ -107,7 +107,7 @@ void AutofillDataTypeController::UpdateAutofillCullingSettings( scoped_refptr<autofill::AutofillWebDataService> web_data_service) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); AutocompleteSyncableService* service = - AutocompleteSyncableService::FromWebDataService(web_data_service); + AutocompleteSyncableService::FromWebDataService(web_data_service.get()); if (!service) { DVLOG(1) << "Can't update culling, no AutocompleteSyncableService."; return; diff --git a/chrome/browser/sync/test/integration/passwords_helper.cc b/chrome/browser/sync/test/integration/passwords_helper.cc index 3f489d3..e72133f 100644 --- a/chrome/browser/sync/test/integration/passwords_helper.cc +++ b/chrome/browser/sync/test/integration/passwords_helper.cc @@ -128,12 +128,12 @@ bool SetDecryptionPassphrase(int index, const std::string& passphrase) { PasswordStore* GetPasswordStore(int index) { return PasswordStoreFactory::GetForProfile(test()->GetProfile(index), - Profile::IMPLICIT_ACCESS); + Profile::IMPLICIT_ACCESS).get(); } PasswordStore* GetVerifierPasswordStore() { return PasswordStoreFactory::GetForProfile(test()->verifier(), - Profile::IMPLICIT_ACCESS); + Profile::IMPLICIT_ACCESS).get(); } bool ProfileContainsSamePasswordFormsAsVerifier(int index) { diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_file_sync_service.cc index de5fe45..ddaa0ea 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service.cc @@ -70,10 +70,10 @@ bool CreateTemporaryFile(const base::FilePath& dir_path, file_util::CreateTemporaryFileInDir(dir_path, &temp_file_path); if (!success) return success; - *temp_file = webkit_blob::ScopedFile( - temp_file_path, - webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, - base::MessageLoopProxy::current()); + *temp_file = + webkit_blob::ScopedFile(temp_file_path, + webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, + base::MessageLoopProxy::current().get()); return success; } @@ -362,7 +362,7 @@ void DriveFileSyncService::Initialize( metadata_store_.reset(new DriveMetadataStore( profile_->GetPath().Append(GetSyncFileSystemDir()), content::BrowserThread::GetMessageLoopProxyForThread( - content::BrowserThread::FILE))); + content::BrowserThread::FILE).get())); metadata_store_->Initialize( base::Bind(&DriveFileSyncService::DidInitializeMetadataStore, diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc index 6608383..4dbf84f 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc @@ -282,7 +282,7 @@ class DriveFileSyncServiceMockTest : public testing::Test { scoped_ptr<DriveUploaderInterface>()).Pass(); ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); metadata_store_.reset(new DriveMetadataStore( - base_dir_.path(), base::MessageLoopProxy::current())); + base_dir_.path(), base::MessageLoopProxy::current().get())); bool done = false; metadata_store_->Initialize(base::Bind(&DidInitialize, &done)); diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc index 5522838..d9f92d0 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc @@ -164,8 +164,7 @@ class DriveFileSyncServiceSyncTest : public testing::Test { fake_remote_processor_.reset(new FakeRemoteChangeProcessor); metadata_store_ = new DriveMetadataStore( - base_dir_, - base::MessageLoopProxy::current()); + base_dir_, base::MessageLoopProxy::current().get()); bool done = false; metadata_store_->Initialize(base::Bind(&DidInitialize, &done)); @@ -251,8 +250,7 @@ class DriveFileSyncServiceSyncTest : public testing::Test { message_loop_.RunUntilIdle(); metadata_store_ = new DriveMetadataStore( - base_dir_, - base::MessageLoopProxy::current()); + base_dir_, base::MessageLoopProxy::current().get()); bool done = false; metadata_store_->Initialize(base::Bind(&DidInitialize, &done)); diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc index 118f4aa..96dae8d 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc @@ -54,8 +54,7 @@ class DriveFileSyncServiceTest : public testing::Test { ASSERT_TRUE(scoped_base_dir_.CreateUniqueTempDir()); base_dir_ = scoped_base_dir_.path(); metadata_store_ = new DriveMetadataStore( - base_dir_, - base::MessageLoopProxy::current()); + base_dir_, base::MessageLoopProxy::current().get()); bool done = false; metadata_store_->Initialize(base::Bind(&DidInitialize, &done)); message_loop_.RunUntilIdle(); diff --git a/chrome/browser/sync_file_system/drive_metadata_store.cc b/chrome/browser/sync_file_system/drive_metadata_store.cc index f774f8e..08eaab5 100644 --- a/chrome/browser/sync_file_system/drive_metadata_store.cc +++ b/chrome/browser/sync_file_system/drive_metadata_store.cc @@ -646,11 +646,15 @@ void DriveMetadataStore::DidUpdateOrigin( void DriveMetadataStore::WriteToDB(scoped_ptr<leveldb::WriteBatch> batch, const SyncStatusCallback& callback) { base::PostTaskAndReplyWithResult( - file_task_runner_, FROM_HERE, - base::Bind(&leveldb::DB::Write, base::Unretained(db_.get()), - leveldb::WriteOptions(), base::Owned(batch.release())), + file_task_runner_.get(), + FROM_HERE, + base::Bind(&leveldb::DB::Write, + base::Unretained(db_.get()), + leveldb::WriteOptions(), + base::Owned(batch.release())), base::Bind(&DriveMetadataStore::UpdateDBStatusAndInvokeCallback, - AsWeakPtr(), callback)); + AsWeakPtr(), + callback)); } void DriveMetadataStore::UpdateDBStatus(SyncStatusCode status) { diff --git a/chrome/browser/sync_file_system/local_file_sync_service.cc b/chrome/browser/sync_file_system/local_file_sync_service.cc index c719c96..ff8804c 100644 --- a/chrome/browser/sync_file_system/local_file_sync_service.cc +++ b/chrome/browser/sync_file_system/local_file_sync_service.cc @@ -96,8 +96,9 @@ void LocalFileSyncService::OriginChangeMap::SetOriginEnabled( LocalFileSyncService::LocalFileSyncService(Profile* profile) : profile_(profile), sync_context_(new LocalFileSyncContext( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO) + .get())), local_change_processor_(NULL) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); sync_context_->AddOriginChangeObserver(this); diff --git a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc index 3b11e61..79bac82 100644 --- a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc +++ b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc @@ -25,7 +25,7 @@ void CallbackInvocationAdapter( const thumbnails::ThumbnailingAlgorithm::ConsumerCallback& callback, scoped_refptr<thumbnails::ThumbnailingContext> context, const SkBitmap& source_bitmap) { - callback.Run(*context, source_bitmap); + callback.Run(*context.get(), source_bitmap); } } // namespace @@ -60,15 +60,15 @@ void ContentBasedThumbnailingAlgorithm::ProcessBitmap( const ConsumerCallback& callback, const SkBitmap& bitmap) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK(context); + DCHECK(context.get()); if (bitmap.isNull() || bitmap.empty()) return; gfx::Size target_thumbnail_size = SimpleThumbnailCrop::ComputeTargetSizeAtMaximumScale(target_size_); - SkBitmap source_bitmap = PrepareSourceBitmap( - bitmap, target_thumbnail_size, context); + SkBitmap source_bitmap = + PrepareSourceBitmap(bitmap, target_thumbnail_size, context.get()); // If the source is same (or smaller) than the target, just return it as // the final result. Otherwise, send the shrinking task to the blocking @@ -83,7 +83,7 @@ void ContentBasedThumbnailingAlgorithm::ProcessBitmap( context->clip_result == CLIP_RESULT_NOT_CLIPPED || context->clip_result == CLIP_RESULT_SOURCE_SAME_AS_TARGET); - callback.Run(*context, source_bitmap); + callback.Run(*context.get(), source_bitmap); return; } diff --git a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc index 38b0209..05ef7a8 100644 --- a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc +++ b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc @@ -109,7 +109,7 @@ TEST_F(ContentBasedThumbnailingAlgorithmTest, PrepareSourceBitmap) { source.allocPixels(); source.eraseRGB(50, 150, 200); SkBitmap result = ContentBasedThumbnailingAlgorithm::PrepareSourceBitmap( - source, thumbnail_size, context); + source, thumbnail_size, context.get()); EXPECT_EQ(CLIP_RESULT_SOURCE_SAME_AS_TARGET, context->clip_result); EXPECT_GE(result.width(), copy_size.width()); EXPECT_GE(result.height(), copy_size.height()); @@ -122,7 +122,7 @@ TEST_F(ContentBasedThumbnailingAlgorithmTest, PrepareSourceBitmap) { EXPECT_NEAR(result.height(), source.height(), gfx::scrollbar_size()); result = ContentBasedThumbnailingAlgorithm::PrepareSourceBitmap( - source, thumbnail_size, context); + source, thumbnail_size, context.get()); EXPECT_EQ(CLIP_RESULT_SOURCE_SAME_AS_TARGET, context->clip_result); EXPECT_GE(result.width(), copy_size.width()); EXPECT_GE(result.height(), copy_size.height()); diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop.cc b/chrome/browser/thumbnails/simple_thumbnail_crop.cc index 1a0ce5f..22fa309 100644 --- a/chrome/browser/thumbnails/simple_thumbnail_crop.cc +++ b/chrome/browser/thumbnails/simple_thumbnail_crop.cc @@ -55,7 +55,7 @@ void SimpleThumbnailCrop::ProcessBitmap( context->clip_result == CLIP_RESULT_TALLER_THAN_WIDE || context->clip_result == CLIP_RESULT_NOT_CLIPPED); - callback.Run(*context, thumbnail); + callback.Run(*context.get(), thumbnail); } double SimpleThumbnailCrop::CalculateBoringScore(const SkBitmap& bitmap) { diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 8e5cbfe..6ed98d1 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -262,7 +262,7 @@ class BrowserTest : public ExtensionBrowserTest { for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { if ((*it)->name() == "App Test") - return *it; + return it->get(); } NOTREACHED(); return NULL; diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 809f1a34..d4c70c7 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc @@ -352,7 +352,7 @@ void ContentSettingSingleRadioGroup::SetRadioGroup() { radio_group.radio_items.push_back(radio_block_label); HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile(profile()); + CookieSettings::Factory::GetForProfile(profile()).get(); ContentSetting most_restrictive_setting; SettingSource most_restrictive_setting_source = SETTING_SOURCE_NONE; diff --git a/chrome/browser/ui/gtk/collected_cookies_gtk.cc b/chrome/browser/ui/gtk/collected_cookies_gtk.cc index 568c6ba..ee12e58 100644 --- a/chrome/browser/ui/gtk/collected_cookies_gtk.cc +++ b/chrome/browser/ui/gtk/collected_cookies_gtk.cc @@ -488,7 +488,7 @@ void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, Profile* profile = Profile::FromBrowserContext(web_contents_->GetBrowserContext()); host_node->CreateContentException( - CookieSettings::Factory::GetForProfile(profile), setting); + CookieSettings::Factory::GetForProfile(profile).get(), setting); } } g_list_foreach(paths, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL); diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc index 07a1f50..d6c9638 100644 --- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc +++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc @@ -104,7 +104,7 @@ bool PDFEnableAdobeReaderPromptDelegate::ShouldExpire( void PDFEnableAdobeReaderPromptDelegate::Accept() { content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK")); - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_); + PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); plugin_prefs->EnablePluginGroup( true, ASCIIToUTF16(PluginMetadata::kAdobeReaderGroupName)); plugin_prefs->EnablePluginGroup( diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc index bf5b10d..3f32a3d 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc +++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc @@ -288,11 +288,10 @@ void OneClickSigninHelperTest::AddEmailToOneClickRejectedList( } void OneClickSigninHelperTest::AllowSigninCookies(bool enable) { - CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile( - Profile::FromBrowserContext(browser_context_.get())); - cookie_settings->SetDefaultCookieSetting( - enable ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); + CookieSettings* cookie_settings = CookieSettings::Factory::GetForProfile( + Profile::FromBrowserContext(browser_context_.get())).get(); + cookie_settings->SetDefaultCookieSetting(enable ? CONTENT_SETTING_ALLOW + : CONTENT_SETTING_BLOCK); } void OneClickSigninHelperTest::SetAllowedUsernamePattern( @@ -359,7 +358,7 @@ TestProfileIOData* OneClickSigninHelperIOTest::CreateTestProfileIOData( PrefService* pref_service = profile_->GetPrefs(); PrefService* local_state = g_browser_process->local_state(); CookieSettings* cookie_settings = - CookieSettings::Factory::GetForProfile(profile_); + CookieSettings::Factory::GetForProfile(profile_).get(); TestProfileIOData* io_data = new TestProfileIOData( is_incognito, pref_service, local_state, cookie_settings); io_data->set_reverse_autologin_pending_email("user@gmail.com"); diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc index 32a49ea..465995d 100644 --- a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc +++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc @@ -203,8 +203,7 @@ TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Extensions) { scoped_refptr<extensions::Extension> webstore = CreateExtension("web store", extension_misc::kWebStoreAppId); extensions->extension_prefs()->AddGrantedPermissions( - webstore->id(), - make_scoped_refptr(new extensions::PermissionSet)); + webstore->id(), make_scoped_refptr(new extensions::PermissionSet).get()); extensions->AddExtension(webstore.get()); EXPECT_FALSE(GetCallbackResult( base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get()))); @@ -212,7 +211,7 @@ TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Extensions) { scoped_refptr<extensions::Extension> extension = CreateExtension("foo", std::string()); extensions->extension_prefs()->AddGrantedPermissions( - extension->id(), make_scoped_refptr(new extensions::PermissionSet)); + extension->id(), make_scoped_refptr(new extensions::PermissionSet).get()); extensions->AddExtension(extension.get()); EXPECT_TRUE(GetCallbackResult( base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get()))); diff --git a/chrome/browser/ui/tabs/tab_utils.cc b/chrome/browser/ui/tabs/tab_utils.cc index a45f9ca..9ac23a0 100644 --- a/chrome/browser/ui/tabs/tab_utils.cc +++ b/chrome/browser/ui/tabs/tab_utils.cc @@ -33,7 +33,8 @@ bool ShouldShowRecordingIndicator(content::WebContents* contents) { bool IsPlayingAudio(content::WebContents* contents) { AudioStreamIndicator* audio_indicator = - MediaCaptureDevicesDispatcher::GetInstance()->GetAudioStreamIndicator(); + MediaCaptureDevicesDispatcher::GetInstance()->GetAudioStreamIndicator() + .get(); return audio_indicator->IsPlayingAudio(contents); } diff --git a/chrome/browser/ui/toolbar/action_box_button_controller.cc b/chrome/browser/ui/toolbar/action_box_button_controller.cc index 98bd29c..351d3a6 100644 --- a/chrome/browser/ui/toolbar/action_box_button_controller.cc +++ b/chrome/browser/ui/toolbar/action_box_button_controller.cc @@ -87,7 +87,7 @@ scoped_ptr<ActionBoxMenuModel> ActionBoxButtonController::CreateMenuModel() { const ExtensionSet* extensions = extension_service->extensions(); for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - const extensions::Extension* extension = *it; + const extensions::Extension* extension = it->get(); if (ActionInfo::GetPageLauncherInfo(extension)) { int command_id = GetCommandIdForExtension(*extension); menu_model->AddExtension(*extension, command_id); diff --git a/chrome/browser/ui/webui/extensions/command_handler.cc b/chrome/browser/ui/webui/extensions/command_handler.cc index a3aec9d..b9f1273 100644 --- a/chrome/browser/ui/webui/extensions/command_handler.cc +++ b/chrome/browser/ui/webui/extensions/command_handler.cc @@ -127,7 +127,8 @@ void CommandHandler::GetAllCommands(base::DictionaryValue* commands) { CommandService::ALL, &browser_action, &active)) { - extensions_list->Append(browser_action.ToValue((*extension), active)); + extensions_list->Append( + browser_action.ToValue((extension->get()), active)); } extensions::Command page_action; @@ -135,7 +136,7 @@ void CommandHandler::GetAllCommands(base::DictionaryValue* commands) { CommandService::ALL, &page_action, &active)) { - extensions_list->Append(page_action.ToValue((*extension), active)); + extensions_list->Append(page_action.ToValue((extension->get()), active)); } extensions::Command script_badge; @@ -143,7 +144,7 @@ void CommandHandler::GetAllCommands(base::DictionaryValue* commands) { CommandService::ALL, &script_badge, &active)) { - extensions_list->Append(script_badge.ToValue((*extension), active)); + extensions_list->Append(script_badge.ToValue((extension->get()), active)); } extensions::CommandMap named_commands; @@ -157,7 +158,8 @@ void CommandHandler::GetAllCommands(base::DictionaryValue* commands) { (*extension)->id(), iter->second.command_name()); active = (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN); - extensions_list->Append(iter->second.ToValue((*extension), active)); + extensions_list->Append( + iter->second.ToValue((extension->get()), active)); } } diff --git a/chrome/browser/ui/webui/extensions/extension_icon_source.cc b/chrome/browser/ui/webui/extensions/extension_icon_source.cc index 01554d6..edb0dbb 100644 --- a/chrome/browser/ui/webui/extensions/extension_icon_source.cc +++ b/chrome/browser/ui/webui/extensions/extension_icon_source.cc @@ -129,7 +129,7 @@ void ExtensionIconSource::StartDataRequest( // added to |request_map_|. // Send back the default application icon (not resized or desaturated) as // the default response. - callback.Run(BitmapToMemory(GetDefaultAppImage())); + callback.Run(BitmapToMemory(GetDefaultAppImage()).get()); return; } @@ -174,7 +174,7 @@ void ExtensionIconSource::FinalizeImage(const SkBitmap* image, else bitmap = *image; - request->callback.Run(BitmapToMemory(&bitmap)); + request->callback.Run(BitmapToMemory(&bitmap).get()); ClearData(request_id); } diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index 50d9e04..f0a00e1 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -541,7 +541,7 @@ void ExtensionSettingsHandler::ReloadUnpackedExtensions() { for (ExtensionSet::const_iterator extension = extensions->begin(); extension != extensions->end(); ++extension) { if (Manifest::IsUnpackedLocation((*extension)->location())) - unpacked_extensions.push_back(*extension); + unpacked_extensions.push_back(extension->get()); } for (std::vector<const Extension*>::iterator iter = @@ -567,8 +567,8 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData( extension != extensions->end(); ++extension) { if ((*extension)->ShouldDisplayInExtensionSettings()) { extensions_list->Append(CreateExtensionDetailValue( - *extension, - GetInspectablePagesForExtension(*extension, true), + extension->get(), + GetInspectablePagesForExtension(extension->get(), true), warnings)); } } @@ -577,8 +577,8 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData( extension != extensions->end(); ++extension) { if ((*extension)->ShouldDisplayInExtensionSettings()) { extensions_list->Append(CreateExtensionDetailValue( - *extension, - GetInspectablePagesForExtension(*extension, false), + extension->get(), + GetInspectablePagesForExtension(extension->get(), false), warnings)); } } @@ -588,7 +588,7 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData( extension != extensions->end(); ++extension) { if ((*extension)->ShouldDisplayInExtensionSettings()) { extensions_list->Append(CreateExtensionDetailValue( - *extension, + extension->get(), empty_pages, // Terminated process has no active pages. warnings)); } diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc index 1e939fb..1ef49ac 100644 --- a/chrome/browser/ui/webui/flash_ui.cc +++ b/chrome/browser/ui/webui/flash_ui.cc @@ -272,7 +272,7 @@ void FlashDOMHandler::MaybeRespondToPage() { AddPair(list, ASCIIToUTF16(kFlashPlugin), "Not installed"); } else { PluginPrefs* plugin_prefs = - PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())); + PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get(); bool found_enabled = false; for (size_t i = 0; i < info_array.size(); ++i) { string16 flash_version = info_array[i].version + ASCIIToUTF16(" ") + diff --git a/chrome/browser/ui/webui/nacl_ui.cc b/chrome/browser/ui/webui/nacl_ui.cc index dc0802f..69047f4 100644 --- a/chrome/browser/ui/webui/nacl_ui.cc +++ b/chrome/browser/ui/webui/nacl_ui.cc @@ -287,7 +287,7 @@ void NaClDomHandler::PopulatePageInformation(DictionaryValue* naclInfo) { AddPair(list.get(), nacl_key, ASCIIToUTF16("Disabled")); } else { PluginPrefs* plugin_prefs = - PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())); + PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get(); // Only the 0th plugin is used. nacl_version = info_array[0].version + ASCIIToUTF16(" ") + diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc index 4b67807..80563e3 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc @@ -909,7 +909,7 @@ void NetInternalsMessageHandler::OnGetExtensionInfo(const ListValue* list) { it != extensions->end(); ++it) { DictionaryValue* extension_info = new DictionaryValue(); bool enabled = extension_service->IsExtensionEnabled((*it)->id()); - extensions::GetExtensionBasicInfo(*it, enabled, extension_info); + extensions::GetExtensionBasicInfo(it->get(), enabled, extension_info); extension_list->Append(extension_info); } } diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc index 9bb04c5..6a97f84 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc @@ -259,7 +259,7 @@ CancelableTaskTracker::TaskId FileAccessProvider::StartRead( // Post task to file thread to read file. return tracker->PostTaskAndReply( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), FROM_HERE, base::Bind(&FileAccessProvider::DoRead, this, path, saved_errno, data), base::Bind(callback, base::Owned(saved_errno), base::Owned(data))); @@ -276,12 +276,16 @@ CancelableTaskTracker::TaskId FileAccessProvider::StartWrite( // Post task to file thread to write file. return tracker->PostTaskAndReply( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), FROM_HERE, - base::Bind(&FileAccessProvider::DoWrite, this, - path, data, saved_errno, bytes_written), - base::Bind(callback, - base::Owned(saved_errno), base::Owned(bytes_written))); + base::Bind(&FileAccessProvider::DoWrite, + this, + path, + data, + saved_errno, + bytes_written), + base::Bind( + callback, base::Owned(saved_errno), base::Owned(bytes_written))); } void FileAccessProvider::DoRead(const base::FilePath& path, diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 8f616f1..46b78f7 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -233,7 +233,7 @@ void AddExceptionsGrantedByHostedApps( for (extensions::URLPatternSet::const_iterator pattern = web_extent.begin(); pattern != web_extent.end(); ++pattern) { std::string url_pattern = pattern->GetAsString(); - AddExceptionForHostedApp(url_pattern, **extension, exceptions); + AddExceptionForHostedApp(url_pattern, *extension->get(), exceptions); } // Retrieve the launch URL. GURL launch_url = extensions::AppLaunchInfo::GetLaunchWebURL(*extension); diff --git a/chrome/browser/ui/webui/options/password_manager_handler.cc b/chrome/browser/ui/webui/options/password_manager_handler.cc index af79368..93d4d08 100644 --- a/chrome/browser/ui/webui/options/password_manager_handler.cc +++ b/chrome/browser/ui/webui/options/password_manager_handler.cc @@ -108,7 +108,7 @@ void PasswordManagerHandler::OnLoginsChanged() { PasswordStore* PasswordManagerHandler::GetPasswordStore() { return PasswordStoreFactory::GetForProfile(Profile::FromWebUI(web_ui()), - Profile::EXPLICIT_ACCESS); + Profile::EXPLICIT_ACCESS).get(); } void PasswordManagerHandler::UpdatePasswordLists(const ListValue* args) { diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc index 8b129e82..da7cc9f 100644 --- a/chrome/browser/ui/webui/plugins_ui.cc +++ b/chrome/browser/ui/webui/plugins_ui.cc @@ -238,7 +238,7 @@ void PluginsDOMHandler::HandleEnablePluginMessage(const ListValue* args) { } bool enable = enable_str == "true"; - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile); + PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile).get(); if (is_group_str == "true") { string16 group_name; if (!args->GetString(0, &group_name)) { @@ -331,7 +331,7 @@ void PluginsDOMHandler::LoadPlugins() { void PluginsDOMHandler::PluginsLoaded( const std::vector<webkit::WebPluginInfo>& plugins) { Profile* profile = Profile::FromWebUI(web_ui()); - PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile); + PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile).get(); ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard(); diff --git a/chrome/browser/ui/webui/uber/uber_ui.cc b/chrome/browser/ui/webui/uber/uber_ui.cc index e8d807b..0f6c6c3 100644 --- a/chrome/browser/ui/webui/uber/uber_ui.cc +++ b/chrome/browser/ui/webui/uber/uber_ui.cc @@ -74,7 +74,7 @@ bool HasExtensionType(Profile* profile, const char* extensionType) { for (ExtensionSet::const_iterator iter = extensionSet->begin(); iter != extensionSet->end(); ++iter) { extensions::URLOverrides::URLOverrideMap map = - extensions::URLOverrides::GetChromeURLOverrides(*iter); + extensions::URLOverrides::GetChromeURLOverrides(iter->get()); extensions::URLOverrides::URLOverrideMap::const_iterator result = map.find(std::string(extensionType)); diff --git a/chrome/browser/ui/webui/version_handler.cc b/chrome/browser/ui/webui/version_handler.cc index aef487b..c469d18 100644 --- a/chrome/browser/ui/webui/version_handler.cc +++ b/chrome/browser/ui/webui/version_handler.cc @@ -137,7 +137,7 @@ void VersionHandler::OnGotPlugins( string16 flash_version = l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN); PluginPrefs* plugin_prefs = - PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())); + PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get(); if (plugin_prefs) { for (size_t i = 0; i < info_array.size(); ++i) { if (plugin_prefs->IsPluginEnabled(info_array[i])) { diff --git a/chrome/browser/web_resource/json_asynchronous_unpacker.cc b/chrome/browser/web_resource/json_asynchronous_unpacker.cc index 441c864..8eee8aa 100644 --- a/chrome/browser/web_resource/json_asynchronous_unpacker.cc +++ b/chrome/browser/web_resource/json_asynchronous_unpacker.cc @@ -106,7 +106,7 @@ class JSONAsynchronousUnpackerImpl void StartProcessOnIOThread(BrowserThread::ID thread_id, const std::string& json_data) { UtilityProcessHost* host = UtilityProcessHost::Create( - this, BrowserThread::GetMessageLoopProxyForThread(thread_id)); + this, BrowserThread::GetMessageLoopProxyForThread(thread_id).get()); host->EnableZygote(); // TODO(mrc): get proper file path when we start using web resources // that need to be unpacked. diff --git a/chrome/common/cancelable_task_tracker.cc b/chrome/common/cancelable_task_tracker.cc index 4ab86e3..f27d116 100644 --- a/chrome/common/cancelable_task_tracker.cc +++ b/chrome/common/cancelable_task_tracker.cc @@ -84,7 +84,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::PostTaskAndReply( DCHECK(thread_checker_.CalledOnValidThread()); // We need a MessageLoop to run reply. - DCHECK(base::MessageLoopProxy::current()); + DCHECK(base::MessageLoopProxy::current().get()); // Owned by reply callback below. CancellationFlag* flag = new CancellationFlag(); @@ -110,7 +110,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::PostTaskAndReply( CancelableTaskTracker::TaskId CancelableTaskTracker::NewTrackedTaskId( IsCanceledCallback* is_canceled_cb) { DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(base::MessageLoopProxy::current()); + DCHECK(base::MessageLoopProxy::current().get()); TaskId id = next_id_; next_id_++; // int64 is big enough that we ignore the potential overflow. diff --git a/chrome/common/cancelable_task_tracker_unittest.cc b/chrome/common/cancelable_task_tracker_unittest.cc index 11cff80..e5147e3 100644 --- a/chrome/common/cancelable_task_tracker_unittest.cc +++ b/chrome/common/cancelable_task_tracker_unittest.cc @@ -87,18 +87,15 @@ TEST_F(CancelableTaskTrackerTest, NoCancel) { base::Thread worker_thread("worker thread"); ASSERT_TRUE(worker_thread.Start()); - ignore_result( - task_tracker_.PostTask( - worker_thread.message_loop_proxy(), - FROM_HERE, - MakeExpectedRunClosure(FROM_HERE))); + ignore_result(task_tracker_.PostTask(worker_thread.message_loop_proxy().get(), + FROM_HERE, + MakeExpectedRunClosure(FROM_HERE))); ignore_result( - task_tracker_.PostTaskAndReply( - worker_thread.message_loop_proxy(), - FROM_HERE, - MakeExpectedRunClosure(FROM_HERE), - MakeExpectedRunClosure(FROM_HERE))); + task_tracker_.PostTaskAndReply(worker_thread.message_loop_proxy().get(), + FROM_HERE, + MakeExpectedRunClosure(FROM_HERE), + MakeExpectedRunClosure(FROM_HERE))); CancelableTaskTracker::IsCanceledCallback is_canceled; ignore_result(task_tracker_.NewTrackedTaskId(&is_canceled)); @@ -178,11 +175,10 @@ TEST_F(CancelableTaskTrackerTest, CancelReplyDifferentThread) { ASSERT_TRUE(worker_thread.Start()); CancelableTaskTracker::TaskId task_id = - task_tracker_.PostTaskAndReply( - worker_thread.message_loop_proxy(), - FROM_HERE, - base::Bind(&base::DoNothing), - MakeExpectedNotRunClosure(FROM_HERE)); + task_tracker_.PostTaskAndReply(worker_thread.message_loop_proxy().get(), + FROM_HERE, + base::Bind(&base::DoNothing), + MakeExpectedNotRunClosure(FROM_HERE)); EXPECT_NE(CancelableTaskTracker::kBadTaskId, task_id); task_tracker_.TryCancel(task_id); @@ -385,10 +381,11 @@ void MaybeRunDeadlyTaskTrackerMemberFunction( void PostDoNothingTask(CancelableTaskTracker* task_tracker) { ignore_result( - task_tracker->PostTask( - scoped_refptr<base::TestSimpleTaskRunner>( - new base::TestSimpleTaskRunner()), - FROM_HERE, base::Bind(&base::DoNothing))); + task_tracker->PostTask(scoped_refptr<base::TestSimpleTaskRunner>( + new base::TestSimpleTaskRunner()) + .get(), + FROM_HERE, + base::Bind(&base::DoNothing))); } TEST_F(CancelableTaskTrackerDeathTest, PostFromDifferentThread) { diff --git a/chrome/common/extensions/extension_set.h b/chrome/common/extensions/extension_set.h index 74d13bf..7e09c14 100644 --- a/chrome/common/extensions/extension_set.h +++ b/chrome/common/extensions/extension_set.h @@ -61,6 +61,9 @@ class ExtensionSet { const scoped_refptr<const extensions::Extension> operator*() { return it_->second; } + const scoped_refptr<const extensions::Extension>* operator->() { + return &it_->second; + } bool operator!=(const const_iterator& other) { return it_ != other.it_; } bool operator==(const const_iterator& other) { return it_ == other.it_; } diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc index 456122e..9a63f61 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc @@ -24,21 +24,21 @@ TEST_F(AppLaunchManifestTest, AppLaunchContainer) { extension = LoadAndExpectSuccess("launch_tab.json"); EXPECT_EQ(extension_misc::LAUNCH_TAB, - AppLaunchInfo::GetLaunchContainer(extension)); + AppLaunchInfo::GetLaunchContainer(extension.get())); extension = LoadAndExpectSuccess("launch_panel.json"); EXPECT_EQ(extension_misc::LAUNCH_PANEL, - AppLaunchInfo::GetLaunchContainer(extension)); + AppLaunchInfo::GetLaunchContainer(extension.get())); extension = LoadAndExpectSuccess("launch_default.json"); EXPECT_EQ(extension_misc::LAUNCH_TAB, - AppLaunchInfo::GetLaunchContainer(extension)); + AppLaunchInfo::GetLaunchContainer(extension.get())); extension = LoadAndExpectSuccess("launch_width.json"); - EXPECT_EQ(640, AppLaunchInfo::GetLaunchWidth(extension)); + EXPECT_EQ(640, AppLaunchInfo::GetLaunchWidth(extension.get())); extension = LoadAndExpectSuccess("launch_height.json"); - EXPECT_EQ(480, AppLaunchInfo::GetLaunchHeight(extension)); + EXPECT_EQ(480, AppLaunchInfo::GetLaunchHeight(extension.get())); Testcase testcases[] = { Testcase("launch_window.json", errors::kInvalidLaunchContainer), @@ -110,11 +110,11 @@ TEST_F(AppLaunchManifestTest, AppLaunchURL) { scoped_refptr<Extension> extension; extension = LoadAndExpectSuccess("launch_local_path.json"); EXPECT_EQ(extension->url().spec() + "launch.html", - AppLaunchInfo::GetFullLaunchURL(extension).spec()); + AppLaunchInfo::GetFullLaunchURL(extension.get()).spec()); extension = LoadAndExpectSuccess("launch_local_path_localized.json"); EXPECT_EQ(extension->url().spec() + "launch.html", - AppLaunchInfo::GetFullLaunchURL(extension).spec()); + AppLaunchInfo::GetFullLaunchURL(extension.get()).spec()); LoadAndExpectError("launch_web_url_relative.json", ErrorUtils::FormatErrorMessage( @@ -123,10 +123,10 @@ TEST_F(AppLaunchManifestTest, AppLaunchURL) { extension = LoadAndExpectSuccess("launch_web_url_absolute.json"); EXPECT_EQ(GURL("http://www.google.com/launch.html"), - AppLaunchInfo::GetFullLaunchURL(extension)); + AppLaunchInfo::GetFullLaunchURL(extension.get())); extension = LoadAndExpectSuccess("launch_web_url_localized.json"); EXPECT_EQ(GURL("http://www.google.com/launch.html"), - AppLaunchInfo::GetFullLaunchURL(extension)); + AppLaunchInfo::GetFullLaunchURL(extension.get())); } } // namespace extensions diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc index 684f690..f7fe762 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc @@ -18,9 +18,9 @@ TEST_F(ValidAppManifestTest, ValidApp) { AddPattern(&expected_patterns, "http://www.google.com/foobar/*"); EXPECT_EQ(expected_patterns, extension->web_extent()); EXPECT_EQ(extension_misc::LAUNCH_TAB, - extensions::AppLaunchInfo::GetLaunchContainer(extension)); + extensions::AppLaunchInfo::GetLaunchContainer(extension.get())); EXPECT_EQ(GURL("http://www.google.com/mail/"), - extensions::AppLaunchInfo::GetLaunchWebURL(extension)); + extensions::AppLaunchInfo::GetLaunchWebURL(extension.get())); } TEST_F(ValidAppManifestTest, AllowUnrecognizedPermissions) { diff --git a/chrome/common/extensions/sync_type_unittest.cc b/chrome/common/extensions/sync_type_unittest.cc index c64d8b8..d68d37d 100644 --- a/chrome/common/extensions/sync_type_unittest.cc +++ b/chrome/common/extensions/sync_type_unittest.cc @@ -78,7 +78,7 @@ TEST_F(ExtensionSyncTypeTest, NormalExtensionNoUpdateUrl) { MakeSyncTestExtension(EXTENSION, GURL(), GURL(), Manifest::INTERNAL, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_TRUE(sync_helper::IsSyncableExtension(extension)); + EXPECT_TRUE(sync_helper::IsSyncableExtension(extension.get())); } TEST_F(ExtensionSyncTypeTest, UserScriptValidUpdateUrl) { @@ -86,7 +86,7 @@ TEST_F(ExtensionSyncTypeTest, UserScriptValidUpdateUrl) { MakeSyncTestExtension(USER_SCRIPT, GURL(kValidUpdateUrl1), GURL(), Manifest::INTERNAL, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_TRUE(sync_helper::IsSyncableExtension(extension)); + EXPECT_TRUE(sync_helper::IsSyncableExtension(extension.get())); } TEST_F(ExtensionSyncTypeTest, UserScriptNoUpdateUrl) { @@ -94,7 +94,7 @@ TEST_F(ExtensionSyncTypeTest, UserScriptNoUpdateUrl) { MakeSyncTestExtension(USER_SCRIPT, GURL(), GURL(), Manifest::INTERNAL, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_FALSE(sync_helper::IsSyncableExtension(extension)); + EXPECT_FALSE(sync_helper::IsSyncableExtension(extension.get())); } TEST_F(ExtensionSyncTypeTest, ThemeNoUpdateUrl) { @@ -102,8 +102,8 @@ TEST_F(ExtensionSyncTypeTest, ThemeNoUpdateUrl) { MakeSyncTestExtension(THEME, GURL(), GURL(), Manifest::INTERNAL, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_FALSE(sync_helper::IsSyncableExtension(extension)); - EXPECT_FALSE(sync_helper::IsSyncableApp(extension)); + EXPECT_FALSE(sync_helper::IsSyncableExtension(extension.get())); + EXPECT_FALSE(sync_helper::IsSyncableApp(extension.get())); } TEST_F(ExtensionSyncTypeTest, AppWithLaunchUrl) { @@ -111,7 +111,7 @@ TEST_F(ExtensionSyncTypeTest, AppWithLaunchUrl) { MakeSyncTestExtension(EXTENSION, GURL(), GURL("http://www.google.com"), Manifest::INTERNAL, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_TRUE(sync_helper::IsSyncableApp(extension)); + EXPECT_TRUE(sync_helper::IsSyncableApp(extension.get())); } TEST_F(ExtensionSyncTypeTest, ExtensionExternal) { @@ -119,7 +119,7 @@ TEST_F(ExtensionSyncTypeTest, ExtensionExternal) { MakeSyncTestExtension(EXTENSION, GURL(), GURL(), Manifest::EXTERNAL_PREF, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_FALSE(sync_helper::IsSyncableExtension(extension)); + EXPECT_FALSE(sync_helper::IsSyncableExtension(extension.get())); } TEST_F(ExtensionSyncTypeTest, UserScriptThirdPartyUpdateUrl) { @@ -127,7 +127,7 @@ TEST_F(ExtensionSyncTypeTest, UserScriptThirdPartyUpdateUrl) { MakeSyncTestExtension( USER_SCRIPT, GURL("http://third-party.update_url.com"), GURL(), Manifest::INTERNAL, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_FALSE(sync_helper::IsSyncableExtension(extension)); + EXPECT_FALSE(sync_helper::IsSyncableExtension(extension.get())); } TEST_F(ExtensionSyncTypeTest, OnlyDisplayAppsInLauncher) { @@ -201,13 +201,13 @@ TEST_F(ExtensionSyncTypeTest, OnlySyncInternal) { MakeSyncTestExtension(EXTENSION, GURL(), GURL(), Manifest::INTERNAL, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_TRUE(sync_helper::IsSyncable(extension_internal)); + EXPECT_TRUE(sync_helper::IsSyncable(extension_internal.get())); scoped_refptr<Extension> extension_noninternal( MakeSyncTestExtension(EXTENSION, GURL(), GURL(), Manifest::COMPONENT, 0, base::FilePath(), Extension::NO_FLAGS)); - EXPECT_FALSE(sync_helper::IsSyncable(extension_noninternal)); + EXPECT_FALSE(sync_helper::IsSyncable(extension_noninternal.get())); } TEST_F(ExtensionSyncTypeTest, DontSyncDefault) { @@ -215,7 +215,7 @@ TEST_F(ExtensionSyncTypeTest, DontSyncDefault) { MakeSyncTestExtension(EXTENSION, GURL(), GURL(), Manifest::INTERNAL, 0, base::FilePath(), Extension::WAS_INSTALLED_BY_DEFAULT)); - EXPECT_FALSE(sync_helper::IsSyncable(extension_default)); + EXPECT_FALSE(sync_helper::IsSyncable(extension_default.get())); } // These last 2 tests don't make sense on Chrome OS, where extension plugins @@ -227,7 +227,7 @@ TEST_F(ExtensionSyncTypeTest, ExtensionWithPlugin) { Manifest::INTERNAL, 1, base::FilePath(), Extension::NO_FLAGS)); if (extension.get()) - EXPECT_FALSE(sync_helper::IsSyncableExtension(extension)); + EXPECT_FALSE(sync_helper::IsSyncableExtension(extension.get())); } TEST_F(ExtensionSyncTypeTest, ExtensionWithTwoPlugins) { @@ -236,7 +236,7 @@ TEST_F(ExtensionSyncTypeTest, ExtensionWithTwoPlugins) { Manifest::INTERNAL, 2, base::FilePath(), Extension::NO_FLAGS)); if (extension.get()) - EXPECT_FALSE(sync_helper::IsSyncableExtension(extension)); + EXPECT_FALSE(sync_helper::IsSyncableExtension(extension.get())); } #endif // !defined(OS_CHROMEOS) diff --git a/chrome/common/service_process_util_unittest.cc b/chrome/common/service_process_util_unittest.cc index a7dcf0e..5139d9c 100644 --- a/chrome/common/service_process_util_unittest.cc +++ b/chrome/common/service_process_util_unittest.cc @@ -71,7 +71,7 @@ class ServiceProcessStateTest : public base::MultiProcessTest { virtual ~ServiceProcessStateTest(); virtual void SetUp(); base::MessageLoopProxy* IOMessageLoopProxy() { - return io_thread_.message_loop_proxy(); + return io_thread_.message_loop_proxy().get(); } void LaunchAndWait(const std::string& name); @@ -224,7 +224,7 @@ MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestShutdown) { ServiceProcessState state; EXPECT_TRUE(state.Initialize()); EXPECT_TRUE(state.SignalReady( - io_thread_.message_loop_proxy(), + io_thread_.message_loop_proxy().get(), base::Bind(&ShutdownTask, base::MessageLoop::current()))); message_loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), diff --git a/chrome/nacl/nacl_ipc_adapter_unittest.cc b/chrome/nacl/nacl_ipc_adapter_unittest.cc index 1a2db8b..008e31a 100644 --- a/chrome/nacl/nacl_ipc_adapter_unittest.cc +++ b/chrome/nacl/nacl_ipc_adapter_unittest.cc @@ -31,7 +31,7 @@ class NaClIPCAdapterTest : public testing::Test { // loop instead of using a real IO thread. This should work OK since we do // not need real IPC for the tests. adapter_ = new NaClIPCAdapter(scoped_ptr<IPC::Channel>(sink_), - base::MessageLoopProxy::current()); + base::MessageLoopProxy::current().get()); } virtual void TearDown() OVERRIDE { sink_ = NULL; // This pointer is actually owned by the IPCAdapter. diff --git a/chrome/nacl/nacl_listener.cc b/chrome/nacl/nacl_listener.cc index e771496..8d91a8b 100644 --- a/chrome/nacl/nacl_listener.cc +++ b/chrome/nacl/nacl_listener.cc @@ -206,8 +206,8 @@ void NaClListener::Listen() { std::string channel_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kProcessChannelID); - channel_.reset(new IPC::SyncChannel(this, io_thread_.message_loop_proxy(), - &shutdown_event_)); + channel_.reset(new IPC::SyncChannel( + this, io_thread_.message_loop_proxy().get(), &shutdown_event_)); filter_ = new IPC::SyncMessageFilter(&shutdown_event_); channel_->AddFilter(filter_.get()); channel_->Init(channel_name, IPC::Channel::MODE_CLIENT, true); @@ -238,7 +238,7 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { IPC::ChannelHandle handle = IPC::Channel::GenerateVerifiedChannelID("nacl"); scoped_refptr<NaClIPCAdapter> ipc_adapter( - new NaClIPCAdapter(handle, io_thread_.message_loop_proxy())); + new NaClIPCAdapter(handle, io_thread_.message_loop_proxy().get())); ipc_adapter->ConnectChannel(); // Pass a NaClDesc to the untrusted side. This will hold a ref to the diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc index d3429fd..65ee472 100644 --- a/chrome/renderer/chrome_content_renderer_client_unittest.cc +++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc @@ -126,8 +126,10 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { { WebPluginParams params; EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL(), kNaClUnrestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + GURL(), + GURL(), + kNaClUnrestricted, + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_TRUE(AllowsDevInterfaces(params)); } @@ -136,8 +138,11 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { { WebPluginParams params; EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL(kExtensionUrl), kNaClRestricted, - CreateExtension(kExtensionUnrestricted, kExtensionNotFromWebStore), + GURL(), + GURL(kExtensionUrl), + kNaClRestricted, + CreateExtension(kExtensionUnrestricted, kExtensionNotFromWebStore) + .get(), ¶ms)); EXPECT_TRUE(AllowsDevInterfaces(params)); } @@ -146,8 +151,10 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { { WebPluginParams params; EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL(kExtensionUrl), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionFromWebStore), + GURL(), + GURL(kExtensionUrl), + kNaClRestricted, + CreateExtension(kExtensionRestricted, kExtensionFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); } @@ -155,8 +162,10 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { { WebPluginParams params; EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL(kExtensionUrl), kNaClUnrestricted, - CreateExtension(kExtensionRestricted, kExtensionFromWebStore), + GURL(), + GURL(kExtensionUrl), + kNaClUnrestricted, + CreateExtension(kExtensionRestricted, kExtensionFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); } @@ -166,8 +175,10 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { WebPluginParams params; AddFakeDevAttribute(¶ms); EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL(kExtensionUrl), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionFromWebStore), + GURL(), + GURL(kExtensionUrl), + kNaClRestricted, + CreateExtension(kExtensionRestricted, kExtensionFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); } @@ -177,8 +188,9 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { WebPluginParams params; EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( GURL("chrome-extension://acadkphlmlegjaadjagenfimbpphcgnh"), - GURL(), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionFromWebStore), + GURL(), + kNaClRestricted, + CreateExtension(kExtensionRestricted, kExtensionFromWebStore).get(), ¶ms)); EXPECT_TRUE(AllowsDevInterfaces(params)); } @@ -187,39 +199,45 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { { WebPluginParams params; EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("http://plus.google.com/foo"), + GURL(), + GURL("http://plus.google.com/foo"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com/foo"), + GURL(), + GURL("https://plus.google.com/foo"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com/209089085730"), + GURL(), + GURL("https://plus.google.com/209089085730"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("http://plus.sandbox.google.com/foo"), + GURL(), + GURL("http://plus.sandbox.google.com/foo"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.sandbox.google.com/foo"), + GURL(), + GURL("https://plus.sandbox.google.com/foo"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com/209089085730"), + GURL(), + GURL("https://plus.google.com/209089085730"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); } @@ -227,9 +245,10 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { { WebPluginParams params; EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com/209089085730"), + GURL(), + GURL("https://plus.google.com/209089085730"), kNaClUnrestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); } @@ -239,9 +258,10 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { WebPluginParams params; AddFakeDevAttribute(¶ms); EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com/209089085730"), + GURL(), + GURL("https://plus.google.com/209089085730"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(AllowsDevInterfaces(params)); } @@ -249,40 +269,49 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { { WebPluginParams params; EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com.evil.com/foo1"), + GURL(), + GURL("https://plus.google.com.evil.com/foo1"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionNotFromWebStore).get(), ¶ms)); EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com.evil.com/foo2"), + GURL(), + GURL("https://plus.google.com.evil.com/foo2"), kNaClRestricted, - CreateExtension(kExtensionRestricted, kExtensionFromWebStore), + CreateExtension(kExtensionRestricted, kExtensionFromWebStore).get(), ¶ms)); EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com.evil.com/foo3"), + GURL(), + GURL("https://plus.google.com.evil.com/foo3"), kNaClRestricted, - CreateExtension(kExtensionUnrestricted, kExtensionNotFromWebStore), + CreateExtension(kExtensionUnrestricted, kExtensionNotFromWebStore) + .get(), ¶ms)); EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("https://plus.google.com.evil.com/foo4"), + GURL(), + GURL("https://plus.google.com.evil.com/foo4"), kNaClRestricted, - CreateExtension(kExtensionUnrestricted, kExtensionFromWebStore), + CreateExtension(kExtensionUnrestricted, kExtensionFromWebStore).get(), ¶ms)); } // Non chrome-extension:// URLs belonging to hosted apps are allowed. { WebPluginParams params; EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("http://example.com/test.html"), + GURL(), + GURL("http://example.com/test.html"), kNaClRestricted, - CreateHostedApp(kExtensionRestricted, kExtensionNotFromWebStore, - "http://example.com/"), + CreateHostedApp(kExtensionRestricted, + kExtensionNotFromWebStore, + "http://example.com/").get(), ¶ms)); EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed( - GURL(), GURL("http://example.evil.com/test.html"), + GURL(), + GURL("http://example.evil.com/test.html"), kNaClRestricted, - CreateHostedApp(kExtensionRestricted, kExtensionNotFromWebStore, - "http://example.com/"), + CreateHostedApp(kExtensionRestricted, + kExtensionNotFromWebStore, + "http://example.com/").get(), ¶ms)); } } diff --git a/chrome/service/cloud_print/cloud_print_auth.cc b/chrome/service/cloud_print/cloud_print_auth.cc index bc9f36c..3505a91 100644 --- a/chrome/service/cloud_print/cloud_print_auth.cc +++ b/chrome/service/cloud_print/cloud_print_auth.cc @@ -38,9 +38,10 @@ void CloudPrintAuth::AuthenticateWithLsid( VLOG(1) << "CP_AUTH: Authenticating with LSID"; scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_print( new ServiceGaiaAuthenticator( - kProxyAuthUserAgent, kCloudPrintGaiaServiceId, + kProxyAuthUserAgent, + kCloudPrintGaiaServiceId, GaiaUrls::GetInstance()->client_login_url(), - g_service_process->io_thread()->message_loop_proxy())); + g_service_process->io_thread()->message_loop_proxy().get())); gaia_auth_for_print->set_message_loop(base::MessageLoop::current()); if (gaia_auth_for_print->AuthenticateWithLsid(lsid)) { // Stash away the user email so we can save it in prefs. diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc index 1d66991..9f71b30 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc @@ -213,7 +213,7 @@ class CloudPrintURLFetcherRetryBackoffTest : public CloudPrintURLFetcherTest { void CloudPrintURLFetcherTest::CreateFetcher(const GURL& url, int max_retries) { - fetcher_ = new TestCloudPrintURLFetcher(io_message_loop_proxy()); + fetcher_ = new TestCloudPrintURLFetcher(io_message_loop_proxy().get()); // Registers an entry for test url. It only allows 3 requests to be sent // in 200 milliseconds. diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc index a55b4e3..6484a56 100644 --- a/chrome/service/net/service_url_request_context.cc +++ b/chrome/service/net/service_url_request_context.cc @@ -149,10 +149,9 @@ ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a // MessageLoopProxy* instead of MessageLoop*. DCHECK(g_service_process); - proxy_config_service_.reset( - net::ProxyService::CreateSystemProxyConfigService( - g_service_process->io_thread()->message_loop_proxy(), - g_service_process->file_thread()->message_loop())); + proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( + g_service_process->io_thread()->message_loop_proxy().get(), + g_service_process->file_thread()->message_loop())); } net::URLRequestContext* diff --git a/chrome/service/service_ipc_server.cc b/chrome/service/service_ipc_server.cc index 9935f34..c1f7e21 100644 --- a/chrome/service/service_ipc_server.cc +++ b/chrome/service/service_ipc_server.cc @@ -25,9 +25,12 @@ bool ServiceIPCServer::Init() { void ServiceIPCServer::CreateChannel() { channel_.reset(NULL); // Tear down the existing channel, if any. - channel_.reset(new IPC::SyncChannel(channel_handle_, - IPC::Channel::MODE_NAMED_SERVER, this, - g_service_process->io_thread()->message_loop_proxy(), true, + channel_.reset(new IPC::SyncChannel( + channel_handle_, + IPC::Channel::MODE_NAMED_SERVER, + this, + g_service_process->io_thread()->message_loop_proxy().get(), + true, g_service_process->shutdown_event())); DCHECK(sync_message_filter_.get()); channel_->AddFilter(sync_message_filter_.get()); diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc index f59217e..af04fbd 100644 --- a/chrome/service/service_process.cc +++ b/chrome/service/service_process.cc @@ -163,7 +163,8 @@ bool ServiceProcess::Initialize(base::MessageLoopForUI* message_loop, user_data_dir.Append(chrome::kServiceStateFileName); service_prefs_.reset(new ServiceProcessPrefs( pref_path, - JsonPrefStore::GetTaskRunnerForFile(pref_path, blocking_pool_.get()))); + JsonPrefStore::GetTaskRunnerForFile(pref_path, blocking_pool_.get()) + .get())); service_prefs_->ReadPrefs(); // This switch it required to run connector with test gaia. @@ -203,8 +204,8 @@ bool ServiceProcess::Initialize(base::MessageLoopForUI* message_loop, // After the IPC server has started we signal that the service process is // ready. if (!service_process_state_->SignalReady( - io_thread_->message_loop_proxy(), - base::Bind(&ServiceProcess::Terminate, base::Unretained(this)))) { + io_thread_->message_loop_proxy().get(), + base::Bind(&ServiceProcess::Terminate, base::Unretained(this)))) { return false; } diff --git a/chrome/service/service_process_prefs_unittest.cc b/chrome/service/service_process_prefs_unittest.cc index 5ec3ce6..190da9e 100644 --- a/chrome/service/service_process_prefs_unittest.cc +++ b/chrome/service/service_process_prefs_unittest.cc @@ -18,7 +18,7 @@ class ServiceProcessPrefsTest : public testing::Test { prefs_.reset(new ServiceProcessPrefs( temp_dir_.path().AppendASCII("service_process_prefs.txt"), - message_loop_.message_loop_proxy())); + message_loop_.message_loop_proxy().get())); } virtual void TearDown() OVERRIDE { diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 617c94c..55cd320 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -158,10 +158,9 @@ void AutomationProxy::InitializeChannel(const std::string& channel_id, // The shutdown event could be global on the same lines as the automation // provider, where we use the shutdown event provided by the chrome browser // process. - channel_.reset(new IPC::SyncChannel( - this, // we are the listener - thread_->message_loop_proxy(), - shutdown_event_.get())); + channel_.reset(new IPC::SyncChannel(this, // we are the listener + thread_->message_loop_proxy().get(), + shutdown_event_.get())); channel_->AddFilter(new AutomationMessageFilter(this)); // Create the pipe synchronously so that Chrome doesn't try to connect to an diff --git a/chrome/test/base/testing_pref_service_syncable.cc b/chrome/test/base/testing_pref_service_syncable.cc index 168d56e..3addba3 100644 --- a/chrome/test/base/testing_pref_service_syncable.cc +++ b/chrome/test/base/testing_pref_service_syncable.cc @@ -24,7 +24,7 @@ TestingPrefServiceBase<PrefServiceSyncable, user_prefs::PrefRegistrySyncable>:: NULL, user_prefs, recommended_prefs, - pref_registry->defaults(), + pref_registry->defaults().get(), pref_notifier), user_prefs, pref_registry, diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 466191e..a5bdae8 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -694,7 +694,7 @@ TestingProfile::GetGeolocationPermissionContext() { content::SpeechRecognitionPreferences* TestingProfile::GetSpeechRecognitionPreferences() { #if defined(ENABLE_INPUT_SPEECH) - return ChromeSpeechRecognitionPreferences::GetForProfile(this); + return ChromeSpeechRecognitionPreferences::GetForProfile(this).get(); #else return NULL; #endif diff --git a/chrome/test/chromedriver/chrome/adb_impl.cc b/chrome/test/chromedriver/chrome/adb_impl.cc index d26d393..0386e29 100644 --- a/chrome/test/chromedriver/chrome/adb_impl.cc +++ b/chrome/test/chromedriver/chrome/adb_impl.cc @@ -74,7 +74,7 @@ AdbImpl::AdbImpl( const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy, Log* log) : io_message_loop_proxy_(io_message_loop_proxy), log_(log) { - CHECK(io_message_loop_proxy_); + CHECK(io_message_loop_proxy_.get()); } AdbImpl::~AdbImpl() {} diff --git a/chrome/test/chromedriver/net/sync_websocket_impl_unittest.cc b/chrome/test/chromedriver/net/sync_websocket_impl_unittest.cc index dcaa070..e9daca6 100644 --- a/chrome/test/chromedriver/net/sync_websocket_impl_unittest.cc +++ b/chrome/test/chromedriver/net/sync_websocket_impl_unittest.cc @@ -73,7 +73,7 @@ TEST_F(SyncWebSocketImplTest, SendReceive) { } TEST_F(SyncWebSocketImplTest, SendReceiveTimeout) { - SyncWebSocketImpl sock(context_getter_); + SyncWebSocketImpl sock(context_getter_.get()); ASSERT_TRUE(sock.Connect(server_.web_socket_url())); ASSERT_TRUE(sock.Send("hi")); std::string message; diff --git a/chrome/test/reliability/automated_ui_test_base.cc b/chrome/test/reliability/automated_ui_test_base.cc index 541a0c6..b753329 100644 --- a/chrome/test/reliability/automated_ui_test_base.cc +++ b/chrome/test/reliability/automated_ui_test_base.cc @@ -31,7 +31,7 @@ void AutomatedUITestBase::LogInfoMessage(const std::string& info) { void AutomatedUITestBase::SetUp() { UITest::SetUp(); - set_active_browser(automation()->GetBrowserWindow(0)); + set_active_browser(automation()->GetBrowserWindow(0).get()); } bool AutomatedUITestBase::BackButton() { diff --git a/chrome/test/reliability/automated_ui_tests.cc b/chrome/test/reliability/automated_ui_tests.cc index 7154f31..2e5957b6 100644 --- a/chrome/test/reliability/automated_ui_tests.cc +++ b/chrome/test/reliability/automated_ui_tests.cc @@ -300,7 +300,7 @@ void AutomatedUITest::RunAutomatedUITest() { // Try and start up again. CloseBrowserAndServer(); LaunchBrowserAndServer(); - set_active_browser(automation()->GetBrowserWindow(0)); + set_active_browser(automation()->GetBrowserWindow(0).get()); if (DidCrash(true)) { no_errors = false; // We crashed again, so skip to the end of the this command. diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index f888c1f..0c6185d 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -735,7 +735,7 @@ class PageLoadTest : public UITest { base::FilePath path = user_data_dir().Append(chrome::kLocalStateFilename); PrefServiceMockBuilder builder; builder.WithUserFilePrefs( - path, base::MessageLoop::current()->message_loop_proxy()); + path, base::MessageLoop::current()->message_loop_proxy().get()); return builder.Create(registry); } diff --git a/chrome/utility/profile_import_handler.cc b/chrome/utility/profile_import_handler.cc index c1119ef..79cf0be 100644 --- a/chrome/utility/profile_import_handler.cc +++ b/chrome/utility/profile_import_handler.cc @@ -36,8 +36,9 @@ void ProfileImportHandler::OnImportStart( uint16 items, const base::DictionaryValue& localized_strings) { bridge_ = new ExternalProcessImporterBridge( - localized_strings, content::UtilityThread::Get(), - base::MessageLoopProxy::current()); + localized_strings, + content::UtilityThread::Get(), + base::MessageLoopProxy::current().get()); importer_ = importer::CreateImporterByType(source_profile.importer_type); if (!importer_.get()) { Send(new ProfileImportProcessHostMsg_Import_Finished( |