Skip to content

Commit

Permalink
Update CrOS to use scoped_refptr<T>::get() rather than implicit "oper…
Browse files Browse the repository at this point in the history
…ator T*"

BUG=110610
TBR=darin

Review URL: https://chromiumcodereview.appspot.com/16998003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206357 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rsleevi@chromium.org committed Jun 14, 2013
1 parent 3c7ca2f commit 144b6c4
Show file tree
Hide file tree
Showing 101 changed files with 870 additions and 766 deletions.
4 changes: 2 additions & 2 deletions ash/desktop_background/desktop_background_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ gfx::ImageSkia DesktopBackgroundController::GetCurrentWallpaperImage() {
}

int DesktopBackgroundController::GetWallpaperIDR() const {
if (wallpaper_loader_)
if (wallpaper_loader_.get())
return wallpaper_loader_->idr();
else if (current_wallpaper_)
return current_wallpaper_->wallpaper_info().idr;
Expand Down Expand Up @@ -242,7 +242,7 @@ void DesktopBackgroundController::SetCustomWallpaper(

void DesktopBackgroundController::CancelPendingWallpaperOperation() {
// Set canceled flag of previous request to skip unneeded loading.
if (wallpaper_loader_)
if (wallpaper_loader_.get())
wallpaper_loader_->Cancel();

// Cancel reply callback for previous request.
Expand Down
2 changes: 1 addition & 1 deletion base/prefs/testing_pref_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ template<class SuperPrefService, class ConstructionPrefRegistry>
void TestingPrefServiceBase<
SuperPrefService, ConstructionPrefRegistry>::RemoveRecommendedPref(
const char* path) {
RemovePref(recommended_prefs_, path);
RemovePref(recommended_prefs_.get(), path);
}

template<class SuperPrefService, class ConstructionPrefRegistry>
Expand Down
2 changes: 1 addition & 1 deletion cc/resources/raster_worker_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void RasterWorkerPool::ScheduleRasterTasks(const RootTask& root) {
scoped_refptr<internal::WorkerPoolTask> new_root(root.internal_);

TaskGraph graph;
BuildTaskGraph(new_root, &graph);
BuildTaskGraph(new_root.get(), &graph);
WorkerPool::SetTaskGraph(&graph);

root_.swap(new_root);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ class GDataContactsServiceTest : public testing::Test {
test_server_->RegisterRequestHandler(
base::Bind(&GDataContactsServiceTest::HandleDownloadRequest,
base::Unretained(this)));
service_.reset(new GDataContactsService(
request_context_getter_,
profile_.get()));
service_.reset(new GDataContactsService(request_context_getter_.get(),
profile_.get()));
service_->Initialize();
service_->auth_service_for_testing()->set_access_token_for_testing(
kTestGDataAuthToken);
Expand Down
8 changes: 4 additions & 4 deletions chrome/browser/chromeos/dbus/cros_dbus_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CrosDBusServiceTest : public testing::Test {
mock_bus_ = new dbus::MockBus(options);

// ShutdownAndBlock() will be called in TearDown().
EXPECT_CALL(*mock_bus_, ShutdownAndBlock()).WillOnce(Return());
EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return());

// Create a mock exported object that behaves as
// org.chromium.CrosDBusService.
Expand All @@ -52,8 +52,8 @@ class CrosDBusServiceTest : public testing::Test {

// |mock_bus_|'s GetExportedObject() will return mock_exported_object_|
// for the given service name and the object path.
EXPECT_CALL(*mock_bus_, GetExportedObject(
dbus::ObjectPath(kLibCrosServicePath)))
EXPECT_CALL(*mock_bus_.get(),
GetExportedObject(dbus::ObjectPath(kLibCrosServicePath)))
.WillOnce(Return(mock_exported_object_.get()));

// Create a mock proxy resolution service.
Expand All @@ -65,7 +65,7 @@ class CrosDBusServiceTest : public testing::Test {
Start(Eq(mock_exported_object_))).WillOnce(Return());
// Initialize the cros service with the mocks injected.
CrosDBusService::InitializeForTesting(
mock_bus_, mock_proxy_resolution_service_provider);
mock_bus_.get(), mock_proxy_resolution_service_provider);
}

virtual void TearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ProxyResolverImpl : public ProxyResolverInterface {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));

// Check if we have the URLRequestContextGetter.
if (!getter) {
if (!getter.get()) {
request->error_ = "No URLRequestContextGetter";
request->OnCompletion(net::ERR_UNEXPECTED);
return;
Expand Down
29 changes: 13 additions & 16 deletions chrome/browser/chromeos/dbus/service_provider_test_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void ServiceProviderTestHelper::SetUp(
mock_bus_ = new dbus::MockBus(options);

// ShutdownAndBlock() will be called in TearDown().
EXPECT_CALL(*mock_bus_, ShutdownAndBlock()).WillOnce(Return());
EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return());

// Create a mock exported object that behaves as
// org.chromium.CrosDBusService.
Expand All @@ -46,9 +46,9 @@ void ServiceProviderTestHelper::SetUp(

// |mock_exported_object_|'s ExportMethod() will use
// |MockExportedObject().
EXPECT_CALL(*mock_exported_object_,
ExportMethod(kLibCrosServiceInterface,
exported_method_name, _, _))
EXPECT_CALL(
*mock_exported_object_.get(),
ExportMethod(kLibCrosServiceInterface, exported_method_name, _, _))
.WillOnce(Invoke(this, &ServiceProviderTestHelper::MockExportMethod));

// Create a mock object proxy, with which we call a method of
Expand All @@ -59,18 +59,15 @@ void ServiceProviderTestHelper::SetUp(
dbus::ObjectPath(kLibCrosServicePath));
// |mock_object_proxy_|'s MockCallMethodAndBlock() will use
// MockCallMethodAndBlock() to return responses.
EXPECT_CALL(*mock_object_proxy_,
EXPECT_CALL(*mock_object_proxy_.get(),
MockCallMethodAndBlock(
AllOf(
ResultOf(
std::mem_fun(&dbus::MethodCall::GetInterface),
kLibCrosServiceInterface),
ResultOf(
std::mem_fun(&dbus::MethodCall::GetMember),
exported_method_name)),
AllOf(ResultOf(std::mem_fun(&dbus::MethodCall::GetInterface),
kLibCrosServiceInterface),
ResultOf(std::mem_fun(&dbus::MethodCall::GetMember),
exported_method_name)),
_))
.WillOnce(Invoke(this,
&ServiceProviderTestHelper::MockCallMethodAndBlock));
.WillOnce(
Invoke(this, &ServiceProviderTestHelper::MockCallMethodAndBlock));

service_provider->Start(mock_exported_object_.get());
}
Expand All @@ -89,12 +86,12 @@ void ServiceProviderTestHelper::SetUpReturnSignal(
dbus::ObjectProxy::OnConnectedCallback on_connected_callback) {
// |mock_exported_object_|'s SendSignal() will use
// MockSendSignal().
EXPECT_CALL(*mock_exported_object_, SendSignal(_))
EXPECT_CALL(*mock_exported_object_.get(), SendSignal(_))
.WillOnce(Invoke(this, &ServiceProviderTestHelper::MockSendSignal));

// |mock_object_proxy_|'s ConnectToSignal will use
// MockConnectToSignal().
EXPECT_CALL(*mock_object_proxy_,
EXPECT_CALL(*mock_object_proxy_.get(),
ConnectToSignal(interface_name, signal_name, _, _))
.WillOnce(Invoke(this, &ServiceProviderTestHelper::MockConnectToSignal));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ChangeListProcessorTest : public testing::Test {
FileError error = FILE_ERROR_FAILED;
scoped_ptr<ResourceEntry> entry(new ResourceEntry);
base::PostTaskAndReplyWithResult(
blocking_task_runner_,
blocking_task_runner_.get(),
FROM_HERE,
base::Bind(&internal::ResourceMetadata::GetResourceEntryByPath,
base::Unretained(metadata_.get()),
Expand All @@ -135,12 +135,12 @@ class ChangeListProcessorTest : public testing::Test {
int64 GetChangestamp() {
int64 changestamp = -1;
base::PostTaskAndReplyWithResult(
blocking_task_runner_,
blocking_task_runner_.get(),
FROM_HERE,
base::Bind(&internal::ResourceMetadata::GetLargestChangestamp,
base::Unretained(metadata_.get())),
base::Bind(google_apis::test_util::CreateCopyResultCallback(
&changestamp)));
base::Bind(
google_apis::test_util::CreateCopyResultCallback(&changestamp)));
google_apis::test_util::RunBlockingPoolTask();
return changestamp;
}
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/chromeos/drive/drive_file_stream_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int NetworkReaderProxy::Read(net::IOBuffer* buffer, int buffer_length,
const net::CompletionCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Check if there is no pending Read operation.
DCHECK(!buffer_);
DCHECK(!buffer_.get());
DCHECK_EQ(buffer_length_, 0);
DCHECK(callback_.is_null());
// Validate the arguments.
Expand Down Expand Up @@ -197,7 +197,7 @@ void NetworkReaderProxy::OnGetContent(scoped_ptr<std::string> data) {
}

pending_data_.push_back(data.release());
if (!buffer_) {
if (!buffer_.get()) {
// No pending Read operation.
return;
}
Expand Down Expand Up @@ -380,7 +380,7 @@ void DriveFileStreamReader::InitializeAfterGetFileContentByPathInitialized(

// Otherwise, open the stream for file.
scoped_ptr<util::LocalFileReader> file_reader(
new util::LocalFileReader(file_task_runner_));
new util::LocalFileReader(file_task_runner_.get()));
util::LocalFileReader* file_reader_ptr = file_reader.get();
file_reader_ptr->Open(
local_cache_file_path,
Expand Down
25 changes: 13 additions & 12 deletions chrome/browser/chromeos/drive/drive_integration_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ DriveIntegrationService::DriveIntegrationService(
}
scheduler_.reset(new JobScheduler(profile_, drive_service_.get()));
cache_.reset(new internal::FileCache(
!test_cache_root.empty() ? test_cache_root :
util::GetCacheRootPath(profile),
blocking_task_runner_,
!test_cache_root.empty() ? test_cache_root
: util::GetCacheRootPath(profile),
blocking_task_runner_.get(),
NULL /* free_disk_space_getter */));
drive_app_registry_.reset(new DriveAppRegistry(scheduler_.get()));

Expand All @@ -130,13 +130,14 @@ DriveIntegrationService::DriveIntegrationService(
cache_->GetCacheDirectoryPath(internal::FileCache::CACHE_TYPE_META),
blocking_task_runner_));

file_system_.reset(test_file_system ? test_file_system :
new FileSystem(profile_,
cache_.get(),
drive_service_.get(),
scheduler_.get(),
resource_metadata_.get(),
blocking_task_runner_));
file_system_.reset(test_file_system
? test_file_system
: new FileSystem(profile_,
cache_.get(),
drive_service_.get(),
scheduler_.get(),
resource_metadata_.get(),
blocking_task_runner_.get()));
file_write_helper_.reset(new FileWriteHelper(file_system()));
download_handler_.reset(new DownloadHandler(file_write_helper(),
file_system()));
Expand Down Expand Up @@ -259,7 +260,7 @@ void DriveIntegrationService::AddDriveMountPoint() {
bool success = mount_points->RegisterRemoteFileSystem(
drive_mount_point.BaseName().AsUTF8Unsafe(),
fileapi::kFileSystemTypeDrive,
file_system_proxy_,
file_system_proxy_.get(),
drive_mount_point);

if (success) {
Expand All @@ -283,7 +284,7 @@ void DriveIntegrationService::RemoveDriveMountPoint() {

mount_points->RevokeFileSystem(
util::GetDriveMountPointPath().BaseName().AsUTF8Unsafe());
if (file_system_proxy_) {
if (file_system_proxy_.get()) {
file_system_proxy_->DetachFromFileSystem();
file_system_proxy_ = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/drive/drive_protocol_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ net::URLRequestJob* DriveProtocolHandler::MaybeCreateJob(
net::URLRequest* request, net::NetworkDelegate* network_delegate) const {
DVLOG(1) << "Handling url: " << request->url().spec();
return new DriveURLRequestJob(base::Bind(&GetFileSystem, profile_id_),
blocking_task_runner_,
blocking_task_runner_.get(),
request,
network_delegate);
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/drive/drive_url_request_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void DriveURLRequestJob::Start() {

// Initialize the stream reader.
stream_reader_.reset(
new DriveFileStreamReader(file_system_getter_, file_task_runner_));
new DriveFileStreamReader(file_system_getter_, file_task_runner_.get()));
stream_reader_->Initialize(
drive_file_path,
byte_range_,
Expand Down
Loading

0 comments on commit 144b6c4

Please sign in to comment.