diff options
Diffstat (limited to 'chrome')
74 files changed, 258 insertions, 258 deletions
diff --git a/chrome/browser/automation/automation_resource_message_filter.cc b/chrome/browser/automation/automation_resource_message_filter.cc index e77d07a..ecbbddc 100644 --- a/chrome/browser/automation/automation_resource_message_filter.cc +++ b/chrome/browser/automation/automation_resource_message_filter.cc @@ -294,8 +294,8 @@ void AutomationResourceMessageFilter::RegisterRenderViewInIOThread( bool pending_view) { RendererId renderer_key(renderer_pid, renderer_id); - scoped_refptr<net::CookieStore> cookie_store = - new AutomationCookieStore(filter, tab_handle); + scoped_refptr<net::CookieStore> cookie_store( + new AutomationCookieStore(filter, tab_handle)); RenderViewMap::iterator automation_details_iter( filtered_render_views_.Get().find(renderer_key)); @@ -350,8 +350,8 @@ bool AutomationResourceMessageFilter::ResumePendingRenderViewInIOThread( DCHECK(automation_details_iter->second.is_pending_render_view); - scoped_refptr<net::CookieStore> cookie_store = - new AutomationCookieStore(filter, tab_handle); + scoped_refptr<net::CookieStore> cookie_store( + new AutomationCookieStore(filter, tab_handle)); AutomationResourceMessageFilter* old_filter = automation_details_iter->second.filter; diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index ec10dfa..241a4b1 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -1549,9 +1549,9 @@ void TestingAutomationProvider::GetBookmarksAsJSON( if (!browser->profile()->GetBookmarkModel()->IsLoaded()) { return; } - scoped_refptr<BookmarkStorage> storage = new BookmarkStorage( + scoped_refptr<BookmarkStorage> storage(new BookmarkStorage( browser->profile(), - browser->profile()->GetBookmarkModel()); + browser->profile()->GetBookmarkModel())); *success = storage->SerializeData(bookmarks_as_json); } } diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc index d66c35f..38899bf 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer.cc @@ -249,7 +249,7 @@ class Writer : public Task { BookmarkFaviconFetcher::URLFaviconMap::iterator itr = favicons_map_->find(url_string); if (itr != favicons_map_->end()) { - scoped_refptr<RefCountedMemory> data = itr->second.get(); + scoped_refptr<RefCountedMemory> data(itr->second.get()); std::string favicon_data; favicon_data.assign(reinterpret_cast<const char*>(data->front()), data->size()); diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 9590b87..bb42ea8 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -305,8 +305,8 @@ std::string AboutNetwork(const std::string& query) { class AboutDnsHandler : public base::RefCountedThreadSafe<AboutDnsHandler> { public: static void Start(AboutSource* source, int request_id) { - scoped_refptr<AboutDnsHandler> handler = - new AboutDnsHandler(source, request_id); + scoped_refptr<AboutDnsHandler> handler( + new AboutDnsHandler(source, request_id)); handler->StartOnUIThread(); } diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 57a9200..f22a6ed 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -214,8 +214,8 @@ void BrowserMainParts::ConnectionFieldTrial() { const base::FieldTrial::Probability kConnectDivisor = 100; const base::FieldTrial::Probability kConnectProbability = 1; // 1% prob. - scoped_refptr<base::FieldTrial> connect_trial = - new base::FieldTrial("ConnCountImpact", kConnectDivisor); + scoped_refptr<base::FieldTrial> connect_trial( + new base::FieldTrial("ConnCountImpact", kConnectDivisor)); const int connect_5 = connect_trial->AppendGroup("conn_count_5", kConnectProbability); @@ -259,8 +259,8 @@ void BrowserMainParts::SocketTimeoutFieldTrial() { // 1% probability for all experimental settings. const base::FieldTrial::Probability kSocketTimeoutProbability = 1; - scoped_refptr<base::FieldTrial> socket_timeout_trial = - new base::FieldTrial("IdleSktToImpact", kIdleSocketTimeoutDivisor); + scoped_refptr<base::FieldTrial> socket_timeout_trial( + new base::FieldTrial("IdleSktToImpact", kIdleSocketTimeoutDivisor)); const int socket_timeout_5 = socket_timeout_trial->AppendGroup("idle_timeout_5", @@ -295,8 +295,8 @@ void BrowserMainParts::ProxyConnectionsFieldTrial() { // 25% probability const base::FieldTrial::Probability kProxyConnectionProbability = 1; - scoped_refptr<base::FieldTrial> proxy_connection_trial = - new base::FieldTrial("ProxyConnectionImpact", kProxyConnectionsDivisor); + scoped_refptr<base::FieldTrial> proxy_connection_trial( + new base::FieldTrial("ProxyConnectionImpact", kProxyConnectionsDivisor)); // The number of max sockets per group cannot be greater than the max number // of sockets per proxy server. We tried using 8, and it can easily @@ -346,8 +346,8 @@ void BrowserMainParts::SpdyFieldTrial() { const base::FieldTrial::Probability kSpdyDivisor = 100; // 10% to preclude SPDY. base::FieldTrial::Probability npnhttp_probability = 10; - scoped_refptr<base::FieldTrial> trial = - new base::FieldTrial("SpdyImpact", kSpdyDivisor); + scoped_refptr<base::FieldTrial> trial( + new base::FieldTrial("SpdyImpact", kSpdyDivisor)); // npn with only http support, no spdy. int npn_http_grp = trial->AppendGroup("npn_with_http", npnhttp_probability); // npn with spdy support. @@ -384,8 +384,8 @@ void BrowserMainParts::PrefetchFieldTrial() { } else { const base::FieldTrial::Probability kPrefetchDivisor = 1000; const base::FieldTrial::Probability no_prefetch_probability = 500; - scoped_refptr<base::FieldTrial> trial = - new base::FieldTrial("Prefetch", kPrefetchDivisor); + scoped_refptr<base::FieldTrial> trial( + new base::FieldTrial("Prefetch", kPrefetchDivisor)); trial->AppendGroup("ContentPrefetchDisabled", no_prefetch_probability); const int yes_prefetch_grp = trial->AppendGroup("ContentPrefetchEnabled", @@ -411,9 +411,9 @@ void BrowserMainParts::ConnectBackupJobsFieldTrial() { const base::FieldTrial::Probability kConnectBackupJobsDivisor = 100; // 1% probability. const base::FieldTrial::Probability kConnectBackupJobsProbability = 1; - scoped_refptr<base::FieldTrial> trial = + scoped_refptr<base::FieldTrial> trial( new base::FieldTrial("ConnnectBackupJobs", - kConnectBackupJobsDivisor); + kConnectBackupJobsDivisor)); trial->AppendGroup("ConnectBackupJobsDisabled", kConnectBackupJobsProbability); const int connect_backup_jobs_enabled = @@ -1084,8 +1084,8 @@ int BrowserMain(const MainFunctionParams& parameters) { // for posting tasks via NewRunnableMethod. Its deleted when it goes out of // scope. Even though NewRunnableMethod does AddRef and Release, the object // will not be deleted after the Task is executed. - scoped_refptr<HistogramSynchronizer> histogram_synchronizer = - new HistogramSynchronizer(); + scoped_refptr<HistogramSynchronizer> histogram_synchronizer( + new HistogramSynchronizer()); // Initialize the prefs of the local state. browser::RegisterLocalState(local_state); @@ -1388,8 +1388,8 @@ int BrowserMain(const MainFunctionParams& parameters) { // layout globally. base::FieldTrial::Probability kSDCH_DIVISOR = 1000; base::FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 1; // 0.1% prob. - scoped_refptr<base::FieldTrial> sdch_trial = - new base::FieldTrial("GlobalSdch", kSDCH_DIVISOR); + scoped_refptr<base::FieldTrial> sdch_trial( + new base::FieldTrial("GlobalSdch", kSDCH_DIVISOR)); // Use default of "" so that all domains are supported. std::string sdch_supported_domain(""); diff --git a/chrome/browser/browser_thread.cc b/chrome/browser/browser_thread.cc index 003b1ad..7ba53e0 100644 --- a/chrome/browser/browser_thread.cc +++ b/chrome/browser/browser_thread.cc @@ -176,8 +176,8 @@ bool BrowserThread::GetCurrentThreadIdentifier(ID* identifier) { scoped_refptr<base::MessageLoopProxy> BrowserThread::GetMessageLoopProxyForThread( ID identifier) { - scoped_refptr<base::MessageLoopProxy> proxy = - new BrowserThreadMessageLoopProxy(identifier); + scoped_refptr<base::MessageLoopProxy> proxy( + new BrowserThreadMessageLoopProxy(identifier)); return proxy; } diff --git a/chrome/browser/browsing_data_appcache_helper_unittest.cc b/chrome/browser/browsing_data_appcache_helper_unittest.cc index 8373485..0e6dab3 100644 --- a/chrome/browser/browsing_data_appcache_helper_unittest.cc +++ b/chrome/browser/browsing_data_appcache_helper_unittest.cc @@ -34,8 +34,8 @@ TEST(CannedBrowsingDataAppCacheHelperTest, SetInfo) { GURL manifest2("http://example2.com/path1/manifest.xml"); GURL manifest3("http://example2.com/path2/manifest.xml"); - scoped_refptr<CannedBrowsingDataAppCacheHelper> helper = - new CannedBrowsingDataAppCacheHelper(&profile); + scoped_refptr<CannedBrowsingDataAppCacheHelper> helper( + new CannedBrowsingDataAppCacheHelper(&profile)); helper->AddAppCache(manifest1); helper->AddAppCache(manifest2); helper->AddAppCache(manifest3); @@ -67,8 +67,8 @@ TEST(CannedBrowsingDataAppCacheHelperTest, Unique) { GURL manifest("http://example.com/manifest.xml"); - scoped_refptr<CannedBrowsingDataAppCacheHelper> helper = - new CannedBrowsingDataAppCacheHelper(&profile); + scoped_refptr<CannedBrowsingDataAppCacheHelper> helper( + new CannedBrowsingDataAppCacheHelper(&profile)); helper->AddAppCache(manifest); helper->AddAppCache(manifest); @@ -91,8 +91,8 @@ TEST(CannedBrowsingDataAppCacheHelperTest, Empty) { GURL manifest("http://example.com/manifest.xml"); - scoped_refptr<CannedBrowsingDataAppCacheHelper> helper = - new CannedBrowsingDataAppCacheHelper(&profile); + scoped_refptr<CannedBrowsingDataAppCacheHelper> helper( + new CannedBrowsingDataAppCacheHelper(&profile)); ASSERT_TRUE(helper->empty()); helper->AddAppCache(manifest); diff --git a/chrome/browser/browsing_data_database_helper_unittest.cc b/chrome/browser/browsing_data_database_helper_unittest.cc index c8f1c18..ca23f39 100644 --- a/chrome/browser/browsing_data_database_helper_unittest.cc +++ b/chrome/browser/browsing_data_database_helper_unittest.cc @@ -46,8 +46,8 @@ TEST(CannedBrowsingDataDatabaseTest, AddDatabase) { const char db2[] = "db2"; const char db3[] = "db3"; - scoped_refptr<CannedBrowsingDataDatabaseHelper> helper = - new CannedBrowsingDataDatabaseHelper(&profile); + scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( + new CannedBrowsingDataDatabaseHelper(&profile)); helper->AddDatabase(origin1, db1, ""); helper->AddDatabase(origin1, db2, ""); helper->AddDatabase(origin2, db3, ""); @@ -76,8 +76,8 @@ TEST(CannedBrowsingDataDatabaseTest, Unique) { const char origin_str[] = "http_host1_1"; const char db[] = "db1"; - scoped_refptr<CannedBrowsingDataDatabaseHelper> helper = - new CannedBrowsingDataDatabaseHelper(&profile); + scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( + new CannedBrowsingDataDatabaseHelper(&profile)); helper->AddDatabase(origin, db, ""); helper->AddDatabase(origin, db, ""); @@ -100,8 +100,8 @@ TEST(CannedBrowsingDataDatabaseTest, Empty) { const GURL origin("http://host1:1/"); const char db[] = "db1"; - scoped_refptr<CannedBrowsingDataDatabaseHelper> helper = - new CannedBrowsingDataDatabaseHelper(&profile); + scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( + new CannedBrowsingDataDatabaseHelper(&profile)); ASSERT_TRUE(helper->empty()); helper->AddDatabase(origin, db, ""); diff --git a/chrome/browser/browsing_data_local_storage_helper_unittest.cc b/chrome/browser/browsing_data_local_storage_helper_unittest.cc index fe110c3..6fbb1ee 100644 --- a/chrome/browser/browsing_data_local_storage_helper_unittest.cc +++ b/chrome/browser/browsing_data_local_storage_helper_unittest.cc @@ -45,8 +45,8 @@ TEST(CannedBrowsingDataLocalStorageTest, AddLocalStorage) { const FilePath::CharType file2[] = FILE_PATH_LITERAL("http_host2_1.localstorage"); - scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper = - new CannedBrowsingDataLocalStorageHelper(&profile); + scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper( + new CannedBrowsingDataLocalStorageHelper(&profile)); helper->AddLocalStorage(origin1); helper->AddLocalStorage(origin2); @@ -70,8 +70,8 @@ TEST(CannedBrowsingDataLocalStorageTest, Unique) { const FilePath::CharType file[] = FILE_PATH_LITERAL("http_host1_1.localstorage"); - scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper = - new CannedBrowsingDataLocalStorageHelper(&profile); + scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper( + new CannedBrowsingDataLocalStorageHelper(&profile)); helper->AddLocalStorage(origin); helper->AddLocalStorage(origin); @@ -92,8 +92,8 @@ TEST(CannedBrowsingDataLocalStorageTest, Empty) { const GURL origin("http://host1:1/"); - scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper = - new CannedBrowsingDataLocalStorageHelper(&profile); + scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper( + new CannedBrowsingDataLocalStorageHelper(&profile)); ASSERT_TRUE(helper->empty()); helper->AddLocalStorage(origin); diff --git a/chrome/browser/cocoa/first_run_dialog.mm b/chrome/browser/cocoa/first_run_dialog.mm index 7f72bb4..5b97bde 100644 --- a/chrome/browser/cocoa/first_run_dialog.mm +++ b/chrome/browser/cocoa/first_run_dialog.mm @@ -77,7 +77,7 @@ void FirstRunShowBridge::ShowDialog() { // -[NSApplication runModalForWindow:] we will hang <http://crbug.com/54248>. // Therefore the main MessageLoop is run so things work. - scoped_refptr<FirstRunShowBridge> bridge = new FirstRunShowBridge(self); + scoped_refptr<FirstRunShowBridge> bridge(new FirstRunShowBridge(self)); MessageLoop::current()->PostTask( FROM_HERE, NewRunnableMethod(bridge.get(), diff --git a/chrome/browser/cocoa/web_drag_source.mm b/chrome/browser/cocoa/web_drag_source.mm index a2402da..95ab0d1 100644 --- a/chrome/browser/cocoa/web_drag_source.mm +++ b/chrome/browser/cocoa/web_drag_source.mm @@ -307,13 +307,13 @@ void PromiseWriterTask::Run() { if (downloadURL_.is_valid()) { TabContents* tabContents = [contentsView_ tabContents]; - scoped_refptr<DragDownloadFile> dragFileDownloader = new DragDownloadFile( + scoped_refptr<DragDownloadFile> dragFileDownloader(new DragDownloadFile( filePath, linked_ptr<net::FileStream>(fileStream), downloadURL_, tabContents->GetURL(), tabContents->encoding(), - tabContents); + tabContents)); // The finalizer will take care of closing and deletion. dragFileDownloader->Start( diff --git a/chrome/browser/debugger/devtools_manager_unittest.cc b/chrome/browser/debugger/devtools_manager_unittest.cc index ddcc54f..a66b986 100644 --- a/chrome/browser/debugger/devtools_manager_unittest.cc +++ b/chrome/browser/debugger/devtools_manager_unittest.cc @@ -71,7 +71,7 @@ class DevToolsManagerTest : public RenderViewHostTestHarness { }; TEST_F(DevToolsManagerTest, OpenAndManuallyCloseDevToolsClientHost) { - scoped_refptr<DevToolsManager> manager = new DevToolsManager(); + scoped_refptr<DevToolsManager> manager(new DevToolsManager()); DevToolsClientHost* host = manager->GetDevToolsClientHostFor(rvh()); EXPECT_TRUE(NULL == host); @@ -95,7 +95,7 @@ TEST_F(DevToolsManagerTest, OpenAndManuallyCloseDevToolsClientHost) { } TEST_F(DevToolsManagerTest, ForwardMessageToClient) { - scoped_refptr<DevToolsManager> manager = new DevToolsManager(); + scoped_refptr<DevToolsManager> manager(new DevToolsManager()); TestDevToolsClientHost client_host; manager->RegisterDevToolsClientHostFor(rvh(), &client_host); diff --git a/chrome/browser/debugger/devtools_netlog_observer.cc b/chrome/browser/debugger/devtools_netlog_observer.cc index 776cc9f..83a7fbb 100644 --- a/chrome/browser/debugger/devtools_netlog_observer.cc +++ b/chrome/browser/debugger/devtools_netlog_observer.cc @@ -53,7 +53,7 @@ void DevToolsNetLogObserver::OnAddEntry(net::NetLog::EventType type, "larger than expected, resetting"; request_to_info_.clear(); } - scoped_refptr<ResourceInfo> new_record = new ResourceInfo(); + scoped_refptr<ResourceInfo> new_record(new ResourceInfo()); request_to_info_.insert(std::make_pair(source.id, new_record)); return; } diff --git a/chrome/browser/debugger/devtools_remote_listen_socket.cc b/chrome/browser/debugger/devtools_remote_listen_socket.cc index bce2ba4..8ea1821 100644 --- a/chrome/browser/debugger/devtools_remote_listen_socket.cc +++ b/chrome/browser/debugger/devtools_remote_listen_socket.cc @@ -209,9 +209,9 @@ void DevToolsRemoteListenSocket::HandleMessage() { void DevToolsRemoteListenSocket::Accept() { SOCKET conn = ListenSocket::Accept(socket_); if (conn != INVALID_SOCKET) { - scoped_refptr<DevToolsRemoteListenSocket> sock = + scoped_refptr<DevToolsRemoteListenSocket> sock( new DevToolsRemoteListenSocket(conn, - message_listener_); + message_listener_)); // it's up to the delegate to AddRef if it wants to keep it around #if defined(OS_POSIX) sock->WatchSocket(WAITING_READ); diff --git a/chrome/browser/device_orientation/device_orientation_browsertest.cc b/chrome/browser/device_orientation/device_orientation_browsertest.cc index d33f5d3..6fe92ea 100644 --- a/chrome/browser/device_orientation/device_orientation_browsertest.cc +++ b/chrome/browser/device_orientation/device_orientation_browsertest.cc @@ -49,7 +49,7 @@ class DeviceOrientationBrowserTest : public InProcessBrowserTest { IN_PROC_BROWSER_TEST_F(DeviceOrientationBrowserTest, BasicTest) { const Orientation kTestOrientation(true, 1, true, 2, true, 3); - scoped_refptr<MockProvider> provider = new MockProvider(kTestOrientation); + scoped_refptr<MockProvider> provider(new MockProvider(kTestOrientation)); Provider::SetInstanceForTests(provider.get()); // The test page will register an event handler for orientation events, diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.cc b/chrome/browser/dom_ui/chrome_url_data_manager.cc index dfa7785..b793ed8 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.cc +++ b/chrome/browser/dom_ui/chrome_url_data_manager.cc @@ -269,7 +269,7 @@ void ChromeURLDataManager::DataAvailable( if (i != pending_requests_.end()) { // We acquire a reference to the job so that it doesn't disappear under the // feet of any method invoked here (we could trigger a callback). - scoped_refptr<URLRequestChromeJob> job = i->second; + scoped_refptr<URLRequestChromeJob> job(i->second); pending_requests_.erase(i); job->DataAvailable(bytes); } diff --git a/chrome/browser/dom_ui/dom_ui_factory.cc b/chrome/browser/dom_ui/dom_ui_factory.cc index aaeb4e3..cb2e30d 100644 --- a/chrome/browser/dom_ui/dom_ui_factory.cc +++ b/chrome/browser/dom_ui/dom_ui_factory.cc @@ -242,8 +242,8 @@ void DOMUIFactory::GetFaviconForURL(Profile* profile, page_url.host() != extension_misc::kBookmarkManagerId) { ExtensionDOMUI::GetFaviconForURL(profile, request, page_url); } else { - scoped_refptr<RefCountedMemory> icon_data = - DOMUIFactory::GetFaviconResourceBytes(profile, page_url); + scoped_refptr<RefCountedMemory> icon_data( + DOMUIFactory::GetFaviconResourceBytes(profile, page_url)); bool know_icon = icon_data.get() != NULL && icon_data->size() > 0; request->ForwardResultAsync( FaviconService::FaviconDataCallback::TupleType(request->handle(), diff --git a/chrome/browser/dom_ui/fileicon_source.cc b/chrome/browser/dom_ui/fileicon_source.cc index 599c755..7572cdc 100644 --- a/chrome/browser/dom_ui/fileicon_source.cc +++ b/chrome/browser/dom_ui/fileicon_source.cc @@ -43,7 +43,7 @@ void FileIconSource::StartDataRequest(const std::string& path, SkBitmap* icon = im->LookupIcon(escaped_filepath, IconLoader::NORMAL); if (icon) { - scoped_refptr<RefCountedBytes> icon_data = new RefCountedBytes; + scoped_refptr<RefCountedBytes> icon_data(new RefCountedBytes); gfx::PNGCodec::EncodeBGRASkBitmap(*icon, false, &icon_data->data); SendResponse(request_id, icon_data); @@ -65,7 +65,7 @@ void FileIconSource::OnFileIconDataAvailable(IconManager::Handle handle, int request_id = cancelable_consumer_.GetClientData(im, handle); if (icon) { - scoped_refptr<RefCountedBytes> icon_data = new RefCountedBytes; + scoped_refptr<RefCountedBytes> icon_data(new RefCountedBytes); gfx::PNGCodec::EncodeBGRASkBitmap(*icon, false, &icon_data->data); SendResponse(request_id, icon_data); diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index b7471b7..a662102 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -627,8 +627,8 @@ void NewTabUI::NewTabHTMLSource::StartDataRequest(const std::string& path, return; } - scoped_refptr<RefCountedBytes> html_bytes = - profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record); + scoped_refptr<RefCountedBytes> html_bytes( + profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record)); SendResponse(request_id, html_bytes); } diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc index 12ff5c0..c4e0799 100644 --- a/chrome/browser/extensions/extension_process_manager.cc +++ b/chrome/browser/extensions/extension_process_manager.cc @@ -254,8 +254,8 @@ RenderProcessHost* ExtensionProcessManager::GetExtensionProcess( const GURL& url) { if (!browsing_instance_->HasSiteInstance(url)) return NULL; - scoped_refptr<SiteInstance> site = - browsing_instance_->GetSiteInstanceForURL(url); + scoped_refptr<SiteInstance> site( + browsing_instance_->GetSiteInstanceForURL(url)); if (site->HasProcess()) return site->GetProcess(); return NULL; diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index df19489..3c678e5 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -518,8 +518,8 @@ void ExtensionUpdater::OnManifestFetchComplete(const GURL& url, // We want to try parsing the manifest, and if it indicates updates are // available, we want to fire off requests to fetch those updates. if (status.status() == URLRequestStatus::SUCCESS && response_code == 200) { - scoped_refptr<SafeManifestParser> safe_parser = - new SafeManifestParser(data, current_manifest_fetch_.release(), this); + scoped_refptr<SafeManifestParser> safe_parser( + new SafeManifestParser(data, current_manifest_fetch_.release(), this)); safe_parser->Start(); } else { // TODO(asargent) Do exponential backoff here. (http://crbug.com/12546). diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc index 581be2b..ed96b0d 100644 --- a/chrome/browser/extensions/extension_updater_unittest.cc +++ b/chrome/browser/extensions/extension_updater_unittest.cc @@ -308,8 +308,8 @@ class ExtensionUpdaterTest : public testing::Test { TestURLFetcherFactory factory; URLFetcher::set_factory(&factory); - scoped_refptr<ExtensionUpdater> updater = - new ExtensionUpdater(&service, service.pref_service(), 60*60*24); + scoped_refptr<ExtensionUpdater> updater( + new ExtensionUpdater(&service, service.pref_service(), 60*60*24)); updater->Start(); // Tell the update that it's time to do update checks. @@ -356,8 +356,8 @@ class ExtensionUpdaterTest : public testing::Test { TestURLFetcherFactory factory; URLFetcher::set_factory(&factory); - scoped_refptr<ExtensionUpdater> updater = - new ExtensionUpdater(&service, service.pref_service(), 60*60*24); + scoped_refptr<ExtensionUpdater> updater( + new ExtensionUpdater(&service, service.pref_service(), 60*60*24)); updater->Start(); // Tell the updater that it's time to do update checks. @@ -408,9 +408,9 @@ class ExtensionUpdaterTest : public testing::Test { service.set_extensions(tmp); MessageLoop message_loop; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); // Check passing an empty list of parse results to DetermineUpdates ManifestFetchData fetch_data(GURL("http://localhost/foo")); @@ -445,9 +445,9 @@ class ExtensionUpdaterTest : public testing::Test { service.set_pending_extensions(pending_extensions); MessageLoop message_loop; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); ManifestFetchData fetch_data(GURL("http://localhost/foo")); UpdateManifest::Results updates; @@ -479,9 +479,9 @@ class ExtensionUpdaterTest : public testing::Test { TestURLFetcher* fetcher = NULL; URLFetcher::set_factory(&factory); ServiceForDownloadTests service; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); GURL url1("http://localhost/manifest1"); GURL url2("http://localhost/manifest2"); @@ -543,9 +543,9 @@ class ExtensionUpdaterTest : public testing::Test { TestURLFetcher* fetcher = NULL; URLFetcher::set_factory(&factory); ServiceForDownloadTests service; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); GURL test_url("http://localhost/extension.crx"); @@ -606,9 +606,9 @@ class ExtensionUpdaterTest : public testing::Test { TestURLFetcher* fetcher = NULL; URLFetcher::set_factory(&factory); ServiceForBlacklistTests service; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); service.pref_service()-> RegisterStringPref(prefs::kExtensionBlacklistUpdateVersion, "0"); GURL test_url("http://localhost/extension.crx"); @@ -653,9 +653,9 @@ class ExtensionUpdaterTest : public testing::Test { TestURLFetcher* fetcher = NULL; URLFetcher::set_factory(&factory); ServiceForDownloadTests service; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); GURL url1("http://localhost/extension1.crx"); GURL url2("http://localhost/extension2.crx"); @@ -740,9 +740,9 @@ class ExtensionUpdaterTest : public testing::Test { } MessageLoop message_loop; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); updater->set_blacklist_checks_enabled(false); // Make the updater do manifest fetching, and note the urls it tries to @@ -792,9 +792,9 @@ class ExtensionUpdaterTest : public testing::Test { // >= 1 day for the extension. static void TestHandleManifestResults() { ServiceForManifestTests service; - scoped_refptr<ExtensionUpdater> updater = + scoped_refptr<ExtensionUpdater> updater( new ExtensionUpdater(&service, service.pref_service(), - kUpdateFrequencySecs); + kUpdateFrequencySecs)); GURL update_url("http://www.google.com/manifest"); ExtensionList tmp; diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 5c81670..4b5b2c1 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -295,11 +295,11 @@ void ExtensionsServiceBackend::LoadSingleExtension( file_util::AbsolutePath(&extension_path); std::string error; - scoped_refptr<const Extension> extension = extension_file_util::LoadExtension( + scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( extension_path, Extension::LOAD, false, // Don't require id - &error); + &error)); if (!extension) { ReportExtensionLoadError(extension_path, error); diff --git a/chrome/browser/extensions/extensions_startup.cc b/chrome/browser/extensions/extensions_startup.cc index 1286179..9faeac6 100644 --- a/chrome/browser/extensions/extensions_startup.cc +++ b/chrome/browser/extensions/extensions_startup.cc @@ -83,8 +83,8 @@ bool HandlePackExtension(const CommandLine& cmd_line) { // Launch a job to perform the packing on the file thread. PackExtensionLogger pack_client; - scoped_refptr<PackExtensionJob> pack_job = - new PackExtensionJob(&pack_client, src_dir, private_key_path); + scoped_refptr<PackExtensionJob> pack_job( + new PackExtensionJob(&pack_client, src_dir, private_key_path)); pack_job->Start(); // The job will post a notification task to the current thread's message diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 54f030e..525c091 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -405,7 +405,7 @@ int FirstRun::ImportFromFile(Profile* profile, const CommandLine& cmdline) { NOTREACHED(); return false; } - scoped_refptr<ImporterHost> importer_host = new ImporterHost(); + scoped_refptr<ImporterHost> importer_host(new ImporterHost()); FirstRunImportObserver observer; importer_host->set_headless(); diff --git a/chrome/browser/geolocation/access_token_store.cc b/chrome/browser/geolocation/access_token_store.cc index af76e54..9b4eea7 100644 --- a/chrome/browser/geolocation/access_token_store.cc +++ b/chrome/browser/geolocation/access_token_store.cc @@ -94,8 +94,8 @@ void AccessTokenStore::RegisterPrefs(PrefService* prefs) { AccessTokenStore::Handle AccessTokenStore::LoadAccessTokens( CancelableRequestConsumerBase* consumer, LoadAccessTokensCallbackType* callback) { - scoped_refptr<CancelableRequest<LoadAccessTokensCallbackType> > request = - new CancelableRequest<LoadAccessTokensCallbackType>(callback); + scoped_refptr<CancelableRequest<LoadAccessTokensCallbackType> > request( + new CancelableRequest<LoadAccessTokensCallbackType>(callback)); AddRequest(request, consumer); DCHECK(request->handle()); diff --git a/chrome/browser/geolocation/access_token_store_browsertest.cc b/chrome/browser/geolocation/access_token_store_browsertest.cc index b4449e5..802d16d 100644 --- a/chrome/browser/geolocation/access_token_store_browsertest.cc +++ b/chrome/browser/geolocation/access_token_store_browsertest.cc @@ -57,7 +57,7 @@ struct TokenLoadClientForTest { void RunCancelTestInClientTread() { ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)); - scoped_refptr<AccessTokenStore> store = NewChromePrefsAccessTokenStore(); + scoped_refptr<AccessTokenStore> store(NewChromePrefsAccessTokenStore()); CancelableRequestConsumer consumer; TokenLoadClientForTest load_client; @@ -117,8 +117,8 @@ void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( } if (token_to_set_) { - scoped_refptr<AccessTokenStore> store = - NewChromePrefsAccessTokenStore(); + scoped_refptr<AccessTokenStore> store( + NewChromePrefsAccessTokenStore()); store->SaveAccessToken(ref_url_, *token_to_set_); } BrowserThread::PostTask( diff --git a/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc b/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc index f24a403..68bc752 100644 --- a/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc +++ b/chrome/browser/geolocation/geolocation_exceptions_table_model_unittest.cc @@ -40,8 +40,8 @@ class GeolocationExceptionsTableModelTest : public RenderViewHostTestHarness { } void CreateAllowedSamples() { - scoped_refptr<GeolocationContentSettingsMap> map = - profile()->GetGeolocationContentSettingsMap(); + scoped_refptr<GeolocationContentSettingsMap> map( + profile()->GetGeolocationContentSettingsMap()); map->SetContentSetting(kUrl0, kUrl0, CONTENT_SETTING_ALLOW); map->SetContentSetting(kUrl0, kUrl1, CONTENT_SETTING_ALLOW); map->SetContentSetting(kUrl0, kUrl2, CONTENT_SETTING_ALLOW); @@ -57,8 +57,8 @@ class GeolocationExceptionsTableModelTest : public RenderViewHostTestHarness { TEST_F(GeolocationExceptionsTableModelTest, CanRemoveException) { EXPECT_EQ(0, model_->RowCount()); - scoped_refptr<GeolocationContentSettingsMap> map = - profile()->GetGeolocationContentSettingsMap(); + scoped_refptr<GeolocationContentSettingsMap> map( + profile()->GetGeolocationContentSettingsMap()); // Ensure a single entry can be removed. map->SetContentSetting(kUrl0, kUrl0, CONTENT_SETTING_ALLOW); @@ -86,8 +86,8 @@ TEST_F(GeolocationExceptionsTableModelTest, CanRemoveException) { TEST_F(GeolocationExceptionsTableModelTest, RemoveExceptions) { CreateAllowedSamples(); - scoped_refptr<GeolocationContentSettingsMap> map = - profile()->GetGeolocationContentSettingsMap(); + scoped_refptr<GeolocationContentSettingsMap> map( + profile()->GetGeolocationContentSettingsMap()); // Test removing parent exception. GeolocationExceptionsTableModel::Rows rows; @@ -113,8 +113,8 @@ TEST_F(GeolocationExceptionsTableModelTest, RemoveExceptions) { TEST_F(GeolocationExceptionsTableModelTest, RemoveAll) { CreateAllowedSamples(); - scoped_refptr<GeolocationContentSettingsMap> map = - profile()->GetGeolocationContentSettingsMap(); + scoped_refptr<GeolocationContentSettingsMap> map( + profile()->GetGeolocationContentSettingsMap()); model_->RemoveAll(); EXPECT_EQ(CONTENT_SETTING_ASK, map->GetContentSetting(kUrl0, kUrl0)); diff --git a/chrome/browser/host_content_settings_map_unittest.cc b/chrome/browser/host_content_settings_map_unittest.cc index ea829d4..b5c74a0 100644 --- a/chrome/browser/host_content_settings_map_unittest.cc +++ b/chrome/browser/host_content_settings_map_unittest.cc @@ -527,8 +527,8 @@ TEST_F(HostContentSettingsMapTest, OffTheRecord) { HostContentSettingsMap* host_content_settings_map = profile.GetHostContentSettingsMap(); profile.set_off_the_record(true); - scoped_refptr<HostContentSettingsMap> otr_map = - new HostContentSettingsMap(&profile); + scoped_refptr<HostContentSettingsMap> otr_map( + new HostContentSettingsMap(&profile)); profile.set_off_the_record(false); GURL host("http://example.com/"); diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index e35f7a7..fbe3d3d 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -178,8 +178,8 @@ bool FFUnitTestDecryptorProxy::WaitForClientResponse() { // the future and cancel it if an RPC message comes back earlier. // This relies on the IPC listener class to quit the message loop itself when // a message comes in. - scoped_refptr<CancellableQuitMsgLoop> quit_task = - new CancellableQuitMsgLoop(); + scoped_refptr<CancellableQuitMsgLoop> quit_task( + new CancellableQuitMsgLoop()); MessageLoop::current()->PostDelayedTask( FROM_HERE, NewRunnableMethod(quit_task.get(), &CancellableQuitMsgLoop::QuitNow), diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc index 2bad8ee..5261c03 100644 --- a/chrome/browser/importer/importer_unittest.cc +++ b/chrome/browser/importer/importer_unittest.cc @@ -115,7 +115,7 @@ class ImporterTest : public testing::Test { profile_info.browser_type = FIREFOX3; profile_info.app_path = app_path_; profile_info.source_path = profile_path_; - scoped_refptr<ImporterHost> host = new ImporterHost(); + scoped_refptr<ImporterHost> host(new ImporterHost()); host->SetObserver(observer); int items = HISTORY | PASSWORDS | FAVORITES; if (import_search_plugins) @@ -697,7 +697,7 @@ TEST_F(ImporterTest, MAYBE(Firefox2Importer)) { ASSERT_TRUE(file_util::CopyDirectory(data_path, search_engine_path, false)); MessageLoop* loop = MessageLoop::current(); - scoped_refptr<ImporterHost> host = new ImporterHost(); + scoped_refptr<ImporterHost> host(new ImporterHost()); FirefoxObserver* observer = new FirefoxObserver(); host->SetObserver(observer); ProfileInfo profile_info; @@ -880,15 +880,15 @@ class Firefox3Observer : public ProfileWriter, }; TEST_F(ImporterTest, MAYBE(Firefox30Importer)) { - scoped_refptr<Firefox3Observer> observer = new Firefox3Observer(); + scoped_refptr<Firefox3Observer> observer(new Firefox3Observer()); Firefox3xImporterTest("firefox3_profile", observer.get(), observer.get(), true); } TEST_F(ImporterTest, MAYBE(Firefox35Importer)) { bool import_search_engines = false; - scoped_refptr<Firefox3Observer> observer = - new Firefox3Observer(import_search_engines); + scoped_refptr<Firefox3Observer> observer( + new Firefox3Observer(import_search_engines)); Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), import_search_engines); } diff --git a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc index eb696ac4..365c91c 100644 --- a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc +++ b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc @@ -1,6 +1,6 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #include "chrome/browser/in_process_webkit/browser_webkitclient_impl.h" @@ -150,8 +150,8 @@ void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( WebKit::WebVector<WebKit::WebIDBKey>& keys) { // TODO(bulach): we need to figure out a way to keep the utility process // running for longer, and shut it down when no longer used. - scoped_refptr<IndexedDBKeyUtilityClient> indexed_db_key_utility_client = - new IndexedDBKeyUtilityClient(); + scoped_refptr<IndexedDBKeyUtilityClient> indexed_db_key_utility_client( + new IndexedDBKeyUtilityClient()); indexed_db_key_utility_client->StartUtilityProcess(); std::vector<SerializedScriptValue> std_values; diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 3c7fdc6..55713b7 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -62,8 +62,8 @@ net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { // For each option (i.e., non-default), we have a fixed probability. base::FieldTrial::Probability kProbabilityPerGroup = 100; // 10%. - scoped_refptr<base::FieldTrial> trial = - new base::FieldTrial("DnsParallelism", kDivisor); + scoped_refptr<base::FieldTrial> trial( + new base::FieldTrial("DnsParallelism", kDivisor)); // List options with different counts. // Firefox limits total to 8 in parallel, and default is currently 50. diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index 1ddc987..9cafefc 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -970,7 +970,7 @@ void MetricsService::LogTransmissionTimerDone() { Task* task = log_sender_factory_. NewRunnableMethod(&MetricsService::OnMemoryDetailCollectionDone); - scoped_refptr<MetricsMemoryDetails> details = new MetricsMemoryDetails(task); + scoped_refptr<MetricsMemoryDetails> details(new MetricsMemoryDetails(task)); details->StartFetch(); // Collect WebCore cache information to put into a histogram. diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc index 889494d..8f762ef 100644 --- a/chrome/browser/net/connection_tester.cc +++ b/chrome/browser/net/connection_tester.cc @@ -277,8 +277,8 @@ void ConnectionTester::TestRunner::OnReadCompleted(URLRequest* request, void ConnectionTester::TestRunner::ReadBody(URLRequest* request) { // Read the response body |kReadBufferSize| bytes at a time. - scoped_refptr<net::IOBuffer> unused_buffer = - new net::IOBuffer(kReadBufferSize); + scoped_refptr<net::IOBuffer> unused_buffer( + new net::IOBuffer(kReadBufferSize)); int num_bytes; if (request->Read(unused_buffer, kReadBufferSize, &num_bytes)) { OnReadCompleted(request, num_bytes); @@ -299,8 +299,8 @@ void ConnectionTester::TestRunner::OnResponseCompleted(URLRequest* request) { void ConnectionTester::TestRunner::Run(const Experiment& experiment) { // Try to create a URLRequestContext for this experiment. - scoped_refptr<ExperimentURLRequestContext> context = - new ExperimentURLRequestContext(tester_->io_thread_); + scoped_refptr<ExperimentURLRequestContext> context( + new ExperimentURLRequestContext(tester_->io_thread_)); int rv = context->Init(experiment); if (rv != net::OK) { // Complete the experiment with a failure. diff --git a/chrome/browser/net/connection_tester_unittest.cc b/chrome/browser/net/connection_tester_unittest.cc index fe6e8cc..4191484 100644 --- a/chrome/browser/net/connection_tester_unittest.cc +++ b/chrome/browser/net/connection_tester_unittest.cc @@ -76,8 +76,8 @@ class ConnectionTesterTest : public PlatformTest { : test_server_(net::TestServer::TYPE_HTTP, FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))), message_loop_(MessageLoop::TYPE_IO) { - scoped_refptr<net::RuleBasedHostResolverProc> catchall_resolver = - new net::RuleBasedHostResolverProc(NULL); + scoped_refptr<net::RuleBasedHostResolverProc> catchall_resolver( + new net::RuleBasedHostResolverProc(NULL)); catchall_resolver->AddRule("*", "127.0.0.1"); diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc index 38f0281..bbc798e 100644 --- a/chrome/browser/net/predictor_unittest.cc +++ b/chrome/browser/net/predictor_unittest.cc @@ -109,25 +109,25 @@ class PredictorTest : public testing::Test { //------------------------------------------------------------------------------ TEST_F(PredictorTest, StartupShutdownTest) { - scoped_refptr<Predictor> testing_master = + scoped_refptr<Predictor> testing_master( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); testing_master->Shutdown(); } TEST_F(PredictorTest, ShutdownWhenResolutionIsPendingTest) { - scoped_refptr<net::WaitingHostResolverProc> resolver_proc = - new net::WaitingHostResolverProc(NULL); + scoped_refptr<net::WaitingHostResolverProc> resolver_proc( + new net::WaitingHostResolverProc(NULL)); host_resolver_->Reset(resolver_proc); - scoped_refptr<Predictor> testing_master = + scoped_refptr<Predictor> testing_master( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); GURL localhost("http://localhost:80"); UrlList names; @@ -149,11 +149,11 @@ TEST_F(PredictorTest, ShutdownWhenResolutionIsPendingTest) { } TEST_F(PredictorTest, SingleLookupTest) { - scoped_refptr<Predictor> testing_master = + scoped_refptr<Predictor> testing_master( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); GURL goog("http://www.google.com:80"); @@ -181,11 +181,11 @@ TEST_F(PredictorTest, SingleLookupTest) { TEST_F(PredictorTest, ConcurrentLookupTest) { host_resolver_->rules()->AddSimulatedFailure("*.notfound"); - scoped_refptr<Predictor> testing_master = + scoped_refptr<Predictor> testing_master( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); GURL goog("http://www.google.com:80"), goog2("http://gmail.google.com.com:80"), @@ -231,11 +231,11 @@ TEST_F(PredictorTest, ConcurrentLookupTest) { TEST_F(PredictorTest, MassiveConcurrentLookupTest) { host_resolver_->rules()->AddSimulatedFailure("*.notfound"); - scoped_refptr<Predictor> testing_master = + scoped_refptr<Predictor> testing_master( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); UrlList names; for (int i = 0; i < 100; i++) @@ -351,11 +351,11 @@ static bool GetDataFromSerialization(const GURL& motivation, // Make sure nil referral lists really have no entries, and no latency listed. TEST_F(PredictorTest, ReferrerSerializationNilTest) { - scoped_refptr<Predictor> predictor = + scoped_refptr<Predictor> predictor( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); scoped_ptr<ListValue> referral_list(NewEmptySerializationList()); predictor->SerializeReferrers(referral_list.get()); EXPECT_EQ(1U, referral_list->GetSize()); @@ -370,11 +370,11 @@ TEST_F(PredictorTest, ReferrerSerializationNilTest) { // deserialized into the database, and can be extracted back out via // serialization without being changed. TEST_F(PredictorTest, ReferrerSerializationSingleReferrerTest) { - scoped_refptr<Predictor> predictor = + scoped_refptr<Predictor> predictor( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); const GURL motivation_url("http://www.google.com:91"); const GURL subresource_url("http://icons.google.com:90"); const double kUseRate = 23.4; @@ -398,11 +398,11 @@ TEST_F(PredictorTest, ReferrerSerializationSingleReferrerTest) { // Make sure the Trim() functionality works as expected. TEST_F(PredictorTest, ReferrerSerializationTrimTest) { - scoped_refptr<Predictor> predictor = + scoped_refptr<Predictor> predictor( new Predictor(host_resolver_.get(), default_max_queueing_delay_, PredictorInit::kMaxSpeculativeParallelResolves, - false); + false)); GURL motivation_url("http://www.google.com:110"); GURL icon_subresource_url("http://icons.google.com:111"); diff --git a/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc b/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc index 9c0ab55..fd5088b 100644 --- a/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc +++ b/chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc @@ -28,8 +28,8 @@ static scoped_refptr<WebSocketExperimentRunner> runner; void WebSocketExperimentRunner::Start() { DCHECK(!runner.get()); - scoped_refptr<base::FieldTrial> trial = - new base::FieldTrial("WebSocketExperiment", 1000); + scoped_refptr<base::FieldTrial> trial( + new base::FieldTrial("WebSocketExperiment", 1000)); trial->AppendGroup("active", 5); // 0.5% in active group. bool run_experiment = diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 47b0b8b..cb451c3 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -297,14 +297,14 @@ bool BrowserRenderProcessHost::Init( // Construct the AudioRendererHost with the IO thread. audio_renderer_host_ = new AudioRendererHost(); - scoped_refptr<ResourceMessageFilter> resource_message_filter = + scoped_refptr<ResourceMessageFilter> resource_message_filter( new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), id(), audio_renderer_host_.get(), PluginService::GetInstance(), g_browser_process->print_job_manager(), profile(), - widget_helper_); + widget_helper_)); CommandLine::StringType renderer_prefix; #if defined(OS_POSIX) @@ -335,8 +335,8 @@ bool BrowserRenderProcessHost::Init( // be doing. channel_->set_sync_messages_with_no_timeout_allowed(false); - scoped_refptr<PepperFileMessageFilter> pepper_file_message_filter = - new PepperFileMessageFilter(id(), profile()); + scoped_refptr<PepperFileMessageFilter> pepper_file_message_filter( + new PepperFileMessageFilter(id(), profile())); channel_->AddFilter(pepper_file_message_filter); if (run_renderer_in_process()) { diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index b9d75b7..28252b8 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -707,7 +707,7 @@ void ResourceDispatcherHost::BeginDownload( request_id_--; - scoped_refptr<ResourceHandler> handler = + scoped_refptr<ResourceHandler> handler( new DownloadResourceHandler(this, child_id, route_id, @@ -716,7 +716,7 @@ void ResourceDispatcherHost::BeginDownload( download_file_manager_.get(), request, prompt_for_save_location, - save_info); + save_info)); if (safe_browsing_->enabled()) { handler = CreateSafeBrowsingResourceHandler(handler, child_id, route_id, @@ -757,11 +757,11 @@ void ResourceDispatcherHost::BeginSaveFile(const GURL& url, // requests. Does nothing if they are already loaded. PluginService::GetInstance()->LoadChromePlugins(this); - scoped_refptr<ResourceHandler> handler = + scoped_refptr<ResourceHandler> handler( new SaveFileResourceHandler(child_id, route_id, url, - save_file_manager_.get()); + save_file_manager_.get())); request_id_--; bool known_proto = URLRequest::IsHandledURL(url); @@ -1023,7 +1023,7 @@ void ResourceDispatcherHost::OnReceivedRedirect(URLRequest* request, return; } - scoped_refptr<ResourceResponse> response = new ResourceResponse; + scoped_refptr<ResourceResponse> response(new ResourceResponse); PopulateResourceResponse(request, info->replace_extension_localization_templates(), response); if (!info->resource_handler()->OnRequestRedirected(info->request_id(), @@ -1123,7 +1123,7 @@ void ResourceDispatcherHost::OnResponseStarted(URLRequest* request) { bool ResourceDispatcherHost::CompleteResponseStarted(URLRequest* request) { ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); - scoped_refptr<ResourceResponse> response = new ResourceResponse; + scoped_refptr<ResourceResponse> response(new ResourceResponse); PopulateResourceResponse(request, info->replace_extension_localization_templates(), response); diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index d6334fd..adbe1cf 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -1478,7 +1478,7 @@ void ResourceMessageFilter::OnCacheableMetadataAvailable( http_transaction_factory()->GetCache(); DCHECK(cache); - scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(data.size()); + scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(data.size())); memcpy(buf->data(), &data.front(), data.size()); cache->WriteMetadata( url, base::Time::FromDoubleT(expected_response_time), buf, data.size()); diff --git a/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc b/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc index 1c61bea..9e1cccc 100644 --- a/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc +++ b/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc @@ -103,9 +103,9 @@ bool X509UserCertResourceHandler::OnResponseCompleted( // TODO(gauravsh): Verify that 'request_id' was actually a keygen form post // and only then import the certificate. AssembleResource(); - scoped_refptr<net::X509Certificate> cert = + scoped_refptr<net::X509Certificate> cert( net::X509Certificate::CreateFromBytes(resource_buffer_->data(), - content_length_); + content_length_)); // The handler will run the UI and delete itself when it's finished. new SSLAddCertHandler(request_, cert, render_process_host_id_, render_view_id_); diff --git a/chrome/browser/safe_browsing/bloom_filter_unittest.cc b/chrome/browser/safe_browsing/bloom_filter_unittest.cc index 1268e02..97c1558 100644 --- a/chrome/browser/safe_browsing/bloom_filter_unittest.cc +++ b/chrome/browser/safe_browsing/bloom_filter_unittest.cc @@ -30,8 +30,8 @@ TEST(SafeBrowsingBloomFilter, BloomFilterUse) { int count = 1000; // Build up the bloom filter. - scoped_refptr<BloomFilter> filter = - new BloomFilter(count * BloomFilter::kBloomFilterSizeRatio); + scoped_refptr<BloomFilter> filter( + new BloomFilter(count * BloomFilter::kBloomFilterSizeRatio)); typedef std::set<SBPrefix> Values; Values values; @@ -44,8 +44,8 @@ TEST(SafeBrowsingBloomFilter, BloomFilterUse) { // Check serialization works. char* data_copy = new char[filter->size()]; memcpy(data_copy, filter->data(), filter->size()); - scoped_refptr<BloomFilter> filter_copy = - new BloomFilter(data_copy, filter->size(), filter->hash_keys_); + scoped_refptr<BloomFilter> filter_copy( + new BloomFilter(data_copy, filter->size(), filter->hash_keys_)); // Check no false negatives by ensuring that every time we inserted exists. for (Values::const_iterator i = values.begin(); i != values.end(); ++i) @@ -82,8 +82,8 @@ TEST(SafeBrowsingBloomFilter, BloomFilterUse) { TEST(SafeBrowsingBloomFilter, BloomFilterFile) { // Create initial filter. const int kTestEntries = BloomFilter::kBloomFilterMinSize; - scoped_refptr<BloomFilter> filter_write = - new BloomFilter(kTestEntries * BloomFilter::kBloomFilterSizeRatio); + scoped_refptr<BloomFilter> filter_write( + new BloomFilter(kTestEntries * BloomFilter::kBloomFilterSizeRatio)); for (int i = 0; i < kTestEntries; ++i) filter_write->Insert(GenHash()); @@ -99,7 +99,7 @@ TEST(SafeBrowsingBloomFilter, BloomFilterFile) { // Create new empty filter and load from disk. BloomFilter* filter = BloomFilter::LoadFile(filter_path); ASSERT_TRUE(filter != NULL); - scoped_refptr<BloomFilter> filter_read = filter; + scoped_refptr<BloomFilter> filter_read(filter); // Check data consistency. EXPECT_EQ(filter_write->hash_keys_.size(), filter_read->hash_keys_.size()); diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 592bf22..aac28cd 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -669,8 +669,8 @@ void SafeBrowsingService::Start() { } // We will issue network fetches using the default profile's request context. - scoped_refptr<URLRequestContextGetter> request_context_getter = - GetDefaultProfile()->GetRequestContext(); + scoped_refptr<URLRequestContextGetter> request_context_getter( + GetDefaultProfile()->GetRequestContext()); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc index 49b93ea..7af8454 100644 --- a/chrome/browser/safe_browsing/safe_browsing_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_test.cc @@ -526,8 +526,8 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SafeBrowsingSystemTest) { int server_port = SafeBrowsingTestServer::Port(); ASSERT_TRUE(InitSafeBrowsingService()); - scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper = - new SafeBrowsingServiceTestHelper(this); + scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper( + new SafeBrowsingServiceTestHelper(this)); int last_step = 0; FilePath datafile_path = FilePath(kDataFile); SafeBrowsingTestServer test_server(datafile_path); diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 9b2db65..1cf4493 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -417,9 +417,9 @@ SessionService::Handle SessionService::GetCurrentSession( if (pending_window_close_ids_.empty()) { // If there are no pending window closes, we can get the current session // from memory. - scoped_refptr<InternalSessionRequest> request = new InternalSessionRequest( + scoped_refptr<InternalSessionRequest> request(new InternalSessionRequest( NewCallback(this, &SessionService::OnGotSessionCommands), - callback); + callback)); AddRequest(request, consumer); IdToRange tab_to_available_range; std::set<SessionID::id_type> windows_to_track; diff --git a/chrome/browser/ssl/ssl_host_state_unittest.cc b/chrome/browser/ssl/ssl_host_state_unittest.cc index 32e89ed..e239f90 100644 --- a/chrome/browser/ssl/ssl_host_state_unittest.cc +++ b/chrome/browser/ssl/ssl_host_state_unittest.cc @@ -112,9 +112,9 @@ TEST_F(SSLHostStateTest, DidHostRunInsecureContent) { } TEST_F(SSLHostStateTest, QueryPolicy) { - scoped_refptr<net::X509Certificate> google_cert = + scoped_refptr<net::X509Certificate> google_cert( net::X509Certificate::CreateFromBytes( - reinterpret_cast<const char*>(google_der), sizeof(google_der)); + reinterpret_cast<const char*>(google_der), sizeof(google_der))); SSLHostState state; diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc index c894a44..208a9d2 100644 --- a/chrome/browser/ssl/ssl_manager.cc +++ b/chrome/browser/ssl/ssl_manager.cc @@ -210,14 +210,14 @@ void SSLManager::DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details) { // caches sub-resources. // This resource must have been loaded with no filtering because filtered // resouces aren't cachable. - scoped_refptr<SSLRequestInfo> info = new SSLRequestInfo( + scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( details->url(), ResourceType::SUB_RESOURCE, details->frame_origin(), details->main_frame_origin(), details->pid(), details->ssl_cert_id(), - details->ssl_cert_status()); + details->ssl_cert_status())); // Simulate loading this resource through the usual path. policy()->OnRequestStarted(info.get()); @@ -226,14 +226,14 @@ void SSLManager::DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details) { void SSLManager::DidStartResourceResponse(ResourceRequestDetails* details) { DCHECK(details); - scoped_refptr<SSLRequestInfo> info = new SSLRequestInfo( + scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( details->url(), details->resource_type(), details->frame_origin(), details->main_frame_origin(), details->origin_child_id(), details->ssl_cert_id(), - details->ssl_cert_status()); + details->ssl_cert_status())); // Notify our policy that we started a resource request. Ideally, the // policy should have the ability to cancel the request, but we can't do diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc index 9c6a776..d0ede1a 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -191,8 +191,8 @@ TEST_F(AutofillDataTypeControllerTest, AbortWhileWDSStarting) { WillRepeatedly(Return(personal_data_manager_.get())); EXPECT_CALL(*(personal_data_manager_.get()), IsDataLoaded()). WillRepeatedly(Return(true)); - scoped_refptr<WebDataServiceFake> web_data_service_not_loaded = - new WebDataServiceFake(false); + scoped_refptr<WebDataServiceFake> web_data_service_not_loaded( + new WebDataServiceFake(false)); EXPECT_CALL(profile_, GetWebDataService(_)). WillOnce(Return(web_data_service_not_loaded.get())); autofill_dtc_->Start(NewCallback(&start_callback_, &StartCallback::Run)); diff --git a/chrome/browser/sync/glue/history_model_worker.cc b/chrome/browser/sync/glue/history_model_worker.cc index b6f3e5e..1c39501 100644 --- a/chrome/browser/sync/glue/history_model_worker.cc +++ b/chrome/browser/sync/glue/history_model_worker.cc @@ -46,7 +46,7 @@ HistoryModelWorker::~HistoryModelWorker() { void HistoryModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { WaitableEvent done(false, false); - scoped_refptr<WorkerTask> task = new WorkerTask(work, &done); + scoped_refptr<WorkerTask> task(new WorkerTask(work, &done)); history_service_->ScheduleDBTask(task.get(), this); done.Wait(); } diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 6a7c862..e8e4ec00 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -790,7 +790,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddEntry) { AutofillChangeList changes; changes.push_back(AutofillChange(AutofillChange::ADD, added_entry.key())); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillChangeList>(&changes)); @@ -820,7 +820,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddProfile) { AutofillProfileChange change(AutofillProfileChange::ADD, added_profile.Label(), &added_profile, string16()); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillProfileChange>(&change)); @@ -872,7 +872,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddProfileConflict) { WillOnce(DoAll(SaveArg<0>(&relabelled_profile), Return(true))); EXPECT_CALL(*personal_data_manager_, Refresh()); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillProfileChange>(&change)); @@ -911,7 +911,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeUpdateEntry) { AutofillChangeList changes; changes.push_back(AutofillChange(AutofillChange::UPDATE, updated_entry.key())); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillChangeList>(&changes)); @@ -950,7 +950,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeUpdateProfile) { AutofillProfileChange change(AutofillProfileChange::UPDATE, update_profile.Label(), &update_profile, ASCIIToUTF16("Billing")); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillProfileChange>(&change)); @@ -990,7 +990,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeUpdateProfileRelabel) { AutofillProfileChange change(AutofillProfileChange::UPDATE, update_profile.Label(), &update_profile, ASCIIToUTF16("Billing")); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillProfileChange>(&change)); @@ -1049,7 +1049,7 @@ TEST_F(ProfileSyncServiceAutofillTest, AutofillProfileChange change(AutofillProfileChange::UPDATE, josephine_update.Label(), &josephine_update, josephine.Label()); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillProfileChange>(&change)); @@ -1087,7 +1087,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveEntry) { AutofillChangeList changes; changes.push_back(AutofillChange(AutofillChange::REMOVE, original_entry.key())); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillChangeList>(&changes)); @@ -1127,7 +1127,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveProfile) { AutofillProfileChange change(AutofillProfileChange::REMOVE, sync_profile.Label(), NULL, string16()); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillProfileChange>(&change)); @@ -1155,7 +1155,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeError) { AutofillChangeList changes; changes.push_back(AutofillChange(AutofillChange::ADD, evil_entry.key())); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&db_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_)); notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED, Source<WebDataService>(web_data_service_.get()), Details<AutofillChangeList>(&changes)); @@ -1187,8 +1187,8 @@ TEST_F(ProfileSyncServiceAutofillTest, DISABLED_ServerChangeRace) { // (true, false) means we have to reset after |Signal|, init to unsignaled. scoped_ptr<WaitableEvent> wait_for_start(new WaitableEvent(true, false)); scoped_ptr<WaitableEvent> wait_for_syncapi(new WaitableEvent(true, false)); - scoped_refptr<FakeServerUpdater> updater = new FakeServerUpdater( - service_.get(), &wait_for_start, &wait_for_syncapi); + scoped_refptr<FakeServerUpdater> updater(new FakeServerUpdater( + service_.get(), &wait_for_start, &wait_for_syncapi)); // This server side update will stall waiting for CommitWaiter. updater->CreateNewEntry(MakeAutofillEntry("server", "entry", 1)); diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 0224291..c8aa931 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -427,7 +427,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAdd) { history::URLsModifiedDetails details; details.changed_urls.push_back(added_entry); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&history_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(NotificationType::HISTORY_TYPED_URLS_MODIFIED, Details<history::URLsModifiedDetails>(&details)); @@ -460,7 +460,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdate) { history::URLsModifiedDetails details; details.changed_urls.push_back(updated_entry); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&history_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(NotificationType::HISTORY_TYPED_URLS_MODIFIED, Details<history::URLsModifiedDetails>(&details)); @@ -495,7 +495,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemove) { history::URLsDeletedDetails changes; changes.all_history = false; changes.urls.insert(GURL("http://mine.com")); - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&history_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(NotificationType::HISTORY_URLS_DELETED, Details<history::URLsDeletedDetails>(&changes)); @@ -529,7 +529,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemoveAll) { history::URLsDeletedDetails changes; changes.all_history = true; - scoped_refptr<ThreadNotifier> notifier = new ThreadNotifier(&history_thread_); + scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); notifier->Notify(NotificationType::HISTORY_URLS_DELETED, Details<history::URLsDeletedDetails>(&changes)); diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index 56cbdbf..c0b0081 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc @@ -368,7 +368,7 @@ BrowserThemePack* BrowserThemePack::BuildFromExtension( scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack( FilePath path, const std::string& expected_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - scoped_refptr<BrowserThemePack> pack = new BrowserThemePack; + scoped_refptr<BrowserThemePack> pack(new BrowserThemePack); pack->data_pack_.reset(new base::DataPack); if (!pack->data_pack_->Load(path)) { diff --git a/chrome/browser/themes/browser_theme_pack_unittest.cc b/chrome/browser/themes/browser_theme_pack_unittest.cc index 5da6acf..5d4be22 100644 --- a/chrome/browser/themes/browser_theme_pack_unittest.cc +++ b/chrome/browser/themes/browser_theme_pack_unittest.cc @@ -410,8 +410,8 @@ TEST_F(BrowserThemePackTest, CanBuildAndReadPack) { ASSERT_TRUE(extension.get()); ASSERT_EQ("", error); - scoped_refptr<BrowserThemePack> pack = - BrowserThemePack::BuildFromExtension(extension.get()); + scoped_refptr<BrowserThemePack> pack( + BrowserThemePack::BuildFromExtension(extension.get())); ASSERT_TRUE(pack.get()); ASSERT_TRUE(pack->WriteToDisk(file)); VerifyStarGazing(pack.get()); diff --git a/chrome/browser/themes/browser_theme_provider.cc b/chrome/browser/themes/browser_theme_provider.cc index 134d954..ae40eef 100644 --- a/chrome/browser/themes/browser_theme_provider.cc +++ b/chrome/browser/themes/browser_theme_provider.cc @@ -602,8 +602,8 @@ void BrowserThemeProvider::SaveThemeID(const std::string& id) { } void BrowserThemeProvider::BuildFromExtension(const Extension* extension) { - scoped_refptr<BrowserThemePack> pack = - BrowserThemePack::BuildFromExtension(extension); + scoped_refptr<BrowserThemePack> pack( + BrowserThemePack::BuildFromExtension(extension)); if (!pack.get()) { // TODO(erg): We've failed to install the theme; perhaps we should tell the // user? http://crbug.com/34780 diff --git a/chrome/browser/user_style_sheet_watcher_unittest.cc b/chrome/browser/user_style_sheet_watcher_unittest.cc index ad55136..c791cb9 100644 --- a/chrome/browser/user_style_sheet_watcher_unittest.cc +++ b/chrome/browser/user_style_sheet_watcher_unittest.cc @@ -23,8 +23,8 @@ TEST(UserStyleSheetWatcherTest, StyleLoad) { ASSERT_TRUE(file_util::WriteFile(style_sheet_file, css_file_contents.data(), css_file_contents.length())); - scoped_refptr<UserStyleSheetWatcher> style_sheet_watcher = - new UserStyleSheetWatcher(dir.path()); + scoped_refptr<UserStyleSheetWatcher> style_sheet_watcher( + new UserStyleSheetWatcher(dir.path())); MessageLoop loop; BrowserThread ui_thread(BrowserThread::UI, &loop); BrowserThread file_thread(BrowserThread::FILE, &loop); diff --git a/chrome/common/database_util.cc b/chrome/common/database_util.cc index 412debc..ea4e2cc 100644 --- a/chrome/common/database_util.cc +++ b/chrome/common/database_util.cc @@ -18,8 +18,8 @@ WebKitClient::FileHandle DatabaseUtil::databaseOpenFile( IPC::PlatformFileForTransit file_handle = IPC::InvalidPlatformFileForTransit(); - scoped_refptr<IPC::SyncMessageFilter> filter = - ChildThread::current()->sync_message_filter(); + scoped_refptr<IPC::SyncMessageFilter> filter( + ChildThread::current()->sync_message_filter()); filter->Send(new ViewHostMsg_DatabaseOpenFile( vfs_file_name, desired_flags, &file_handle)); @@ -29,8 +29,8 @@ WebKitClient::FileHandle DatabaseUtil::databaseOpenFile( int DatabaseUtil::databaseDeleteFile( const WebString& vfs_file_name, bool sync_dir) { int rv = SQLITE_IOERR_DELETE; - scoped_refptr<IPC::SyncMessageFilter> filter = - ChildThread::current()->sync_message_filter(); + scoped_refptr<IPC::SyncMessageFilter> filter( + ChildThread::current()->sync_message_filter()); filter->Send(new ViewHostMsg_DatabaseDeleteFile( vfs_file_name, sync_dir, &rv)); return rv; @@ -38,16 +38,16 @@ int DatabaseUtil::databaseDeleteFile( long DatabaseUtil::databaseGetFileAttributes(const WebString& vfs_file_name) { int32 rv = -1; - scoped_refptr<IPC::SyncMessageFilter> filter = - ChildThread::current()->sync_message_filter(); + scoped_refptr<IPC::SyncMessageFilter> filter( + ChildThread::current()->sync_message_filter()); filter->Send(new ViewHostMsg_DatabaseGetFileAttributes(vfs_file_name, &rv)); return rv; } long long DatabaseUtil::databaseGetFileSize(const WebString& vfs_file_name) { int64 rv = 0LL; - scoped_refptr<IPC::SyncMessageFilter> filter = - ChildThread::current()->sync_message_filter(); + scoped_refptr<IPC::SyncMessageFilter> filter( + ChildThread::current()->sync_message_filter()); filter->Send(new ViewHostMsg_DatabaseGetFileSize(vfs_file_name, &rv)); return rv; } diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index dc11856..5d87fd0 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -288,7 +288,7 @@ scoped_refptr<Extension> Extension::Create(const FilePath& path, const DictionaryValue& value, bool require_key, std::string* error) { - scoped_refptr<Extension> extension = new Extension(path, location); + scoped_refptr<Extension> extension(new Extension(path, location)); if (!extension->InitFromValue(value, require_key, error)) return NULL; return extension; diff --git a/chrome/common/webmessageportchannel_impl.cc b/chrome/common/webmessageportchannel_impl.cc index 888ab78..b7a9388 100644 --- a/chrome/common/webmessageportchannel_impl.cc +++ b/chrome/common/webmessageportchannel_impl.cc @@ -69,8 +69,8 @@ void WebMessagePortChannelImpl::entangle(WebMessagePortChannel* channel) { // The message port ids might not be set up yet, if this channel wasn't // created on the main thread. So need to wait until we're on the main thread // before getting the other message port id. - scoped_refptr<WebMessagePortChannelImpl> webchannel = - static_cast<WebMessagePortChannelImpl*>(channel); + scoped_refptr<WebMessagePortChannelImpl> webchannel( + static_cast<WebMessagePortChannelImpl*>(channel)); Entangle(webchannel); } diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index a3216c6..aa3b713 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -218,8 +218,8 @@ void PluginChannel::OnControlMessageReceived(const IPC::Message& msg) { void PluginChannel::OnCreateInstance(const std::string& mime_type, int* instance_id) { *instance_id = GenerateRouteID(); - scoped_refptr<WebPluginDelegateStub> stub = new WebPluginDelegateStub( - mime_type, *instance_id, this); + scoped_refptr<WebPluginDelegateStub> stub(new WebPluginDelegateStub( + mime_type, *instance_id, this)); AddRoute(*instance_id, stub, NULL); plugin_stubs_.push_back(stub); } diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 954cf9f..0e169e4 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -97,8 +97,8 @@ PluginThread::PluginThread() ChromePluginLib::Create(plugin_path_, GetCPBrowserFuncsForPlugin()); - scoped_refptr<NPAPI::PluginLib> plugin = - NPAPI::PluginLib::CreatePluginLib(plugin_path_); + scoped_refptr<NPAPI::PluginLib> plugin( + NPAPI::PluginLib::CreatePluginLib(plugin_path_)); if (plugin.get()) { plugin->NP_Initialize(); @@ -150,8 +150,8 @@ void PluginThread::OnControlMessageReceived(const IPC::Message& msg) { void PluginThread::OnCreateChannel(int renderer_id, bool off_the_record) { - scoped_refptr<PluginChannel> channel = PluginChannel::GetPluginChannel( - renderer_id, ChildProcess::current()->io_message_loop()); + scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( + renderer_id, ChildProcess::current()->io_message_loop())); IPC::ChannelHandle channel_handle; if (channel.get()) { channel_handle.name = channel->channel_name(); diff --git a/chrome/renderer/audio_message_filter_unittest.cc b/chrome/renderer/audio_message_filter_unittest.cc index eae1f91..8c6b271 100644 --- a/chrome/renderer/audio_message_filter_unittest.cc +++ b/chrome/renderer/audio_message_filter_unittest.cc @@ -94,7 +94,7 @@ TEST(AudioMessageFilterTest, Basic) { MessageLoop message_loop(MessageLoop::TYPE_IO); const int kRouteId = 0; - scoped_refptr<AudioMessageFilter> filter = new AudioMessageFilter(kRouteId); + scoped_refptr<AudioMessageFilter> filter(new AudioMessageFilter(kRouteId)); MockAudioDelegate delegate; int stream_id = filter->AddDelegate(&delegate); @@ -151,7 +151,7 @@ TEST(AudioMessageFilterTest, Delegates) { MessageLoop message_loop(MessageLoop::TYPE_IO); const int kRouteId = 0; - scoped_refptr<AudioMessageFilter> filter = new AudioMessageFilter(kRouteId); + scoped_refptr<AudioMessageFilter> filter(new AudioMessageFilter(kRouteId)); MockAudioDelegate delegate1; MockAudioDelegate delegate2; diff --git a/chrome/renderer/media/audio_renderer_impl_unittest.cc b/chrome/renderer/media/audio_renderer_impl_unittest.cc index 2c0ee96..6dd3dc7 100644 --- a/chrome/renderer/media/audio_renderer_impl_unittest.cc +++ b/chrome/renderer/media/audio_renderer_impl_unittest.cc @@ -127,7 +127,7 @@ TEST_F(AudioRendererImplTest, Stop) { renderer_->OnVolume(0.5); // It's possible that the upstream decoder replies right after being stopped. - scoped_refptr<media::Buffer> buffer = new media::DataBuffer(kSize); + scoped_refptr<media::Buffer> buffer(new media::DataBuffer(kSize)); renderer_->ConsumeAudioSamples(buffer); } @@ -152,7 +152,7 @@ TEST_F(AudioRendererImplTest, DestroyedMessageLoop_SetVolume) { TEST_F(AudioRendererImplTest, DestroyedMessageLoop_ConsumeAudioSamples) { // Kill the message loop and verify OnReadComplete() still works. message_loop_.reset(); - scoped_refptr<media::Buffer> buffer = new media::DataBuffer(kSize); + scoped_refptr<media::Buffer> buffer(new media::DataBuffer(kSize)); renderer_->ConsumeAudioSamples(buffer); EXPECT_CALL(stop_callback_, OnFilterCallback()); renderer_->Stop(stop_callback_.NewCallback()); diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index eed3618..d24b27b 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -594,8 +594,8 @@ RenderView* RenderView::Create( int64 session_storage_namespace_id, const string16& frame_name) { DCHECK(routing_id != MSG_ROUTING_NONE); - scoped_refptr<RenderView> view = new RenderView(render_thread, webkit_prefs, - session_storage_namespace_id); + scoped_refptr<RenderView> view(new RenderView(render_thread, webkit_prefs, + session_storage_namespace_id)); view->Init(parent_hwnd, opener_id, renderer_prefs, @@ -637,8 +637,8 @@ WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, &info, &setting, &mime_type)); if (!found || !info.enabled) return NULL; - scoped_refptr<pepper::PluginModule> pepper_module = - PepperPluginRegistry::GetInstance()->GetModule(info.path); + scoped_refptr<pepper::PluginModule> pepper_module( + PepperPluginRegistry::GetInstance()->GetModule(info.path)); if (pepper_module) return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); else @@ -2538,8 +2538,8 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, if (info.path.value() == kDefaultPluginLibraryName || setting == CONTENT_SETTING_ALLOW) { - scoped_refptr<pepper::PluginModule> pepper_module = - PepperPluginRegistry::GetInstance()->GetModule(info.path); + scoped_refptr<pepper::PluginModule> pepper_module( + PepperPluginRegistry::GetInstance()->GetModule(info.path)); if (pepper_module) { return CreatePepperPlugin(frame, params, @@ -2658,14 +2658,14 @@ WebMediaPlayer* RenderView::createMediaPlayer( scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; if (cmd_line->HasSwitch(switches::kEnableVideoLayering)) { - scoped_refptr<IPCVideoRenderer> renderer = - new IPCVideoRenderer(routing_id_); + scoped_refptr<IPCVideoRenderer> renderer( + new IPCVideoRenderer(routing_id_)); collection.push_back(renderer); video_renderer = renderer; } else { bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); - scoped_refptr<webkit_glue::VideoRendererImpl> renderer = - new webkit_glue::VideoRendererImpl(pts_logging); + scoped_refptr<webkit_glue::VideoRendererImpl> renderer( + new webkit_glue::VideoRendererImpl(pts_logging)); collection.push_back(renderer); video_renderer = renderer; } diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 8880a03..17c0ee7 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -94,8 +94,8 @@ RenderWidget* RenderWidget::Create(int32 opener_id, RenderThreadBase* render_thread, WebKit::WebPopupType popup_type) { DCHECK(opener_id != MSG_ROUTING_NONE); - scoped_refptr<RenderWidget> widget = new RenderWidget(render_thread, - popup_type); + scoped_refptr<RenderWidget> widget(new RenderWidget(render_thread, + popup_type)); widget->Init(opener_id); // adds reference return widget; } diff --git a/chrome/renderer/render_widget_browsertest.cc b/chrome/renderer/render_widget_browsertest.cc index ab7502c..ae955ad 100644 --- a/chrome/renderer/render_widget_browsertest.cc +++ b/chrome/renderer/render_widget_browsertest.cc @@ -128,7 +128,7 @@ bool RenderWidgetTest::ImageContainsColor(const SkBitmap& bitmap, void RenderWidgetTest::OutputBitmapToFile(const SkBitmap& bitmap, const FilePath& file_path) { - scoped_refptr<RefCountedBytes> bitmap_data = new RefCountedBytes(); + scoped_refptr<RefCountedBytes> bitmap_data(new RefCountedBytes()); SkAutoLockPixels lock(bitmap); ASSERT_TRUE(gfx::JPEGCodec::Encode( reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), diff --git a/chrome/renderer/render_widget_fullscreen.cc b/chrome/renderer/render_widget_fullscreen.cc index ce6f367..5a233f3 100644 --- a/chrome/renderer/render_widget_fullscreen.cc +++ b/chrome/renderer/render_widget_fullscreen.cc @@ -15,8 +15,8 @@ RenderWidgetFullscreen* RenderWidgetFullscreen::Create( int32 opener_id, RenderThreadBase* render_thread, WebKit::WebPopupType popup_type) { DCHECK_NE(MSG_ROUTING_NONE, opener_id); - scoped_refptr<RenderWidgetFullscreen> widget = new RenderWidgetFullscreen( - render_thread, popup_type); + scoped_refptr<RenderWidgetFullscreen> widget(new RenderWidgetFullscreen( + render_thread, popup_type)); widget->Init(opener_id); return widget.release(); } diff --git a/chrome/renderer/render_widget_fullscreen_pepper.cc b/chrome/renderer/render_widget_fullscreen_pepper.cc index 5b1b1f3..8ab647e 100644 --- a/chrome/renderer/render_widget_fullscreen_pepper.cc +++ b/chrome/renderer/render_widget_fullscreen_pepper.cc @@ -162,8 +162,8 @@ RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create( int32 opener_id, RenderThreadBase* render_thread, pepper::PluginInstance* plugin) { DCHECK_NE(MSG_ROUTING_NONE, opener_id); - scoped_refptr<RenderWidgetFullscreenPepper> widget = - new RenderWidgetFullscreenPepper(render_thread, plugin); + scoped_refptr<RenderWidgetFullscreenPepper> widget( + new RenderWidgetFullscreenPepper(render_thread, plugin)); widget->Init(opener_id); return widget.release(); } diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc index 2fb5efc..02ae535 100644 --- a/chrome/renderer/renderer_webkitclient_impl.cc +++ b/chrome/renderer/renderer_webkitclient_impl.cc @@ -181,8 +181,8 @@ bool RendererWebKitClientImpl::SendSyncMessageFromAnyThread( if (render_thread) return render_thread->Send(msg); - scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter = - ChildThread::current()->sync_message_filter(); + scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter( + ChildThread::current()->sync_message_filter()); return sync_msg_filter->Send(msg); } diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 082fc82..0085234 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -114,8 +114,8 @@ WebPluginDelegatePepper* WebPluginDelegatePepper::Create( const FilePath& filename, const std::string& mime_type, const base::WeakPtr<RenderView>& render_view) { - scoped_refptr<NPAPI::PluginLib> plugin_lib = - NPAPI::PluginLib::CreatePluginLib(filename); + scoped_refptr<NPAPI::PluginLib> plugin_lib( + NPAPI::PluginLib::CreatePluginLib(filename)); if (plugin_lib.get() == NULL) return NULL; @@ -123,8 +123,8 @@ WebPluginDelegatePepper* WebPluginDelegatePepper::Create( if (err != NPERR_NO_ERROR) return NULL; - scoped_refptr<NPAPI::PluginInstance> instance = - plugin_lib->CreateInstance(mime_type); + scoped_refptr<NPAPI::PluginInstance> instance( + plugin_lib->CreateInstance(mime_type)); return new WebPluginDelegatePepper(render_view, instance.get()); } diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index d53909c..eff2d29 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -294,9 +294,9 @@ bool WebPluginDelegateProxy::Initialize(const GURL& url, IPC::AddChannelSocket(channel_handle.name, channel_handle.socket.fd); #endif - scoped_refptr<PluginChannelHost> channel_host = + scoped_refptr<PluginChannelHost> channel_host( PluginChannelHost::GetPluginChannelHost( - channel_handle.name, ChildProcess::current()->io_message_loop()); + channel_handle.name, ChildProcess::current()->io_message_loop())); if (!channel_host.get()) return false; diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc index 99158d3..3b950d2 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc @@ -277,17 +277,17 @@ void CloudPrintProxyBackend::Core::DoInitializeWithLsid( // the CloudPrintProxyCoreThread and we cannot really do anything else until // the GAIA signin is successful. std::string user_agent = "ChromiumBrowser"; - scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_talk = + scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_talk( new ServiceGaiaAuthenticator( user_agent, kSyncGaiaServiceId, kGaiaUrl, - g_service_process->io_thread()->message_loop_proxy()); + g_service_process->io_thread()->message_loop_proxy())); gaia_auth_for_talk->set_message_loop(MessageLoop::current()); bool auth_succeeded = false; if (gaia_auth_for_talk->AuthenticateWithLsid(lsid)) { - scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_print = + scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_print( new ServiceGaiaAuthenticator( user_agent, kCloudPrintGaiaServiceId, kGaiaUrl, - g_service_process->io_thread()->message_loop_proxy()); + g_service_process->io_thread()->message_loop_proxy())); gaia_auth_for_print->set_message_loop(MessageLoop::current()); if (gaia_auth_for_print->AuthenticateWithLsid(lsid)) { auth_succeeded = true; diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc index f351c5c..a1c7768 100644 --- a/chrome/service/cloud_print/printer_job_handler.cc +++ b/chrome/service/cloud_print/printer_job_handler.cc @@ -417,10 +417,10 @@ PrinterJobHandler::HandleSuccessStatusUpdateResponse( << printer_info_cloud_.printer_id; // The print job has been spooled locally. We now need to create an object // that monitors the status of the job and updates the server. - scoped_refptr<JobStatusUpdater> job_status_updater = + scoped_refptr<JobStatusUpdater> job_status_updater( new JobStatusUpdater(printer_info_.printer_name, job_details_.job_id_, local_job_id_, auth_token_, cloud_print_server_url_, - print_system_.get(), this); + print_system_.get(), this)); job_status_updater_list_.push_back(job_status_updater); MessageLoop::current()->PostTask( FROM_HERE, NewRunnableMethod(job_status_updater.get(), diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc index 1755002..cd188cd 100644 --- a/chrome/worker/worker_webkitclient_impl.cc +++ b/chrome/worker/worker_webkitclient_impl.cc @@ -48,8 +48,8 @@ static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) { if (worker_thread) return worker_thread->Send(msg); - scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter = - ChildThread::current()->sync_message_filter(); + scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter( + ChildThread::current()->sync_message_filter()); return sync_msg_filter->Send(msg); } |