diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 10:36:11 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 10:36:11 +0000 |
commit | 198b590bb15422d06a14f59700c72f2fa71b1314 (patch) | |
tree | df70ac39d5a72ee95a89b8dfc2aa679dcb254f30 | |
parent | 4fbcb6bf01014e8508e7e2258055ed1750bd5aa0 (diff) | |
download | chromium_src-198b590bb15422d06a14f59700c72f2fa71b1314.zip chromium_src-198b590bb15422d06a14f59700c72f2fa71b1314.tar.gz chromium_src-198b590bb15422d06a14f59700c72f2fa71b1314.tar.bz2 |
Update Linux to use scoped_refptr<T>::get() rather than implicit "operator T*"
Fixes a number of cases either not caught by the automated tool or that have
recently regressed.
BUG=206189
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/17948002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208882 0039d316-1c4b-4281-b951-d872f2087c98
87 files changed, 321 insertions, 282 deletions
diff --git a/apps/shortcut_manager.cc b/apps/shortcut_manager.cc index 5fafdb6..a3629d4 100644 --- a/apps/shortcut_manager.cc +++ b/apps/shortcut_manager.cc @@ -143,9 +143,9 @@ void ShortcutManager::OnceOffCreateShortcuts() { const ExtensionSet* apps = extension_service->extensions(); for (ExtensionSet::const_iterator it = apps->begin(); it != apps->end(); ++it) { - if (ShouldCreateShortcutFor(*it)) + if (ShouldCreateShortcutFor(it->get())) web_app::UpdateShortcutInfoAndIconForApp( - *(*it), profile_, base::Bind(&CreateShortcutsInApplicationsMenu)); + *it->get(), profile_, base::Bind(&CreateShortcutsInApplicationsMenu)); } } diff --git a/base/memory/ref_counted_delete_on_message_loop.h b/base/memory/ref_counted_delete_on_message_loop.h index 4527f16..7b898ac 100644 --- a/base/memory/ref_counted_delete_on_message_loop.h +++ b/base/memory/ref_counted_delete_on_message_loop.h @@ -35,7 +35,7 @@ class RefCountedDeleteOnMessageLoop : public subtle::RefCountedThreadSafeBase { public: RefCountedDeleteOnMessageLoop( const scoped_refptr<MessageLoopProxy>& proxy) : proxy_(proxy) { - DCHECK(proxy_); + DCHECK(proxy_.get()); } void AddRef() const { diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h index cbc42ce..6be2a01 100644 --- a/cc/layers/texture_layer.h +++ b/cc/layers/texture_layer.h @@ -94,7 +94,7 @@ class CC_EXPORT TextureLayer : public Layer { public: explicit MainThreadReference(MailboxHolder* holder); ~MainThreadReference(); - MailboxHolder* holder() { return holder_; } + MailboxHolder* holder() { return holder_.get(); } private: scoped_refptr<MailboxHolder> holder_; diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc index 14a2536..bbdb532 100644 --- a/cc/resources/pixel_buffer_raster_worker_pool.cc +++ b/cc/resources/pixel_buffer_raster_worker_pool.cc @@ -229,7 +229,7 @@ void PixelBufferRasterWorkerPool::CheckForCompletedUploads() { TaskDeque tasks_with_uploads_to_force; TaskDeque::iterator it = tasks_with_pending_upload_.begin(); while (it != tasks_with_pending_upload_.end()) { - internal::RasterWorkerPoolTask* task = *it; + internal::RasterWorkerPoolTask* task = it->get(); DCHECK(pixel_buffer_tasks_.find(task) != pixel_buffer_tasks_.end()); // Force all uploads required for activation to complete. @@ -339,7 +339,7 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() { if (new_bytes_pending_upload > kMaxPendingUploadBytes) break; - internal::WorkerPoolTask* pixel_buffer_task = pixel_buffer_it->second; + internal::WorkerPoolTask* pixel_buffer_task = pixel_buffer_it->second.get(); // If raster has finished, just update |bytes_pending_upload|. if (pixel_buffer_task && pixel_buffer_task->HasCompleted()) { diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc index 84a8e8a..340f37e 100644 --- a/cc/resources/raster_worker_pool.cc +++ b/cc/resources/raster_worker_pool.cc @@ -495,7 +495,7 @@ void RasterWorkerPool::SetRasterTaskGraph(RasterTaskGraph* graph) { scoped_refptr<internal::WorkerPoolTask> new_raster_finished_task( new RasterFinishedWorkerPoolTaskImpl( - base::MessageLoopProxy::current(), + base::MessageLoopProxy::current().get(), base::Bind(&RasterWorkerPool::OnRasterFinished, weak_ptr_factory_.GetWeakPtr(), schedule_raster_tasks_count_))); diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index b7abd10..8a5b8ef 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc @@ -217,7 +217,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { ASSERT_TRUE(current_texture_); ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); ASSERT_FALSE(level); - ASSERT_TRUE(textures_[current_texture_]); + ASSERT_TRUE(textures_[current_texture_].get()); ASSERT_EQ(textures_[current_texture_]->format, format); ASSERT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type); ASSERT_TRUE(pixels); @@ -229,7 +229,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { ASSERT_TRUE(current_texture_); ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); scoped_refptr<Texture> texture = textures_[current_texture_]; - ASSERT_TRUE(texture); + ASSERT_TRUE(texture.get()); if (param != GL_TEXTURE_MIN_FILTER) return; texture->filter = value; @@ -264,7 +264,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { void GetPixels(gfx::Size size, WGC3Denum format, uint8_t* pixels) { ASSERT_TRUE(current_texture_); scoped_refptr<Texture> texture = textures_[current_texture_]; - ASSERT_TRUE(texture); + ASSERT_TRUE(texture.get()); ASSERT_EQ(texture->size, size); ASSERT_EQ(texture->format, format); memcpy(pixels, texture->data.get(), TextureSize(size, format)); @@ -273,7 +273,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { WGC3Denum GetTextureFilter() { DCHECK(current_texture_); scoped_refptr<Texture> texture = textures_[current_texture_]; - DCHECK(texture); + DCHECK(texture.get()); return texture->filter; } @@ -291,7 +291,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { void AllocateTexture(gfx::Size size, WGC3Denum format) { ASSERT_TRUE(current_texture_); scoped_refptr<Texture> texture = textures_[current_texture_]; - ASSERT_TRUE(texture); + ASSERT_TRUE(texture.get()); texture->Reallocate(size, format); } @@ -302,7 +302,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { const void* pixels) { ASSERT_TRUE(current_texture_); scoped_refptr<Texture> texture = textures_[current_texture_]; - ASSERT_TRUE(texture); + ASSERT_TRUE(texture.get()); ASSERT_TRUE(texture->data.get()); ASSERT_TRUE(xoffset >= 0 && xoffset + width <= texture->size.width()); ASSERT_TRUE(yoffset >= 0 && yoffset + height <= texture->size.height()); diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index df47b3d..1d4a797 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -393,7 +393,7 @@ void LayerTreeTest::PostSetVisibleToMainThread(bool visible) { void LayerTreeTest::DoBeginTest() { client_ = LayerTreeHostClientForTesting::Create(this); - DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy()); + DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); layer_tree_host_ = LayerTreeHostForTesting::Create( this, client_.get(), diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index e86aaf5..3d97f15 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -107,7 +107,7 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, bool LayerTreeHost::Initialize( scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { - if (impl_task_runner) + if (impl_task_runner.get()) return InitializeProxy(ThreadProxy::Create(this, impl_task_runner)); else return InitializeProxy(SingleThreadProxy::Create(this)); diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index 58272df..94f15c2 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -1586,7 +1586,7 @@ class LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface if (threaded) { impl_thread.reset(new base::Thread("LayerTreeTest")); ASSERT_TRUE(impl_thread->Start()); - ASSERT_TRUE(impl_thread->message_loop_proxy()); + ASSERT_TRUE(impl_thread->message_loop_proxy().get()); } LayerTreeSettings settings; diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index f4cf091..8582d8f 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc @@ -734,11 +734,9 @@ TEST(LayerTreeHostFlingTest, DidStopFlingingThread) { impl_thread.message_loop_proxy().get(), &received_stop_flinging); FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D); - ASSERT_TRUE(impl_thread.message_loop_proxy()); - scoped_ptr<LayerTreeHost> layer_tree_host = - LayerTreeHost::Create(&client, - settings, - impl_thread.message_loop_proxy()); + ASSERT_TRUE(impl_thread.message_loop_proxy().get()); + scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::Create( + &client, settings, impl_thread.message_loop_proxy()); impl_thread.message_loop_proxy() ->PostTask(FROM_HERE, diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index 049bd7c..0e9e87f 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -855,9 +855,8 @@ TEST_F(HistoryURLProviderTest, SuggestExactInput) { AutocompleteInput input(ASCIIToUTF16(test_cases[i].input), string16::npos, string16(), GURL("about:blank"), false, false, true, AutocompleteInput::ALL_MATCHES); - AutocompleteMatch match = - HistoryURLProvider::SuggestExactInput(autocomplete_, input, - test_cases[i].trim_http); + AutocompleteMatch match = HistoryURLProvider::SuggestExactInput( + autocomplete_.get(), input, test_cases[i].trim_http); EXPECT_EQ(ASCIIToUTF16(test_cases[i].contents), match.contents); for (size_t match_index = 0; match_index < match.contents_class.size(); ++match_index) { diff --git a/chrome/browser/background/background_application_list_model.cc b/chrome/browser/background/background_application_list_model.cc index f16a3a6..c5d2538 100644 --- a/chrome/browser/background/background_application_list_model.cc +++ b/chrome/browser/background/background_application_list_model.cc @@ -43,7 +43,8 @@ using extensions::UpdatedExtensionPermissionsInfo; class ExtensionNameComparator { public: explicit ExtensionNameComparator(icu::Collator* collator); - bool operator()(const Extension* x, const Extension* y); + bool operator()(const scoped_refptr<const Extension>& x, + const scoped_refptr<const Extension>& y); private: icu::Collator* collator_; @@ -53,11 +54,11 @@ ExtensionNameComparator::ExtensionNameComparator(icu::Collator* collator) : collator_(collator) { } -bool ExtensionNameComparator::operator()(const Extension* x, - const Extension* y) { +bool ExtensionNameComparator::operator()( + const scoped_refptr<const Extension>& x, + const scoped_refptr<const Extension>& y) { return l10n_util::StringComparator<string16>(collator_)( - UTF8ToUTF16(x->name()), - UTF8ToUTF16(y->name())); + UTF8ToUTF16(x->name()), UTF8ToUTF16(y->name())); } // Background application representation, private to the diff --git a/chrome/browser/drive/drive_uploader.cc b/chrome/browser/drive/drive_uploader.cc index 45db431..0d4866a 100644 --- a/chrome/browser/drive/drive_uploader.cc +++ b/chrome/browser/drive/drive_uploader.cc @@ -200,9 +200,10 @@ CancelCallback DriveUploader::StartUploadFile( UploadFileInfo* info_ptr = upload_file_info.get(); base::PostTaskAndReplyWithResult( - blocking_task_runner_, + blocking_task_runner_.get(), FROM_HERE, - base::Bind(&file_util::GetFileSize, info_ptr->file_path, + base::Bind(&file_util::GetFileSize, + info_ptr->file_path, &info_ptr->content_length), base::Bind(&DriveUploader::StartUploadFileAfterGetFileSize, weak_ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/drive/drive_uploader_unittest.cc b/chrome/browser/drive/drive_uploader_unittest.cc index d01d20f..1cb4b83 100644 --- a/chrome/browser/drive/drive_uploader_unittest.cc +++ b/chrome/browser/drive/drive_uploader_unittest.cc @@ -314,7 +314,8 @@ TEST_F(DriveUploaderTest, UploadExisting0KB) { scoped_ptr<ResourceEntry> resource_entry; MockDriveServiceWithUploadExpectation mock_service(local_path, data.size()); - DriveUploader uploader(&mock_service, base::MessageLoopProxy::current()); + DriveUploader uploader(&mock_service, + base::MessageLoopProxy::current().get()); std::vector<test_util::ProgressInfo> upload_progress_values; uploader.UploadExistingFile( kTestInitiateUploadResourceId, @@ -348,7 +349,8 @@ TEST_F(DriveUploaderTest, UploadExisting512KB) { scoped_ptr<ResourceEntry> resource_entry; MockDriveServiceWithUploadExpectation mock_service(local_path, data.size()); - DriveUploader uploader(&mock_service, base::MessageLoopProxy::current()); + DriveUploader uploader(&mock_service, + base::MessageLoopProxy::current().get()); std::vector<test_util::ProgressInfo> upload_progress_values; uploader.UploadExistingFile( kTestInitiateUploadResourceId, @@ -384,15 +386,15 @@ TEST_F(DriveUploaderTest, InitiateUploadFail) { scoped_ptr<ResourceEntry> resource_entry; MockDriveServiceNoConnectionAtInitiate mock_service; - DriveUploader uploader(&mock_service, base::MessageLoopProxy::current()); - uploader.UploadExistingFile( - kTestInitiateUploadResourceId, - local_path, - kTestMimeType, - std::string(), // etag - test_util::CreateCopyResultCallback( - &error, &upload_location, &resource_entry), - google_apis::ProgressCallback()); + DriveUploader uploader(&mock_service, + base::MessageLoopProxy::current().get()); + uploader.UploadExistingFile(kTestInitiateUploadResourceId, + local_path, + kTestMimeType, + std::string(), // etag + test_util::CreateCopyResultCallback( + &error, &upload_location, &resource_entry), + google_apis::ProgressCallback()); base::RunLoop().RunUntilIdle(); EXPECT_EQ(GDATA_NO_CONNECTION, error); @@ -411,15 +413,15 @@ TEST_F(DriveUploaderTest, InitiateUploadNoConflict) { scoped_ptr<ResourceEntry> resource_entry; MockDriveServiceWithUploadExpectation mock_service(local_path, data.size()); - DriveUploader uploader(&mock_service, base::MessageLoopProxy::current()); - uploader.UploadExistingFile( - kTestInitiateUploadResourceId, - local_path, - kTestMimeType, - kTestETag, - test_util::CreateCopyResultCallback( - &error, &upload_location, &resource_entry), - google_apis::ProgressCallback()); + DriveUploader uploader(&mock_service, + base::MessageLoopProxy::current().get()); + uploader.UploadExistingFile(kTestInitiateUploadResourceId, + local_path, + kTestMimeType, + kTestETag, + test_util::CreateCopyResultCallback( + &error, &upload_location, &resource_entry), + google_apis::ProgressCallback()); base::RunLoop().RunUntilIdle(); EXPECT_EQ(HTTP_SUCCESS, error); @@ -438,15 +440,15 @@ TEST_F(DriveUploaderTest, InitiateUploadConflict) { scoped_ptr<ResourceEntry> resource_entry; MockDriveServiceWithUploadExpectation mock_service(local_path, data.size()); - DriveUploader uploader(&mock_service, base::MessageLoopProxy::current()); - uploader.UploadExistingFile( - kTestInitiateUploadResourceId, - local_path, - kTestMimeType, - kDestinationETag, - test_util::CreateCopyResultCallback( - &error, &upload_location, &resource_entry), - google_apis::ProgressCallback()); + DriveUploader uploader(&mock_service, + base::MessageLoopProxy::current().get()); + uploader.UploadExistingFile(kTestInitiateUploadResourceId, + local_path, + kTestMimeType, + kDestinationETag, + test_util::CreateCopyResultCallback( + &error, &upload_location, &resource_entry), + google_apis::ProgressCallback()); base::RunLoop().RunUntilIdle(); EXPECT_EQ(HTTP_CONFLICT, error); @@ -464,15 +466,15 @@ TEST_F(DriveUploaderTest, ResumeUploadFail) { scoped_ptr<ResourceEntry> resource_entry; MockDriveServiceNoConnectionAtResume mock_service; - DriveUploader uploader(&mock_service, base::MessageLoopProxy::current()); - uploader.UploadExistingFile( - kTestInitiateUploadResourceId, - local_path, - kTestMimeType, - std::string(), // etag - test_util::CreateCopyResultCallback( - &error, &upload_location, &resource_entry), - google_apis::ProgressCallback()); + DriveUploader uploader(&mock_service, + base::MessageLoopProxy::current().get()); + uploader.UploadExistingFile(kTestInitiateUploadResourceId, + local_path, + kTestMimeType, + std::string(), // etag + test_util::CreateCopyResultCallback( + &error, &upload_location, &resource_entry), + google_apis::ProgressCallback()); base::RunLoop().RunUntilIdle(); EXPECT_EQ(GDATA_NO_CONNECTION, error); @@ -485,12 +487,12 @@ TEST_F(DriveUploaderTest, NonExistingSourceFile) { scoped_ptr<ResourceEntry> resource_entry; DriveUploader uploader(NULL, // NULL, the service won't be used. - base::MessageLoopProxy::current()); + base::MessageLoopProxy::current().get()); uploader.UploadExistingFile( kTestInitiateUploadResourceId, temp_dir_.path().AppendASCII("_this_path_should_not_exist_"), kTestMimeType, - std::string(), // etag + std::string(), // etag test_util::CreateCopyResultCallback( &error, &upload_location, &resource_entry), google_apis::ProgressCallback()); @@ -512,7 +514,8 @@ TEST_F(DriveUploaderTest, ResumeUpload) { scoped_ptr<ResourceEntry> resource_entry; MockDriveServiceWithUploadExpectation mock_service(local_path, data.size()); - DriveUploader uploader(&mock_service, base::MessageLoopProxy::current()); + DriveUploader uploader(&mock_service, + base::MessageLoopProxy::current().get()); // Emulate the situation that the only first part is successfully uploaded, // but not the latter half. mock_service.set_received_bytes(512 * 1024); diff --git a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc index 2f3de4a..19db206 100644 --- a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc +++ b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc @@ -97,7 +97,7 @@ TEST_F(FullStreamUIPolicyTest, Construct) { .Set("version", "1.0.0") .Set("manifest_version", 2)) .Build(); - extension_service_->AddExtension(extension); + extension_service_->AddExtension(extension.get()); scoped_ptr<base::ListValue> args(new base::ListValue()); policy->ProcessAction(ActivityLogPolicy::ACTION_API, extension->id(), std::string("tabs.testMethod"), GURL(), args.get(), NULL); @@ -112,7 +112,7 @@ TEST_F(FullStreamUIPolicyTest, LogAndFetchActions) { .Set("version", "1.0.0") .Set("manifest_version", 2)) .Build(); - extension_service_->AddExtension(extension); + extension_service_->AddExtension(extension.get()); scoped_ptr<base::ListValue> args(new base::ListValue()); GURL gurl("http://www.google.com"); @@ -135,7 +135,7 @@ TEST_F(FullStreamUIPolicyTest, LogWithArguments) { .Set("version", "1.0.0") .Set("manifest_version", 2)) .Build(); - extension_service_->AddExtension(extension); + extension_service_->AddExtension(extension.get()); scoped_ptr<base::ListValue> args(new base::ListValue()); args->Set(0, new base::StringValue("hello")); args->Set(1, new base::StringValue("world")); diff --git a/chrome/browser/extensions/activity_log/stream_noargs_ui_policy_unittest.cc b/chrome/browser/extensions/activity_log/stream_noargs_ui_policy_unittest.cc index 29f45c3..df279d1d 100644 --- a/chrome/browser/extensions/activity_log/stream_noargs_ui_policy_unittest.cc +++ b/chrome/browser/extensions/activity_log/stream_noargs_ui_policy_unittest.cc @@ -98,7 +98,7 @@ TEST_F(StreamWithoutArgsUIPolicyTest, Construct) { .Set("version", "1.0.0") .Set("manifest_version", 2)) .Build(); - extension_service_->AddExtension(extension); + extension_service_->AddExtension(extension.get()); scoped_ptr<base::ListValue> args(new base::ListValue()); policy->ProcessAction(ActivityLogPolicy::ACTION_API, extension->id(), std::string("tabs.testMethod"), GURL(), args.get(), NULL); @@ -114,7 +114,7 @@ TEST_F(StreamWithoutArgsUIPolicyTest, LogAndFetchActions) { .Set("version", "1.0.0") .Set("manifest_version", 2)) .Build(); - extension_service_->AddExtension(extension); + extension_service_->AddExtension(extension.get()); scoped_ptr<base::ListValue> args(new base::ListValue()); GURL gurl("http://www.google.com"); @@ -139,7 +139,7 @@ TEST_F(StreamWithoutArgsUIPolicyTest, LogWithoutArguments) { .Set("version", "1.0.0") .Set("manifest_version", 2)) .Build(); - extension_service_->AddExtension(extension); + extension_service_->AddExtension(extension.get()); scoped_ptr<base::ListValue> args(new base::ListValue()); args->Set(0, new base::StringValue("hello")); args->Set(1, new base::StringValue("world")); diff --git a/chrome/browser/extensions/api/storage/settings_apitest.cc b/chrome/browser/extensions/api/storage/settings_apitest.cc index a1b2c6d..45e3386 100644 --- a/chrome/browser/extensions/api/storage/settings_apitest.cc +++ b/chrome/browser/extensions/api/storage/settings_apitest.cc @@ -454,7 +454,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, PolicyDomainDescriptor) { policy::PolicyService* service = connector->policy_service(); scoped_refptr<const policy::PolicyDomainDescriptor> descriptor = service->GetPolicyDomainDescriptor(policy::POLICY_DOMAIN_EXTENSIONS); - EXPECT_TRUE(descriptor); + EXPECT_TRUE(descriptor.get()); } IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, ManagedStorage) { diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 8448b6a..a3e7a66 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -835,7 +835,7 @@ bool ExtensionService::UninstallExtension( delayed_installs_.Remove(extension_id); - PruneSharedModulesOnUninstall(extension); + PruneSharedModulesOnUninstall(extension.get()); // Track the uninstallation. UMA_HISTOGRAM_ENUMERATION("Extensions.ExtensionUninstalled", 1, 2); @@ -959,12 +959,12 @@ void ExtensionService::DisableUserExtensions() { for (ExtensionSet::const_iterator extension = extensions_.begin(); extension != extensions_.end(); ++extension) { - if (management_policy->UserMayModifySettings(*extension, NULL)) + if (management_policy->UserMayModifySettings(extension->get(), NULL)) to_disable.push_back(*extension); } for (ExtensionSet::const_iterator extension = terminated_extensions_.begin(); extension != terminated_extensions_.end(); ++extension) { - if (management_policy->UserMayModifySettings(*extension, NULL)) + if (management_policy->UserMayModifySettings(extension->get(), NULL)) to_disable.push_back(*extension); } @@ -2261,7 +2261,8 @@ scoped_ptr<const ExtensionSet> set_to_check->InsertAll(extensions_); for (ExtensionSet::const_iterator iter = set_to_check->begin(); iter != set_to_check->end(); ++iter) { - if (SharedModuleInfo::ImportsExtensionById(*iter, extension->id())) { + if (SharedModuleInfo::ImportsExtensionById(iter->get(), + extension->id())) { dependents->Insert(*iter); } } diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 8a9c03e..7765a85 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -158,7 +158,8 @@ const char* const unpacked = "cbcdidchbppangcjoddlpdjlenngjldk"; const char* const updates_from_webstore = "akjooamlhcgeopfifcmlggaebeocgokj"; struct ExtensionsOrder { - bool operator()(const Extension* a, const Extension* b) { + bool operator()(const scoped_refptr<const Extension>& a, + const scoped_refptr<const Extension>& b) { return a->name() < b->name(); } }; @@ -4008,7 +4009,7 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { BrowserContext::GetDefaultStoragePartition(profile_.get())-> GetIndexedDBContext(); idb_context->SetTaskRunnerForTesting( - base::MessageLoop::current()->message_loop_proxy()); + base::MessageLoop::current()->message_loop_proxy().get()); base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id); EXPECT_TRUE(file_util::CreateDirectory(idb_path)); EXPECT_TRUE(file_util::DirectoryExists(idb_path)); @@ -4125,7 +4126,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { BrowserContext::GetDefaultStoragePartition(profile_.get())-> GetIndexedDBContext(); idb_context->SetTaskRunnerForTesting( - base::MessageLoop::current()->message_loop_proxy()); + base::MessageLoop::current()->message_loop_proxy().get()); base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id); EXPECT_TRUE(file_util::CreateDirectory(idb_path)); EXPECT_TRUE(file_util::DirectoryExists(idb_path)); diff --git a/chrome/browser/nacl_host/nacl_file_host.cc b/chrome/browser/nacl_host/nacl_file_host.cc index 651c305..1acca3a 100644 --- a/chrome/browser/nacl_host/nacl_file_host.cc +++ b/chrome/browser/nacl_host/nacl_file_host.cc @@ -69,7 +69,7 @@ void PnaclCheckDone( bool success) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!success) { - NotifyRendererOfError(nacl_host_message_filter, reply_msg); + NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); } else { if (!BrowserThread::PostBlockingPoolTask( FROM_HERE, @@ -77,7 +77,7 @@ void PnaclCheckDone( nacl_host_message_filter, filename, reply_msg))) { - NotifyRendererOfError(nacl_host_message_filter, reply_msg); + NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); } } } diff --git a/chrome/browser/plugins/chrome_plugin_service_filter.cc b/chrome/browser/plugins/chrome_plugin_service_filter.cc index ac639b7..853018e 100644 --- a/chrome/browser/plugins/chrome_plugin_service_filter.cc +++ b/chrome/browser/plugins/chrome_plugin_service_filter.cc @@ -59,8 +59,7 @@ void ChromePluginServiceFilter::RestrictPluginToProfileAndOrigin( const GURL& origin) { base::AutoLock auto_lock(lock_); restricted_plugins_[plugin_path] = - std::make_pair(PluginPrefs::GetForProfile(profile), - origin); + std::make_pair(PluginPrefs::GetForProfile(profile).get(), origin); } void ChromePluginServiceFilter::UnrestrictPlugin( diff --git a/chrome/browser/policy/policy_service_impl_unittest.cc b/chrome/browser/policy/policy_service_impl_unittest.cc index 68026ca..f5efb78 100644 --- a/chrome/browser/policy/policy_service_impl_unittest.cc +++ b/chrome/browser/policy/policy_service_impl_unittest.cc @@ -630,10 +630,10 @@ TEST_F(PolicyServiceTest, IsInitializationComplete) { } TEST_F(PolicyServiceTest, RegisterPolicyDomain) { - EXPECT_FALSE( - policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_CHROME)); - EXPECT_FALSE( - policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_EXTENSIONS)); + EXPECT_FALSE(policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_CHROME) + .get()); + EXPECT_FALSE(policy_service_->GetPolicyDomainDescriptor( + POLICY_DOMAIN_EXTENSIONS).get()); EXPECT_CALL(provider1_, RegisterPolicyDomain(_)).Times(AnyNumber()); EXPECT_CALL(provider2_, RegisterPolicyDomain(_)).Times(AnyNumber()); @@ -644,9 +644,10 @@ TEST_F(PolicyServiceTest, RegisterPolicyDomain) { policy_service_->RegisterPolicyDomain(chrome_descriptor); Mock::VerifyAndClearExpectations(&provider0_); - EXPECT_TRUE(policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_CHROME)); - EXPECT_FALSE( - policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_EXTENSIONS)); + EXPECT_TRUE(policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_CHROME) + .get()); + EXPECT_FALSE(policy_service_->GetPolicyDomainDescriptor( + POLICY_DOMAIN_EXTENSIONS).get()); // Register another namespace. std::string error; @@ -672,9 +673,10 @@ TEST_F(PolicyServiceTest, RegisterPolicyDomain) { policy_service_->RegisterPolicyDomain(extensions_descriptor); Mock::VerifyAndClearExpectations(&provider0_); - EXPECT_TRUE(policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_CHROME)); - EXPECT_TRUE( - policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_EXTENSIONS)); + EXPECT_TRUE(policy_service_->GetPolicyDomainDescriptor(POLICY_DOMAIN_CHROME) + .get()); + EXPECT_TRUE(policy_service_->GetPolicyDomainDescriptor( + POLICY_DOMAIN_EXTENSIONS).get()); // Remove those components. scoped_refptr<PolicyDomainDescriptor> empty_extensions_descriptor = diff --git a/chrome/browser/profile_resetter/profile_resetter_browsertest.cc b/chrome/browser/profile_resetter/profile_resetter_browsertest.cc index 23e0fc9..f8e0144 100644 --- a/chrome/browser/profile_resetter/profile_resetter_browsertest.cc +++ b/chrome/browser/profile_resetter/profile_resetter_browsertest.cc @@ -137,7 +137,7 @@ void RemoveCookieTester::SetCookieCallback(bool result) { } void RemoveCookieTester::BlockUntilNotified() { - DCHECK(!runner_); + DCHECK(!runner_.get()); if (waiting_callback_) { runner_ = new content::MessageLoopRunner; runner_->Run(); @@ -148,7 +148,7 @@ void RemoveCookieTester::BlockUntilNotified() { void RemoveCookieTester::Notify() { DCHECK(waiting_callback_); waiting_callback_ = false; - if (runner_) + if (runner_.get()) runner_->Quit(); } diff --git a/chrome/browser/safe_browsing/download_feedback.cc b/chrome/browser/safe_browsing/download_feedback.cc index fef426a..6748d2db 100644 --- a/chrome/browser/safe_browsing/download_feedback.cc +++ b/chrome/browser/safe_browsing/download_feedback.cc @@ -108,7 +108,9 @@ DownloadFeedbackImpl::~DownloadFeedbackImpl() { uploader_.reset(); } - base::FileUtilProxy::Delete(file_task_runner_, file_path_, false, + base::FileUtilProxy::Delete(file_task_runner_.get(), + file_path_, + false, base::FileUtilProxy::StatusCallback()); } @@ -135,15 +137,16 @@ void DownloadFeedbackImpl::Start(const base::Closure& finish_callback) { std::string metadata_string; bool ok = report_metadata.SerializeToString(&metadata_string); DCHECK(ok); - uploader_.reset(TwoPhaseUploader::Create( - request_context_getter_, - file_task_runner_, - url, - metadata_string, - file_path_, - TwoPhaseUploader::ProgressCallback(), - base::Bind(&DownloadFeedbackImpl::FinishedUpload, base::Unretained(this), - finish_callback))); + uploader_.reset( + TwoPhaseUploader::Create(request_context_getter_.get(), + file_task_runner_.get(), + url, + metadata_string, + file_path_, + TwoPhaseUploader::ProgressCallback(), + base::Bind(&DownloadFeedbackImpl::FinishedUpload, + base::Unretained(this), + finish_callback))); uploader_->Start(); } diff --git a/chrome/browser/safe_browsing/download_feedback_service.cc b/chrome/browser/safe_browsing/download_feedback_service.cc index 3e5b378..8c189aa 100644 --- a/chrome/browser/safe_browsing/download_feedback_service.cc +++ b/chrome/browser/safe_browsing/download_feedback_service.cc @@ -177,7 +177,9 @@ void DownloadFeedbackService::BeginFeedbackOrDeleteFile( if (service) { service->BeginFeedback(ping_request, ping_response, path); } else { - base::FileUtilProxy::Delete(file_task_runner, path, false, + base::FileUtilProxy::Delete(file_task_runner.get(), + path, + false, base::FileUtilProxy::StatusCallback()); } } @@ -193,9 +195,12 @@ void DownloadFeedbackService::BeginFeedback( const std::string& ping_response, const base::FilePath& path) { DCHECK(CalledOnValidThread()); - DownloadFeedback* feedback = DownloadFeedback::Create( - request_context_getter_, file_task_runner_, path, - ping_request, ping_response); + DownloadFeedback* feedback = + DownloadFeedback::Create(request_context_getter_.get(), + file_task_runner_.get(), + path, + ping_request, + ping_response); active_feedback_.push_back(feedback); UMA_HISTOGRAM_COUNTS_100("SBDownloadFeedback.ActiveFeedbacks", active_feedback_.size()); diff --git a/chrome/browser/safe_browsing/download_feedback_service_unittest.cc b/chrome/browser/safe_browsing/download_feedback_service_unittest.cc index 8f0a874..a912a3f 100644 --- a/chrome/browser/safe_browsing/download_feedback_service_unittest.cc +++ b/chrome/browser/safe_browsing/download_feedback_service_unittest.cc @@ -208,7 +208,8 @@ TEST_F(DownloadFeedbackServiceTest, SingleFeedbackComplete) { EXPECT_CALL(item, StealDangerousDownload(_)) .WillOnce(SaveArg<0>(&download_discarded_callback)); - DownloadFeedbackService service(request_context_getter_, file_task_runner_); + DownloadFeedbackService service(request_context_getter_.get(), + file_task_runner_.get()); service.MaybeStorePingsForDownload( DownloadProtectionService::UNCOMMON, &item, ping_request, ping_response); ASSERT_TRUE(DownloadFeedbackService::IsEnabledForDownload(item)); @@ -255,7 +256,8 @@ TEST_F(DownloadFeedbackServiceTest, MultiplePendingFeedbackComplete) { } { - DownloadFeedbackService service(request_context_getter_, file_task_runner_); + DownloadFeedbackService service(request_context_getter_.get(), + file_task_runner_.get()); for (size_t i = 0; i < num_downloads; ++i) { SCOPED_TRACE(i); service.BeginFeedbackForDownload(&item[i]); @@ -323,7 +325,8 @@ TEST_F(DownloadFeedbackServiceTest, MultiFeedbackWithIncomplete) { } { - DownloadFeedbackService service(request_context_getter_, file_task_runner_); + DownloadFeedbackService service(request_context_getter_.get(), + file_task_runner_.get()); for (size_t i = 0; i < num_downloads; ++i) { SCOPED_TRACE(i); service.BeginFeedbackForDownload(&item[i]); diff --git a/chrome/browser/safe_browsing/download_feedback_unittest.cc b/chrome/browser/safe_browsing/download_feedback_unittest.cc index 4a83868..0054a69 100644 --- a/chrome/browser/safe_browsing/download_feedback_unittest.cc +++ b/chrome/browser/safe_browsing/download_feedback_unittest.cc @@ -169,12 +169,12 @@ TEST_F(DownloadFeedbackTest, CompleteUpload) { CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kSbDownloadFeedbackURL, kTestFeedbackURL); - DownloadFeedback* feedback = DownloadFeedback::Create( - url_request_context_getter_, - file_task_runner_, - upload_file_path_, - ping_request, - ping_response); + DownloadFeedback* feedback = + DownloadFeedback::Create(url_request_context_getter_.get(), + file_task_runner_.get(), + upload_file_path_, + ping_request, + ping_response); EXPECT_FALSE(uploader()); feedback->Start(base::Bind(&DownloadFeedbackTest::FinishCallback, @@ -216,12 +216,12 @@ TEST_F(DownloadFeedbackTest, CancelUpload) { std::string ping_response( expected_report_metadata.download_response().SerializeAsString()); - DownloadFeedback* feedback = DownloadFeedback::Create( - url_request_context_getter_, - file_task_runner_, - upload_file_path_, - ping_request, - ping_response); + DownloadFeedback* feedback = + DownloadFeedback::Create(url_request_context_getter_.get(), + file_task_runner_.get(), + upload_file_path_, + ping_request, + ping_response); EXPECT_FALSE(uploader()); feedback->Start(base::Bind(&DownloadFeedbackTest::FinishCallback, diff --git a/chrome/browser/ssl/ssl_client_certificate_selector_test.cc b/chrome/browser/ssl/ssl_client_certificate_selector_test.cc index 8ac9321..da8e463 100644 --- a/chrome/browser/ssl/ssl_client_certificate_selector_test.cc +++ b/chrome/browser/ssl/ssl_client_certificate_selector_test.cc @@ -81,8 +81,7 @@ void SSLClientCertificateSelectorTestBase::SetUpOnIOThread() { url_request_ = MakeURLRequest(url_request_context_getter_.get()); auth_requestor_ = new StrictMock<SSLClientAuthRequestorMock>( - url_request_, - cert_request_info_); + url_request_, cert_request_info_.get()); io_loop_finished_event_.Signal(); } 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 0c52801..0568122 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 @@ -146,14 +146,13 @@ class DriveFileSyncServiceSyncTest : public testing::Test { "chromeos/gdata/root_feed.json")); drive_uploader_ = new ::drive::DriveUploader( - fake_drive_service_, base::MessageLoopProxy::current()); + fake_drive_service_, base::MessageLoopProxy::current().get()); bool done = false; SyncStatusCode status = SYNC_STATUS_UNKNOWN; bool created = false; - scoped_ptr<DriveMetadataStore> metadata_store( - new DriveMetadataStore(base_dir_.path(), - base::MessageLoopProxy::current())); + scoped_ptr<DriveMetadataStore> metadata_store(new DriveMetadataStore( + base_dir_.path(), base::MessageLoopProxy::current().get())); metadata_store->Initialize( base::Bind(&DatabaseInitResultCallback, &done, &status, &created)); FlushMessageLoop(); @@ -200,8 +199,9 @@ class DriveFileSyncServiceSyncTest : public testing::Test { if (!ContainsKey(file_systems_, origin)) { CannedSyncableFileSystem* file_system = new CannedSyncableFileSystem( origin, - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) + .get()); bool done = false; SyncStatusCode status = SYNC_STATUS_UNKNOWN; diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc index 6a97f84..f77cc8b 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc @@ -114,8 +114,8 @@ std::string NetErrorToString(int net_error) { // Struct to bind the Equals member function to an object for use in find_if. struct CertEquals { explicit CertEquals(const net::X509Certificate* cert) : cert_(cert) {} - bool operator()(const net::X509Certificate* cert) const { - return cert_->Equals(cert); + bool operator()(const scoped_refptr<net::X509Certificate> cert) const { + return cert_->Equals(cert.get()); } const net::X509Certificate* cert_; }; diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc index e1283c7..5a99ec7 100644 --- a/chrome/browser/ui/webui/policy_ui.cc +++ b/chrome/browser/ui/webui/policy_ui.cc @@ -565,7 +565,7 @@ void PolicyUIHandler::SendPolicyNames() const { for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - const extensions::Extension* extension = *it; + const extensions::Extension* extension = it->get(); // Skip this extension if it's not an enterprise extension. if (!extension->manifest()->HasPath( extension_manifest_keys::kStorageManagedSchema)) @@ -612,7 +612,7 @@ void PolicyUIHandler::SendPolicyValues() const { for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - const extensions::Extension* extension = *it; + const extensions::Extension* extension = it->get(); // Skip this extension if it's not an enterprise extension. if (!extension->manifest()->HasPath( extension_manifest_keys::kStorageManagedSchema)) diff --git a/chrome/common/extensions/sync_type_unittest.cc b/chrome/common/extensions/sync_type_unittest.cc index f4c03f6..c6f5958 100644 --- a/chrome/common/extensions/sync_type_unittest.cc +++ b/chrome/common/extensions/sync_type_unittest.cc @@ -266,7 +266,7 @@ TEST_F(ExtensionSyncTypeTest, ExtensionWithPluginPermission) { 0, base::FilePath(), Extension::NO_FLAGS, true)); if (extension.get()) - EXPECT_FALSE(sync_helper::IsSyncableExtension(extension)); + EXPECT_FALSE(sync_helper::IsSyncableExtension(extension.get())); } #endif // !defined(OS_CHROMEOS) diff --git a/chrome/service/cloud_print/printer_job_handler_unittest.cc b/chrome/service/cloud_print/printer_job_handler_unittest.cc index 854e7aa..3efe21c 100644 --- a/chrome/service/cloud_print/printer_job_handler_unittest.cc +++ b/chrome/service/cloud_print/printer_job_handler_unittest.cc @@ -635,14 +635,13 @@ MockPrintSystem::MockPrintSystem() : job_spooler_(new NiceMock<MockJobSpooler>()), printer_watcher_(new NiceMock<MockPrinterWatcher>()), print_server_watcher_(new NiceMock<MockPrintServerWatcher>()) { - ON_CALL(*this, CreateJobSpooler()) - .WillByDefault(Return(job_spooler_)); + ON_CALL(*this, CreateJobSpooler()).WillByDefault(Return(job_spooler_.get())); ON_CALL(*this, CreatePrinterWatcher(_)) - .WillByDefault(Return(printer_watcher_)); + .WillByDefault(Return(printer_watcher_.get())); ON_CALL(*this, CreatePrintServerWatcher()) - .WillByDefault(Return(print_server_watcher_)); + .WillByDefault(Return(print_server_watcher_.get())); ON_CALL(*this, IsValidPrinter(_)). WillByDefault(Return(true)); diff --git a/components/webdata/common/web_database_service.cc b/components/webdata/common/web_database_service.cc index 0bd508b..cd20427 100644 --- a/components/webdata/common/web_database_service.cc +++ b/components/webdata/common/web_database_service.cc @@ -49,7 +49,7 @@ WebDatabaseService::WebDatabaseService( // WebDatabaseService should be instantiated on UI thread. DCHECK(ui_thread->BelongsToCurrentThread()); // WebDatabaseService requires DB thread if instantiated. - DCHECK(db_thread); + DCHECK(db_thread.get()); } WebDatabaseService::~WebDatabaseService() { diff --git a/content/browser/fileapi/fileapi_message_filter_unittest.cc b/content/browser/fileapi/fileapi_message_filter_unittest.cc index 98d8949..0a9c8fc 100644 --- a/content/browser/fileapi/fileapi_message_filter_unittest.cc +++ b/content/browser/fileapi/fileapi_message_filter_unittest.cc @@ -67,7 +67,7 @@ TEST_F(FileAPIMessageFilterTest, BuildEmptyBlob) { // channel proxy. Since OnMessageReceived is hidden on FileAPIMessageFilter, // cast it. IPC::ChannelProxy::MessageFilter* casted_filter = - static_cast<IPC::ChannelProxy::MessageFilter*>(filter); + static_cast<IPC::ChannelProxy::MessageFilter*>(filter.get()); BlobHostMsg_StartBuildingBlob start_message(kUrl); EXPECT_TRUE(casted_filter->OnMessageReceived(start_message)); diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc index c2683be..68bbfb0 100644 --- a/content/browser/indexed_db/indexed_db_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_browsertest.cc @@ -112,7 +112,7 @@ class IndexedDBBrowserTest : public ContentBrowserTest { base::Bind(&IndexedDBBrowserTest::DidGetDiskUsage, this)); scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( BrowserMainLoop::GetInstance()->indexed_db_thread() - ->message_loop_proxy())); + ->message_loop_proxy().get())); EXPECT_TRUE(helper->Run()); // Wait for DidGetDiskUsage to be called. base::MessageLoop::current()->RunUntilIdle(); @@ -258,7 +258,7 @@ class IndexedDBBrowserTestWithPreexistingLevelDB : public IndexedDBBrowserTest { &CopyLevelDBToProfile, shell(), context, EnclosingLevelDBDir())); scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( BrowserMainLoop::GetInstance()->indexed_db_thread() - ->message_loop_proxy())); + ->message_loop_proxy().get())); ASSERT_TRUE(helper->Run()); } diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc index 0873ff9..9ec3951 100644 --- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc +++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc @@ -47,15 +47,15 @@ class IndexedDBQuotaClientTest : public testing::Test { new quota::MockQuotaManager( false /*in_memory*/, browser_context_->GetPath(), - base::MessageLoop::current()->message_loop_proxy(), - base::MessageLoop::current()->message_loop_proxy(), + base::MessageLoop::current()->message_loop_proxy().get(), + base::MessageLoop::current()->message_loop_proxy().get(), browser_context_->GetSpecialStoragePolicy()); idb_context_ = new IndexedDBContextImpl(browser_context_->GetPath(), browser_context_->GetSpecialStoragePolicy(), quota_manager->proxy(), - task_runner_); + task_runner_.get()); base::MessageLoop::current()->RunUntilIdle(); setup_temp_dir(); } diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index 7ee9253..c0904e5 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc @@ -62,9 +62,9 @@ TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { { scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl(temp_dir.path(), - special_storage_policy_, + special_storage_policy_.get(), NULL, - task_runner_); + task_runner_.get()); normal_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kNormalOrigin)); @@ -96,9 +96,9 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) { // With the levelDB backend, these are directories. scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl(temp_dir.path(), - special_storage_policy_, + special_storage_policy_.get(), NULL, - task_runner_); + task_runner_.get()); // Save session state. This should bypass the destruction-time deletion. idb_context->SetForceKeepSessionState(); @@ -155,9 +155,9 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl(temp_dir.path(), - special_storage_policy_, + special_storage_policy_.get(), NULL, - task_runner_); + task_runner_.get()); test_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kTestOrigin)); diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index 62a3517..5752d88 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc @@ -148,7 +148,7 @@ MediaStreamManager::MediaStreamManager(media::AudioManager* audio_manager) MediaStreamManager::~MediaStreamManager() { DCHECK(requests_.empty()); - DCHECK(!device_loop_); + DCHECK(!device_loop_.get()); DCHECK(!io_loop_); } @@ -585,15 +585,15 @@ void MediaStreamManager::HandleRequest(const std::string& label) { void MediaStreamManager::InitializeDeviceManagersOnIOThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - if (device_loop_) + if (device_loop_.get()) return; device_loop_ = audio_manager_->GetMessageLoop(); audio_input_device_manager_ = new AudioInputDeviceManager(audio_manager_); - audio_input_device_manager_->Register(this, device_loop_); + audio_input_device_manager_->Register(this, device_loop_.get()); video_capture_manager_ = new VideoCaptureManager(); - video_capture_manager_->Register(this, device_loop_); + video_capture_manager_->Register(this, device_loop_.get()); // We want to be notified of IO message loop destruction to delete the thread // and the device managers. @@ -937,7 +937,7 @@ void MediaStreamManager::UseFakeUI(scoped_ptr<FakeMediaStreamUIProxy> fake_ui) { void MediaStreamManager::WillDestroyCurrentMessageLoop() { DCHECK_EQ(base::MessageLoop::current(), io_loop_); DCHECK(requests_.empty()); - if (device_loop_) { + if (device_loop_.get()) { StopMonitoring(); video_capture_manager_->Unregister(); diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc index 253475c..f1249d5 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc @@ -191,7 +191,7 @@ void P2PSocketDispatcherHost::OnCreateSocket( } scoped_ptr<P2PSocketHost> socket( - P2PSocketHost::Create(this, socket_id, type, url_context_)); + P2PSocketHost::Create(this, socket_id, type, url_context_.get())); if (!socket) { Send(new P2PMsg_OnError(socket_id)); diff --git a/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc b/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc index edae57e..877428e 100644 --- a/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc +++ b/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.cc @@ -43,11 +43,15 @@ int32_t PepperExternalFileRefBackend::Touch( PP_Time last_access_time, PP_Time last_modified_time) { IPC::Message reply_msg = PpapiPluginMsg_FileRef_TouchReply(); - base::FileUtilProxy::Touch(task_runner_, path_, + base::FileUtilProxy::Touch( + task_runner_.get(), + path_, ppapi::PPTimeToTime(last_access_time), ppapi::PPTimeToTime(last_modified_time), base::Bind(&PepperExternalFileRefBackend::DidFinish, - weak_factory_.GetWeakPtr(), reply_context, reply_msg)); + weak_factory_.GetWeakPtr(), + reply_context, + reply_msg)); return PP_OK_COMPLETIONPENDING; } @@ -66,9 +70,12 @@ int32_t PepperExternalFileRefBackend::Rename( int32_t PepperExternalFileRefBackend::Query( ppapi::host::ReplyMessageContext reply_context) { - bool ok = base::FileUtilProxy::GetFileInfo(task_runner_, path_, + bool ok = base::FileUtilProxy::GetFileInfo( + task_runner_.get(), + path_, base::Bind(&PepperExternalFileRefBackend::GetMetadataComplete, - weak_factory_.GetWeakPtr(), reply_context)); + weak_factory_.GetWeakPtr(), + reply_context)); DCHECK(ok); return PP_OK_COMPLETIONPENDING; } diff --git a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc index 96180cb..4189741 100644 --- a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc +++ b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc @@ -66,7 +66,7 @@ PepperFileSystemBrowserHost::PepperFileSystemBrowserHost(BrowserPpapiHost* host, } PepperFileSystemBrowserHost::~PepperFileSystemBrowserHost() { - if (fs_context_) + if (fs_context_.get()) fs_context_->operation_runner()->Shutdown(); } @@ -137,9 +137,9 @@ void PepperFileSystemBrowserHost::GotFileSystemContext( ppapi::host::ReplyMessageContext reply_context, fileapi::FileSystemType file_system_type, scoped_refptr<fileapi::FileSystemContext> fs_context) { - if (!fs_context) { - OpenFileSystemComplete(reply_context, base::PLATFORM_FILE_ERROR_FAILED, - std::string(), GURL()); + if (!fs_context.get()) { + OpenFileSystemComplete( + reply_context, base::PLATFORM_FILE_ERROR_FAILED, std::string(), GURL()); return; } GURL origin = browser_ppapi_host_->GetDocumentURLForInstance( diff --git a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc index 17c7cf6..0526347 100644 --- a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc +++ b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc @@ -245,7 +245,7 @@ int32_t PepperInternalFileRefBackend::GetAbsolutePath( int32_t PepperInternalFileRefBackend::HasPermissions(int permissions) const { base::PlatformFileError error; - CheckFileSystemPermissionsForProcess(GetFileSystemContext(), + CheckFileSystemPermissionsForProcess(GetFileSystemContext().get(), render_process_id_, GetFileSystemURL(), permissions, diff --git a/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc b/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc index 8ea4241..6042bad 100644 --- a/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc +++ b/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc @@ -93,7 +93,7 @@ PepperNetworkProxyHost::GetUIThreadDataOnUIThread(int render_process_id, void PepperNetworkProxyHost::DidGetUIThreadData( const UIThreadData& ui_thread_data) { is_allowed_ = ui_thread_data.is_allowed; - if (ui_thread_data.context_getter && + if (ui_thread_data.context_getter.get() && ui_thread_data.context_getter->GetURLRequestContext()) { proxy_service_ = ui_thread_data.context_getter->GetURLRequestContext()->proxy_service(); diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc index aefeda3..333d0e2 100644 --- a/content/browser/speech/speech_recognizer_impl.cc +++ b/content/browser/speech/speech_recognizer_impl.cc @@ -568,7 +568,7 @@ SpeechRecognizerImpl::StartRecording(const FSMEventArgs&) { audio_controller_ = AudioInputController::Create( audio_manager, this, input_parameters, device_id_); - if (!audio_controller_) { + if (!audio_controller_.get()) { return Abort(SpeechRecognitionError(SPEECH_RECOGNITION_ERROR_AUDIO)); } diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index ec838a2..8b3000e 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc @@ -231,8 +231,8 @@ StoragePartitionImpl* StoragePartitionImpl::Create( base::SequencedTaskRunner* idb_task_runner = BrowserThread::CurrentlyOn(BrowserThread::UI) && BrowserMainLoop::GetInstance() - ? BrowserMainLoop::GetInstance()->indexed_db_thread()-> - message_loop_proxy() + ? BrowserMainLoop::GetInstance()->indexed_db_thread() + ->message_loop_proxy().get() : NULL; scoped_refptr<IndexedDBContextImpl> indexed_db_context = new IndexedDBContextImpl(path, diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index a8e2c33..3d38520 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -469,7 +469,7 @@ void WorkerProcessHost::RelayMessage( } void WorkerProcessHost::ShutdownSocketStreamDispatcherHostIfNecessary() { - if (!instances_.size() && socket_stream_dispatcher_host_) { + if (!instances_.size() && socket_stream_dispatcher_host_.get()) { // We can assume that this object is going to delete, because // currently a WorkerInstance will never be added to a WorkerProcessHost // once it is initialized. diff --git a/content/child/webmessageportchannel_impl.cc b/content/child/webmessageportchannel_impl.cc index d082434..ade0d00 100644 --- a/content/child/webmessageportchannel_impl.cc +++ b/content/child/webmessageportchannel_impl.cc @@ -211,8 +211,9 @@ void WebMessagePortChannelImpl::OnMessage( if (!sent_message_port_ids.empty()) { msg.ports.resize(sent_message_port_ids.size()); for (size_t i = 0; i < sent_message_port_ids.size(); ++i) { - msg.ports[i] = new WebMessagePortChannelImpl( - new_routing_ids[i], sent_message_port_ids[i], child_thread_loop_); + msg.ports[i] = new WebMessagePortChannelImpl(new_routing_ids[i], + sent_message_port_ids[i], + child_thread_loop_.get()); } } diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc index 5fbd112..d2ca141 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.cc +++ b/content/renderer/media/mock_media_stream_dependency_factory.cc @@ -445,7 +445,7 @@ MockMediaStreamDependencyFactory::CreateLocalVideoTrack( new talk_base::RefCountedObject<MockVideoSource>(); source->SetVideoCapturer(capturer); - return new talk_base::RefCountedObject<MockLocalVideoTrack>(id, source); + return new talk_base::RefCountedObject<MockLocalVideoTrack>(id, source.get()); } scoped_refptr<webrtc::AudioTrackInterface> diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index a9247c6..6eb2e8f 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -306,7 +306,7 @@ bool RendererWebKitPlatformSupportImpl::isLinkVisited( WebKit::WebMessagePortChannel* RendererWebKitPlatformSupportImpl::createMessagePortChannel() { - return new WebMessagePortChannelImpl(child_thread_loop_); + return new WebMessagePortChannelImpl(child_thread_loop_.get()); } void RendererWebKitPlatformSupportImpl::prefetchHostName( @@ -679,31 +679,31 @@ Platform::FileHandle RendererWebKitPlatformSupportImpl::databaseOpenFile( const WebString& vfs_file_name, int desired_flags) { return DatabaseUtil::DatabaseOpenFile( - vfs_file_name, desired_flags, sync_message_filter_); + vfs_file_name, desired_flags, sync_message_filter_.get()); } int RendererWebKitPlatformSupportImpl::databaseDeleteFile( const WebString& vfs_file_name, bool sync_dir) { return DatabaseUtil::DatabaseDeleteFile( - vfs_file_name, sync_dir, sync_message_filter_); + vfs_file_name, sync_dir, sync_message_filter_.get()); } long RendererWebKitPlatformSupportImpl::databaseGetFileAttributes( const WebString& vfs_file_name) { - return DatabaseUtil::DatabaseGetFileAttributes( - vfs_file_name, sync_message_filter_); + return DatabaseUtil::DatabaseGetFileAttributes(vfs_file_name, + sync_message_filter_.get()); } long long RendererWebKitPlatformSupportImpl::databaseGetFileSize( const WebString& vfs_file_name) { - return DatabaseUtil::DatabaseGetFileSize( - vfs_file_name, sync_message_filter_); + return DatabaseUtil::DatabaseGetFileSize(vfs_file_name, + sync_message_filter_.get()); } long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( const WebString& origin_identifier) { - return DatabaseUtil::DatabaseGetSpaceAvailable( - origin_identifier, sync_message_filter_); + return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier, + sync_message_filter_.get()); } WebKit::WebSharedWorkerRepository* diff --git a/content/worker/websharedworker_stub.cc b/content/worker/websharedworker_stub.cc index 5e23d1a..745b63c 100644 --- a/content/worker/websharedworker_stub.cc +++ b/content/worker/websharedworker_stub.cc @@ -107,8 +107,10 @@ void WebSharedWorkerStub::OnStartWorkerContext( void WebSharedWorkerStub::OnConnect(int sent_message_port_id, int routing_id) { if (started_) { - WebKit::WebMessagePortChannel* channel = new WebMessagePortChannelImpl( - routing_id, sent_message_port_id, base::MessageLoopProxy::current()); + WebKit::WebMessagePortChannel* channel = + new WebMessagePortChannelImpl(routing_id, + sent_message_port_id, + base::MessageLoopProxy::current().get()); impl_->connect(channel, NULL); } else { // If two documents try to load a SharedWorker at the same time, the diff --git a/content/worker/worker_webkitplatformsupport_impl.cc b/content/worker/worker_webkitplatformsupport_impl.cc index 730d4c8..5580890 100644 --- a/content/worker/worker_webkitplatformsupport_impl.cc +++ b/content/worker/worker_webkitplatformsupport_impl.cc @@ -133,7 +133,7 @@ bool WorkerWebKitPlatformSupportImpl::isLinkVisited( WebMessagePortChannel* WorkerWebKitPlatformSupportImpl::createMessagePortChannel() { - return new WebMessagePortChannelImpl(child_thread_loop_); + return new WebMessagePortChannelImpl(child_thread_loop_.get()); } void WorkerWebKitPlatformSupportImpl::setCookies( @@ -176,31 +176,31 @@ Platform::FileHandle WorkerWebKitPlatformSupportImpl::databaseOpenFile( const WebString& vfs_file_name, int desired_flags) { return DatabaseUtil::DatabaseOpenFile( - vfs_file_name, desired_flags, sync_message_filter_); + vfs_file_name, desired_flags, sync_message_filter_.get()); } int WorkerWebKitPlatformSupportImpl::databaseDeleteFile( const WebString& vfs_file_name, bool sync_dir) { return DatabaseUtil::DatabaseDeleteFile( - vfs_file_name, sync_dir, sync_message_filter_); + vfs_file_name, sync_dir, sync_message_filter_.get()); } long WorkerWebKitPlatformSupportImpl::databaseGetFileAttributes( const WebString& vfs_file_name) { - return DatabaseUtil::DatabaseGetFileAttributes( - vfs_file_name, sync_message_filter_); + return DatabaseUtil::DatabaseGetFileAttributes(vfs_file_name, + sync_message_filter_.get()); } long long WorkerWebKitPlatformSupportImpl::databaseGetFileSize( const WebString& vfs_file_name) { - return DatabaseUtil::DatabaseGetFileSize( - vfs_file_name, sync_message_filter_); + return DatabaseUtil::DatabaseGetFileSize(vfs_file_name, + sync_message_filter_.get()); } long long WorkerWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( const WebString& origin_identifier) { - return DatabaseUtil::DatabaseGetSpaceAvailable( - origin_identifier, sync_message_filter_); + return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier, + sync_message_filter_.get()); } WebKit::WebIDBFactory* WorkerWebKitPlatformSupportImpl::idbFactory() { diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc index 5a19311..bb301a4 100644 --- a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc +++ b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc @@ -216,7 +216,8 @@ class TransferStateInternal : texture_id_(texture_id), define_params_(define_params) {} bool TransferIsInProgress() { - return pending_upload_task_ && pending_upload_task_->TaskIsInProgress(); + return pending_upload_task_.get() && + pending_upload_task_->TaskIsInProgress(); } void BindTransfer() { @@ -231,7 +232,7 @@ class TransferStateInternal void WaitForTransferCompletion() { TRACE_EVENT0("gpu", "WaitForTransferCompletion"); - DCHECK(pending_upload_task_); + DCHECK(pending_upload_task_.get()); if (!pending_upload_task_->TryRun()) { pending_upload_task_->WaitForTask(); } @@ -240,7 +241,7 @@ class TransferStateInternal void CancelUpload() { TRACE_EVENT0("gpu", "CancelUpload"); - if (pending_upload_task_) + if (pending_upload_task_.get()) pending_upload_task_->Cancel(); pending_upload_task_ = NULL; } diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc index c9cda11..cd1cb2a 100644 --- a/gpu/command_buffer/service/buffer_manager.cc +++ b/gpu/command_buffer/service/buffer_manager.cc @@ -50,7 +50,7 @@ void BufferManager::CreateBuffer(GLuint client_id, GLuint service_id) { Buffer* BufferManager::GetBuffer( GLuint client_id) { BufferMap::iterator it = buffers_.find(client_id); - return it != buffers_.end() ? it->second : NULL; + return it != buffers_.end() ? it->second.get() : NULL; } void BufferManager::RemoveBuffer(GLuint client_id) { diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc index 732bb7b..9a0276e 100644 --- a/gpu/command_buffer/service/framebuffer_manager.cc +++ b/gpu/command_buffer/service/framebuffer_manager.cc @@ -515,7 +515,7 @@ void Framebuffer::UnbindTexture( Framebuffer* FramebufferManager::GetFramebuffer( GLuint client_id) { FramebufferMap::iterator it = framebuffers_.find(client_id); - return it != framebuffers_.end() ? it->second : NULL; + return it != framebuffers_.end() ? it->second.get() : NULL; } void FramebufferManager::RemoveFramebuffer(GLuint client_id) { diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc index 55cb39d..64d647a 100644 --- a/gpu/command_buffer/service/program_manager.cc +++ b/gpu/command_buffer/service/program_manager.cc @@ -1150,7 +1150,7 @@ Program* ProgramManager::CreateProgram( Program* ProgramManager::GetProgram(GLuint client_id) { ProgramMap::iterator it = programs_.find(client_id); - return it != programs_.end() ? it->second : NULL; + return it != programs_.end() ? it->second.get() : NULL; } bool ProgramManager::GetClientId(GLuint service_id, GLuint* client_id) const { diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc index 8d85cff..5b06630 100644 --- a/gpu/command_buffer/service/query_manager.cc +++ b/gpu/command_buffer/service/query_manager.cc @@ -366,7 +366,7 @@ QueryManager::Query* QueryManager::CreateQuery( QueryManager::Query* QueryManager::GetQuery( GLuint client_id) { QueryMap::iterator it = queries_.find(client_id); - return it != queries_.end() ? it->second : NULL; + return it != queries_.end() ? it->second.get() : NULL; } void QueryManager::RemoveQuery(GLuint client_id) { diff --git a/gpu/command_buffer/service/renderbuffer_manager.cc b/gpu/command_buffer/service/renderbuffer_manager.cc index a2b766d..0190c44 100644 --- a/gpu/command_buffer/service/renderbuffer_manager.cc +++ b/gpu/command_buffer/service/renderbuffer_manager.cc @@ -137,7 +137,7 @@ void RenderbufferManager::CreateRenderbuffer( Renderbuffer* RenderbufferManager::GetRenderbuffer( GLuint client_id) { RenderbufferMap::iterator it = renderbuffers_.find(client_id); - return it != renderbuffers_.end() ? it->second : NULL; + return it != renderbuffers_.end() ? it->second.get() : NULL; } void RenderbufferManager::RemoveRenderbuffer(GLuint client_id) { diff --git a/gpu/command_buffer/service/shader_manager.cc b/gpu/command_buffer/service/shader_manager.cc index b3ea27e..590b3a2 100644 --- a/gpu/command_buffer/service/shader_manager.cc +++ b/gpu/command_buffer/service/shader_manager.cc @@ -117,7 +117,7 @@ Shader* ShaderManager::CreateShader( Shader* ShaderManager::GetShader(GLuint client_id) { ShaderMap::iterator it = shaders_.find(client_id); - return it != shaders_.end() ? it->second : NULL; + return it != shaders_.end() ? it->second.get() : NULL; } bool ShaderManager::GetClientId(GLuint service_id, GLuint* client_id) const { diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc index 73b9184..117e951 100644 --- a/gpu/command_buffer/service/texture_manager.cc +++ b/gpu/command_buffer/service/texture_manager.cc @@ -1101,7 +1101,7 @@ TextureRef* TextureManager::CreateTexture( TextureRef* TextureManager::GetTexture( GLuint client_id) const { TextureMap::const_iterator it = textures_.find(client_id); - return it != textures_.end() ? it->second : NULL; + return it != textures_.end() ? it->second.get() : NULL; } void TextureManager::RemoveTexture(GLuint client_id) { diff --git a/gpu/command_buffer/service/vertex_array_manager.cc b/gpu/command_buffer/service/vertex_array_manager.cc index 3b94fa7..9747519 100644 --- a/gpu/command_buffer/service/vertex_array_manager.cc +++ b/gpu/command_buffer/service/vertex_array_manager.cc @@ -41,7 +41,7 @@ void VertexArrayManager::CreateVertexAttribManager( VertexAttribManager* VertexArrayManager::GetVertexAttribManager( GLuint client_id) { VertexAttribManagerMap::iterator it = vertex_attrib_managers_.find(client_id); - return it != vertex_attrib_managers_.end() ? it->second : NULL; + return it != vertex_attrib_managers_.end() ? it->second.get() : NULL; } void VertexArrayManager::RemoveVertexAttribManager(GLuint client_id) { diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc index 6f93433..4647465 100644 --- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc +++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc @@ -42,7 +42,7 @@ class MockGpuMemoryBufferTest : public testing::Test { GLManager::Options options; image_manager_ = new ImageManager; image_factory_.reset( - new StrictMock<ImageFactoryMock>(image_manager_)); + new StrictMock<ImageFactoryMock>(image_manager_.get())); options.image_manager = image_manager_.get(); options.image_factory = image_factory_.get(); diff --git a/net/cert/nss_cert_database.cc b/net/cert/nss_cert_database.cc index 0845dd41..8e9ef4e 100644 --- a/net/cert/nss_cert_database.cc +++ b/net/cert/nss_cert_database.cc @@ -35,9 +35,9 @@ namespace psm = mozilla_security_manager; namespace net { NSSCertDatabase::ImportCertFailure::ImportCertFailure( - X509Certificate* cert, int err) - : certificate(cert), - net_error(err) {} + const scoped_refptr<X509Certificate>& cert, + int err) + : certificate(cert), net_error(err) {} NSSCertDatabase::ImportCertFailure::~ImportCertFailure() {} diff --git a/net/cert/nss_cert_database.h b/net/cert/nss_cert_database.h index b958148..9db1b75 100644 --- a/net/cert/nss_cert_database.h +++ b/net/cert/nss_cert_database.h @@ -54,7 +54,7 @@ class NET_EXPORT NSSCertDatabase { // Stores per-certificate error codes for import failures. struct NET_EXPORT ImportCertFailure { public: - ImportCertFailure(X509Certificate* cert, int err); + ImportCertFailure(const scoped_refptr<X509Certificate>& cert, int err); ~ImportCertFailure(); scoped_refptr<X509Certificate> certificate; diff --git a/net/cert/test_root_certs_unittest.cc b/net/cert/test_root_certs_unittest.cc index b83fe25..74c3551 100644 --- a/net/cert/test_root_certs_unittest.cc +++ b/net/cert/test_root_certs_unittest.cc @@ -33,13 +33,13 @@ const char kGoodCertificateFile[] = "ok_cert.pem"; TEST(TestRootCertsTest, AddFromPointer) { scoped_refptr<X509Certificate> root_cert = ImportCertFromFile(GetTestCertsDirectory(), kRootCertificateFile); - ASSERT_NE(static_cast<X509Certificate*>(NULL), root_cert); + ASSERT_NE(static_cast<X509Certificate*>(NULL), root_cert.get()); TestRootCerts* test_roots = TestRootCerts::GetInstance(); ASSERT_NE(static_cast<TestRootCerts*>(NULL), test_roots); EXPECT_TRUE(test_roots->IsEmpty()); - EXPECT_TRUE(test_roots->Add(root_cert)); + EXPECT_TRUE(test_roots->Add(root_cert.get())); EXPECT_FALSE(test_roots->IsEmpty()); test_roots->Clear(); @@ -82,14 +82,14 @@ TEST(TestRootCertsTest, OverrideTrust) { scoped_refptr<X509Certificate> test_cert = ImportCertFromFile(GetTestCertsDirectory(), kGoodCertificateFile); - ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); + ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert.get()); // Test that the good certificate fails verification, because the root // certificate should not yet be trusted. int flags = 0; CertVerifyResult bad_verify_result; scoped_refptr<CertVerifyProc> verify_proc(CertVerifyProc::CreateDefault()); - int bad_status = verify_proc->Verify(test_cert, + int bad_status = verify_proc->Verify(test_cert.get(), "127.0.0.1", flags, NULL, @@ -106,7 +106,7 @@ TEST(TestRootCertsTest, OverrideTrust) { // Test that the certificate verification now succeeds, because the // TestRootCerts is successfully imbuing trust. CertVerifyResult good_verify_result; - int good_status = verify_proc->Verify(test_cert, + int good_status = verify_proc->Verify(test_cert.get(), "127.0.0.1", flags, NULL, @@ -122,7 +122,7 @@ TEST(TestRootCertsTest, OverrideTrust) { // revert to their original state, and don't linger. If trust status // lingers, it will likely break other tests in net_unittests. CertVerifyResult restored_verify_result; - int restored_status = verify_proc->Verify(test_cert, + int restored_status = verify_proc->Verify(test_cert.get(), "127.0.0.1", flags, NULL, diff --git a/net/cert/x509_certificate.cc b/net/cert/x509_certificate.cc index 942078b..93bdd6c 100644 --- a/net/cert/x509_certificate.cc +++ b/net/cert/x509_certificate.cc @@ -218,8 +218,9 @@ void SplitOnChar(const base::StringPiece& src, } // namespace -bool X509Certificate::LessThan::operator()(X509Certificate* lhs, - X509Certificate* rhs) const { +bool X509Certificate::LessThan::operator()( + const scoped_refptr<X509Certificate>& lhs, + const scoped_refptr<X509Certificate>& rhs) const { if (lhs == rhs) return false; diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h index d12c0ba..efaa2f7 100644 --- a/net/cert/x509_certificate.h +++ b/net/cert/x509_certificate.h @@ -81,7 +81,8 @@ class NET_EXPORT X509Certificate // Predicate functor used in maps when X509Certificate is used as the key. class NET_EXPORT LessThan { public: - bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; + bool operator()(const scoped_refptr<X509Certificate>& lhs, + const scoped_refptr<X509Certificate>& rhs) const; }; enum Format { diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index 0b5bf82..8732212 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -450,7 +450,7 @@ bool BlockFiles::OpenBlockFile(int index) { return false; } - BlockHeader header(file); + BlockHeader header(file.get()); if (kBlockMagic != header->magic || kBlockVersion2 != header->version) { LOG(ERROR) << "Invalid file version or magic " << name.value(); return false; diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc index 2fd425a..4dd9319 100644 --- a/net/disk_cache/simple/simple_backend_impl.cc +++ b/net/disk_cache/simple/simple_backend_impl.cc @@ -184,10 +184,11 @@ int SimpleBackendImpl::Init(const CompletionCallback& completion_callback) { worker_pool_ = g_sequenced_worker_pool->GetTaskRunnerWithShutdownBehavior( SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); - index_.reset(new SimpleIndex(MessageLoopProxy::current(), path_, - make_scoped_ptr(new SimpleIndexFile( - cache_thread_.get(), worker_pool_.get(), - path_)))); + index_.reset( + new SimpleIndex(MessageLoopProxy::current().get(), + path_, + make_scoped_ptr(new SimpleIndexFile( + cache_thread_.get(), worker_pool_.get(), path_)))); index_->ExecuteWhenReady(base::Bind(&RecordIndexLoad, base::TimeTicks::Now())); diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc index ac22112..6d372032 100644 --- a/net/disk_cache/simple/simple_index_file_unittest.cc +++ b/net/disk_cache/simple/simple_index_file_unittest.cc @@ -62,10 +62,9 @@ class WrappedSimpleIndexFile : public SimpleIndexFile { using SimpleIndexFile::Serialize; explicit WrappedSimpleIndexFile(const base::FilePath& index_file_directory) - : SimpleIndexFile(base::MessageLoopProxy::current(), - base::MessageLoopProxy::current(), - index_file_directory) { - } + : SimpleIndexFile(base::MessageLoopProxy::current().get(), + base::MessageLoopProxy::current().get(), + index_file_directory) {} virtual ~WrappedSimpleIndexFile() { } }; @@ -233,7 +232,7 @@ TEST_F(SimpleIndexFileTest, LoadCorruptIndex) { EXPECT_FALSE(WrappedSimpleIndexFile::IsIndexFileStale(index_path)); WrappedSimpleIndexFile simple_index_file(temp_dir.path()); - simple_index_file.LoadIndexEntries(base::MessageLoopProxy::current(), + simple_index_file.LoadIndexEntries(base::MessageLoopProxy::current().get(), GetCallback()); base::RunLoop().RunUntilIdle(); diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc index 6c7c46b..a1c72c6 100644 --- a/net/http/http_stream_factory_impl.cc +++ b/net/http/http_stream_factory_impl.cc @@ -291,13 +291,17 @@ void HttpStreamFactoryImpl::OnNewSpdySessionReady( DCHECK(factory); bool use_relative_url = direct || request->url().SchemeIs("wss"); request->OnWebSocketStreamReady( - NULL, used_ssl_config, used_proxy_info, - factory->CreateSpdyStream(spdy_session, use_relative_url)); + NULL, + used_ssl_config, + used_proxy_info, + factory->CreateSpdyStream(spdy_session.get(), use_relative_url)); } else { bool use_relative_url = direct || request->url().SchemeIs("https"); - request->OnStreamReady(NULL, used_ssl_config, used_proxy_info, - new SpdyHttpStream(spdy_session, - use_relative_url)); + request->OnStreamReady( + NULL, + used_ssl_config, + used_proxy_info, + new SpdyHttpStream(spdy_session.get(), use_relative_url)); } } // TODO(mbelshe): Alert other valid requests. diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 5f4f6d5..63160d0 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc @@ -399,11 +399,15 @@ void HttpStreamFactoryImpl::Job::OnHttpsProxyTunnelResponseCallback( void HttpStreamFactoryImpl::Job::OnPreconnectsComplete() { DCHECK(!request_); - if (new_spdy_session_) { - stream_factory_->OnNewSpdySessionReady( - new_spdy_session_, spdy_session_direct_, server_ssl_config_, - proxy_info_, was_npn_negotiated(), protocol_negotiated(), using_spdy(), - net_log_); + if (new_spdy_session_.get()) { + stream_factory_->OnNewSpdySessionReady(new_spdy_session_, + spdy_session_direct_, + server_ssl_config_, + proxy_info_, + was_npn_negotiated(), + protocol_negotiated(), + using_spdy(), + net_log_); } stream_factory_->OnPreconnectsComplete(this); // |this| may be deleted after this call. @@ -512,12 +516,11 @@ int HttpStreamFactoryImpl::Job::RunLoop(int result) { case OK: next_state_ = STATE_DONE; - if (new_spdy_session_) { + if (new_spdy_session_.get()) { base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind( - &Job::OnNewSpdySessionReadyCallback, - ptr_factory_.GetWeakPtr())); + base::Bind(&Job::OnNewSpdySessionReadyCallback, + ptr_factory_.GetWeakPtr())); } else if (stream_factory_->for_websockets_) { DCHECK(websocket_stream_); base::MessageLoop::current()->PostTask( @@ -1126,10 +1129,10 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() { bool use_relative_url = direct || request_info_.url.SchemeIs("wss"); websocket_stream_.reset( request_->websocket_stream_factory()->CreateSpdyStream( - spdy_session, use_relative_url)); + spdy_session.get(), use_relative_url)); } else { bool use_relative_url = direct || request_info_.url.SchemeIs("https"); - stream_.reset(new SpdyHttpStream(spdy_session, use_relative_url)); + stream_.reset(new SpdyHttpStream(spdy_session.get(), use_relative_url)); } return OK; } diff --git a/net/http/http_stream_factory_impl_request.cc b/net/http/http_stream_factory_impl_request.cc index a29e593..9fb3931 100644 --- a/net/http/http_stream_factory_impl_request.cc +++ b/net/http/http_stream_factory_impl_request.cc @@ -311,19 +311,24 @@ void HttpStreamFactoryImpl::Request::OnNewSpdySessionReady( delegate_->OnWebSocketStreamReady( job->server_ssl_config(), job->proxy_info(), - websocket_stream_factory_->CreateSpdyStream( - spdy_session, use_relative_url)); + websocket_stream_factory_->CreateSpdyStream(spdy_session.get(), + use_relative_url)); } else { bool use_relative_url = direct || url().SchemeIs("https"); delegate_->OnStreamReady( job->server_ssl_config(), job->proxy_info(), - new SpdyHttpStream(spdy_session, use_relative_url)); + new SpdyHttpStream(spdy_session.get(), use_relative_url)); } // |this| may be deleted after this point. - factory->OnNewSpdySessionReady( - spdy_session, direct, used_ssl_config, used_proxy_info, - was_npn_negotiated, protocol_negotiated, using_spdy, net_log); + factory->OnNewSpdySessionReady(spdy_session.get(), + direct, + used_ssl_config, + used_proxy_info, + was_npn_negotiated, + protocol_negotiated, + using_spdy, + net_log); } void HttpStreamFactoryImpl::Request::OrphanJobsExcept(Job* job) { diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index 1cc105b..6ab6c9d 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -974,7 +974,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, } virtual base::SingleThreadTaskRunner* GetNotificationTaskRunner() OVERRIDE { - return file_loop_ ? file_loop_->message_loop_proxy() : NULL; + return file_loop_ ? file_loop_->message_loop_proxy().get() : NULL; } // Implement base::MessagePumpLibevent::Watcher. diff --git a/net/socket_stream/socket_stream_job.h b/net/socket_stream/socket_stream_job.h index 13dcf70..d12e73a 100644 --- a/net/socket_stream/socket_stream_job.h +++ b/net/socket_stream/socket_stream_job.h @@ -50,11 +50,11 @@ class NET_EXPORT SocketStreamJob virtual void SetUserData(const void* key, SocketStream::UserData* data); URLRequestContext* context() const { - return socket_ ? socket_->context() : 0; + return socket_.get() ? socket_->context() : 0; } void set_context(URLRequestContext* context) { - if (socket_) - socket_->set_context(context); + if (socket_.get()) + socket_->set_context(context); } virtual void Connect(); diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index 98e756c..1e7afc7 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc @@ -39,7 +39,7 @@ SpdyHttpStream::SpdyHttpStream(SpdySession* spdy_session, bool direct) buffered_read_callback_pending_(false), more_read_data_pending_(false), direct_(direct) { - DCHECK(spdy_session_); + DCHECK(spdy_session_.get()); } SpdyHttpStream::~SpdyHttpStream() { diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc index 5c29484..2514bc9 100644 --- a/net/spdy/spdy_http_stream_unittest.cc +++ b/net/spdy/spdy_http_stream_unittest.cc @@ -185,7 +185,7 @@ TEST_P(SpdyHttpStreamTest, GetUploadProgressBeforeInitialization) { kPrivacyModeDisabled); EXPECT_EQ(OK, InitSession(reads, arraysize(reads), NULL, 0, host_port_pair)); - SpdyHttpStream stream(session_, false); + SpdyHttpStream stream(session_.get(), false); UploadProgress progress = stream.GetUploadProgress(); EXPECT_EQ(0u, progress.size()); EXPECT_EQ(0u, progress.position()); diff --git a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp index 6a77b2d..793d8f7 100644 --- a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp +++ b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp @@ -416,7 +416,7 @@ nsPKCS12Blob_Export(std::string* output, if (srv) goto finish; for (size_t i=0; i<certs.size(); i++) { - DCHECK(certs[i]); + DCHECK(certs[i].get()); CERTCertificate* nssCert = certs[i]->os_cert_handle(); DCHECK(nssCert); diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 9d30ef8..3e3dbd1 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -373,7 +373,7 @@ void URLRequest::SetExtraRequestHeaders( } bool URLRequest::GetFullRequestHeaders(HttpRequestHeaders* headers) const { - if (!job_) + if (!job_.get()) return false; return job_->GetFullRequestHeaders(headers); diff --git a/ppapi/proxy/file_ref_resource.cc b/ppapi/proxy/file_ref_resource.cc index 29e8105..c66a321 100644 --- a/ppapi/proxy/file_ref_resource.cc +++ b/ppapi/proxy/file_ref_resource.cc @@ -211,7 +211,7 @@ int32_t FileRefResource::ReadDirectoryEntriesInHost( } PP_Var FileRefResource::GetAbsolutePath() { - if (!absolute_path_var_) { + if (!absolute_path_var_.get()) { std::string absolute_path; int32_t result = SyncCall<PpapiPluginMsg_FileRef_GetAbsolutePathReply>( BROWSER, PpapiHostMsg_FileRef_GetAbsolutePath(), &absolute_path); diff --git a/ppapi/proxy/plugin_main_nacl.cc b/ppapi/proxy/plugin_main_nacl.cc index e6ee97d..df59af9e 100644 --- a/ppapi/proxy/plugin_main_nacl.cc +++ b/ppapi/proxy/plugin_main_nacl.cc @@ -108,7 +108,8 @@ PpapiDispatcher::PpapiDispatcher(scoped_refptr<base::MessageLoopProxy> io_loop) // NaCl sandbox. InitWithChannel(this, base::kNullProcessId, channel_handle, false); // Channel is server. - channel()->AddFilter(new tracing::ChildTraceMessageFilter(message_loop_)); + channel()->AddFilter( + new tracing::ChildTraceMessageFilter(message_loop_.get())); } base::MessageLoopProxy* PpapiDispatcher::GetIPCMessageLoop() { diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc index 6c75f7a..bbfc5332 100644 --- a/ui/base/resource/resource_bundle_unittest.cc +++ b/ui/base/resource/resource_bundle_unittest.cc @@ -265,8 +265,7 @@ TEST_F(ResourceBundleTest, DelegateLoadDataResourceBytes) { ui::ScaleFactor scale_factor = ui::SCALE_FACTOR_NONE; EXPECT_CALL(delegate, LoadDataResourceBytes(resource_id, scale_factor)) - .Times(1) - .WillOnce(Return(static_memory)); + .Times(1).WillOnce(Return(static_memory.get())); scoped_refptr<base::RefCountedStaticMemory> result = resource_bundle->LoadDataResourceBytesForScale(resource_id, scale_factor); diff --git a/webkit/browser/appcache/appcache_url_request_job.cc b/webkit/browser/appcache/appcache_url_request_job.cc index 54f438a..b6ebe64 100644 --- a/webkit/browser/appcache/appcache_url_request_job.cc +++ b/webkit/browser/appcache/appcache_url_request_job.cc @@ -188,9 +188,10 @@ void AppCacheURLRequestJob::OnCacheLoaded(AppCache* cache, int64 cache_id) { handler_source_reader_.reset(storage_->CreateResponseReader( manifest_url_, group_id_, entry_.response_id())); handler_source_reader_->ReadData( - handler_source_buffer_, kLimit, + handler_source_buffer_.get(), + kLimit, base::Bind(&AppCacheURLRequestJob::OnExecutableSourceLoaded, - base::Unretained(this))); + base::Unretained(this))); } void AppCacheURLRequestJob::OnExecutableSourceLoaded(int result) { @@ -204,7 +205,7 @@ void AppCacheURLRequestJob::OnExecutableSourceLoaded(int result) { handler_source_buffer_->SetCapacity(result); // Free up some memory. AppCacheExecutableHandler* handler = cache_->GetOrCreateExecutableHandler( - entry_.response_id(), handler_source_buffer_); + entry_.response_id(), handler_source_buffer_.get()); handler_source_buffer_ = NULL; // not needed anymore if (handler) { InvokeExecutableHandler(handler); diff --git a/webkit/browser/blob/blob_storage_controller.cc b/webkit/browser/blob/blob_storage_controller.cc index 5c0fe15..48bf831 100644 --- a/webkit/browser/blob/blob_storage_controller.cc +++ b/webkit/browser/blob/blob_storage_controller.cc @@ -173,7 +173,7 @@ bool BlobStorageController::RemoveFromMapHelper( BlobData* BlobStorageController::GetBlobDataFromUrl(const GURL& url) { BlobMap::iterator found = blob_map_.find( BlobUrlHasRef(url) ? ClearBlobUrlRef(url).spec() : url.spec()); - return (found != blob_map_.end()) ? found->second : NULL; + return (found != blob_map_.end()) ? found->second.get() : NULL; } void BlobStorageController::AppendStorageItems( diff --git a/webkit/browser/fileapi/async_file_test_helper.cc b/webkit/browser/fileapi/async_file_test_helper.cc index d60a68e..476fdcd 100644 --- a/webkit/browser/fileapi/async_file_test_helper.cc +++ b/webkit/browser/fileapi/async_file_test_helper.cc @@ -51,7 +51,7 @@ void CreateSnapshotFileCallback( const base::PlatformFileInfo& file_info, const base::FilePath& platform_path, const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { - DCHECK(!file_ref); + DCHECK(!file_ref.get()); *result_out = result; if (platform_path_out) *platform_path_out = platform_path; diff --git a/webkit/browser/fileapi/sandbox_quota_observer.cc b/webkit/browser/fileapi/sandbox_quota_observer.cc index 4c23a60..a061e3e 100644 --- a/webkit/browser/fileapi/sandbox_quota_observer.cc +++ b/webkit/browser/fileapi/sandbox_quota_observer.cc @@ -53,8 +53,8 @@ void SandboxQuotaObserver::OnUpdate(const FileSystemURL& url, pending_update_notification_[usage_file_path] += delta; if (!delayed_cache_update_helper_) { - delayed_cache_update_helper_.reset(new TimedTaskHelper( - update_notify_runner_)); + delayed_cache_update_helper_.reset( + new TimedTaskHelper(update_notify_runner_.get())); delayed_cache_update_helper_->Start( FROM_HERE, base::TimeDelta(), // No delay. diff --git a/webkit/browser/fileapi/timed_task_helper_unittest.cc b/webkit/browser/fileapi/timed_task_helper_unittest.cc index 5f11c7e..5621135 100644 --- a/webkit/browser/fileapi/timed_task_helper_unittest.cc +++ b/webkit/browser/fileapi/timed_task_helper_unittest.cc @@ -19,8 +19,7 @@ namespace { class Embedder { public: Embedder() - : timer_(base::MessageLoopProxy::current()), - timer_fired_(false) {} + : timer_(base::MessageLoopProxy::current().get()), timer_fired_(false) {} void OnTimerFired() { timer_fired_ = true; |