Skip to content

Commit

Permalink
Random fixes for scoped_refptr operator T* removal.
Browse files Browse the repository at this point in the history
BUG=110610
TBR=caitkp, michaeln, rockot, sievers, sky, willchan

Review URL: https://codereview.chromium.org/543893002

Cr-Commit-Position: refs/heads/master@{#293453}
  • Loading branch information
zetafunction authored and Commit bot committed Sep 5, 2014
1 parent d098906 commit 37fac50
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion base/test/test_pending_task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ scoped_refptr<base::debug::ConvertableToTraceFormat> TestPendingTask::AsValue()
const {
scoped_refptr<base::debug::TracedValue> state =
new base::debug::TracedValue();
AsValueInto(state);
AsValueInto(state.get());
return state;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class TestPatternReceiver : public media::cast::InProcessReceiver {
// letterboxed content region of mostly a solid color plus a small piece of
// "something" that's animating to keep the tab capture pipeline generating
// new frames.
const gfx::Rect region = FindLetterboxedContentRegion(video_frame);
const gfx::Rect region = FindLetterboxedContentRegion(video_frame.get());
YUVColor current_color;
current_color.y = ComputeMedianIntensityInRegionInPlane(
region,
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/extensions/extension_toolbar_model_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ TEST_F(ExtensionToolbarModelUnitTest, BasicExtensionToolbarModelTest) {
// We should now find our extension in the model.
EXPECT_EQ(1u, observer()->inserted_count());
EXPECT_EQ(1u, num_toolbar_items());
EXPECT_EQ(extension2, GetExtensionAtIndex(0u));
EXPECT_EQ(extension2.get(), GetExtensionAtIndex(0u));

// Should be a no-op, but still fires the events.
toolbar_model()->MoveExtensionIcon(extension2.get(), 0);
EXPECT_EQ(1u, observer()->moved_count());
EXPECT_EQ(1u, num_toolbar_items());
EXPECT_EQ(extension2, GetExtensionAtIndex(0u));
EXPECT_EQ(extension2.get(), GetExtensionAtIndex(0u));

// Remove the extension and verify.
ASSERT_TRUE(RemoveExtension(extension2));
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/location_bar_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ std::vector<ExtensionAction*> LocationBarController::GetCurrentActions() {
// one action per extension. If clicking on an active script action ever
// has a response, then we will need to split the actions.
ExtensionAction* action = action_manager_->GetPageAction(**iter);
if (!action && active_script_controller->WantsToRun(*iter)) {
if (!action && active_script_controller->WantsToRun(iter->get())) {
ExtensionActionMap::iterator existing =
active_script_actions_.find((*iter)->id());
if (existing != active_script_actions_.end()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class LocationBarControllerUnitTest : public ChromeRenderViewHostTestHarness {
.SetID(crx_file::id_util::GenerateId(name))
.Build();
extension_service_->AddExtension(extension.get());
return extension;
return extension.get();
}

ExtensionService* extension_service_;
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/net/quota_policy_channel_id_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
QuotaPolicyChannelIDStore::QuotaPolicyChannelIDStore(
const base::FilePath& path,
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner,
storage::SpecialStoragePolicy* special_storage_policy)
const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy)
: special_storage_policy_(special_storage_policy),
persistent_store_(
new net::SQLiteChannelIDStore(path, background_task_runner)) {
DCHECK(background_task_runner);
DCHECK(background_task_runner.get());
}

QuotaPolicyChannelIDStore::~QuotaPolicyChannelIDStore() {
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/net/quota_policy_channel_id_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class QuotaPolicyChannelIDStore
QuotaPolicyChannelIDStore(
const base::FilePath& path,
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner,
storage::SpecialStoragePolicy* special_storage_policy);
const scoped_refptr<storage::SpecialStoragePolicy>&
special_storage_policy);

// net::DefaultChannelIDStore::PersistentStore:
virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
Expand Down
12 changes: 6 additions & 6 deletions chrome/browser/ui/app_list/search/history_data_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ void HistoryDataStore::Init(base::DictionaryValue* cached_dict) {

void HistoryDataStore::Flush(
const DictionaryDataStore::OnFlushedCallback& on_flushed) {
if (data_store_)
if (data_store_.get())
data_store_->Flush(on_flushed);
else
on_flushed.Run();
}

void HistoryDataStore::Load(
const HistoryDataStore::OnLoadedCallback& on_loaded) {
if (data_store_) {
if (data_store_.get()) {
data_store_->Load(base::Bind(&HistoryDataStore::OnDictionaryLoadedCallback,
this,
on_loaded));
Expand All @@ -150,7 +150,7 @@ void HistoryDataStore::SetPrimary(const std::string& query,
base::DictionaryValue* entry_dict = GetEntryDict(query);
entry_dict->SetWithoutPathExpansion(kKeyPrimary,
new base::StringValue(result));
if (data_store_)
if (data_store_.get())
data_store_->ScheduleWrite();
}

Expand All @@ -163,7 +163,7 @@ void HistoryDataStore::SetSecondary(

base::DictionaryValue* entry_dict = GetEntryDict(query);
entry_dict->SetWithoutPathExpansion(kKeySecondary, results_list.release());
if (data_store_)
if (data_store_.get())
data_store_->ScheduleWrite();
}

Expand All @@ -173,14 +173,14 @@ void HistoryDataStore::SetUpdateTime(const std::string& query,
entry_dict->SetWithoutPathExpansion(kKeyUpdateTime,
new base::StringValue(base::Int64ToString(
update_time.ToInternalValue())));
if (data_store_)
if (data_store_.get())
data_store_->ScheduleWrite();
}

void HistoryDataStore::Delete(const std::string& query) {
base::DictionaryValue* assoc_dict = GetAssociationDict();
assoc_dict->RemoveWithoutPathExpansion(query, NULL);
if (data_store_)
if (data_store_.get())
data_store_->ScheduleWrite();
}

Expand Down
2 changes: 1 addition & 1 deletion components/variations/variations_seed_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void VariationsSeedProcessor::CreateTrialFromStudy(
// different group (e.g. via --force-fieldtrials). Break out of the loop,
// but don't return, so that variation ids and params for the selected
// group will still be picked up.
if (!trial)
if (!trial.get())
break;

RegisterExperimentParams(study, experiment);
Expand Down
16 changes: 8 additions & 8 deletions device/usb/usb_device_handle_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class UsbDeviceHandleTest : public ::testing::Test {
ASSERT_TRUE(gadget_->SetType(UsbTestGadget::ECHO));

handle_ = gadget_->GetDevice()->Open();
ASSERT_TRUE(handle_);
ASSERT_TRUE(handle_.get());
}

virtual void TearDown() {
if (handle_) {
if (handle_.get()) {
handle_->Close();
}
gadget_.reset(NULL);
Expand Down Expand Up @@ -77,15 +77,15 @@ class TestCompletionCallback {
};

TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
if (!handle_) {
if (!handle_.get()) {
return;
}

scoped_refptr<net::IOBufferWithSize> in_buffer(new net::IOBufferWithSize(64));
TestCompletionCallback in_completion;
handle_->InterruptTransfer(USB_DIRECTION_INBOUND,
0x81,
in_buffer,
in_buffer.get(),
in_buffer->size(),
5000, // 5 second timeout
in_completion.callback());
Expand All @@ -99,7 +99,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {

handle_->InterruptTransfer(USB_DIRECTION_OUTBOUND,
0x01,
out_buffer,
out_buffer.get(),
out_buffer->size(),
5000, // 5 second timeout
out_completion.callback());
Expand All @@ -118,7 +118,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
}

TEST_F(UsbDeviceHandleTest, BulkTransfer) {
if (!handle_) {
if (!handle_.get()) {
return;
}

Expand All @@ -127,7 +127,7 @@ TEST_F(UsbDeviceHandleTest, BulkTransfer) {
TestCompletionCallback in_completion;
handle_->BulkTransfer(USB_DIRECTION_INBOUND,
0x81,
in_buffer,
in_buffer.get(),
in_buffer->size(),
5000, // 5 second timeout
in_completion.callback());
Expand All @@ -141,7 +141,7 @@ TEST_F(UsbDeviceHandleTest, BulkTransfer) {

handle_->BulkTransfer(USB_DIRECTION_OUTBOUND,
0x01,
out_buffer,
out_buffer.get(),
out_buffer->size(),
5000, // 5 second timeout
out_completion.callback());
Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/in_process_command_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ bool InProcessCommandBuffer::Initialize(
gfx::GpuPreference gpu_preference,
const base::Closure& context_lost_callback,
InProcessCommandBuffer* share_group) {
DCHECK(!share_group || service_ == share_group->service_);
DCHECK(!share_group || service_.get() == share_group->service_.get());
context_lost_callback_ = WrapCallback(context_lost_callback);

if (surface.get()) {
Expand Down
2 changes: 1 addition & 1 deletion storage/common/blob/scoped_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ScopedFile::ScopedFile(const base::FilePath& path,
DCHECK(path.empty() || policy != DELETE_ON_SCOPE_OUT ||
file_task_runner.get())
<< "path:" << path.value() << " policy:" << policy
<< " runner:" << file_task_runner;
<< " runner:" << file_task_runner.get();
}

ScopedFile::ScopedFile(RValue other) {
Expand Down

0 comments on commit 37fac50

Please sign in to comment.