Commit 37fac505 authored by dcheng's avatar dcheng Committed by Commit bot

Random fixes for scoped_refptr operator T* removal.

BUG=110610
TBR=caitkp, michaeln, rockot, sievers, sky, willchan

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

Cr-Commit-Position: refs/heads/master@{#293453}
parent d0989065
...@@ -54,7 +54,7 @@ scoped_refptr<base::debug::ConvertableToTraceFormat> TestPendingTask::AsValue() ...@@ -54,7 +54,7 @@ scoped_refptr<base::debug::ConvertableToTraceFormat> TestPendingTask::AsValue()
const { const {
scoped_refptr<base::debug::TracedValue> state = scoped_refptr<base::debug::TracedValue> state =
new base::debug::TracedValue(); new base::debug::TracedValue();
AsValueInto(state); AsValueInto(state.get());
return state; return state;
} }
......
...@@ -208,7 +208,7 @@ class TestPatternReceiver : public media::cast::InProcessReceiver { ...@@ -208,7 +208,7 @@ class TestPatternReceiver : public media::cast::InProcessReceiver {
// letterboxed content region of mostly a solid color plus a small piece of // letterboxed content region of mostly a solid color plus a small piece of
// "something" that's animating to keep the tab capture pipeline generating // "something" that's animating to keep the tab capture pipeline generating
// new frames. // new frames.
const gfx::Rect region = FindLetterboxedContentRegion(video_frame); const gfx::Rect region = FindLetterboxedContentRegion(video_frame.get());
YUVColor current_color; YUVColor current_color;
current_color.y = ComputeMedianIntensityInRegionInPlane( current_color.y = ComputeMedianIntensityInRegionInPlane(
region, region,
......
...@@ -293,13 +293,13 @@ TEST_F(ExtensionToolbarModelUnitTest, BasicExtensionToolbarModelTest) { ...@@ -293,13 +293,13 @@ TEST_F(ExtensionToolbarModelUnitTest, BasicExtensionToolbarModelTest) {
// We should now find our extension in the model. // We should now find our extension in the model.
EXPECT_EQ(1u, observer()->inserted_count()); EXPECT_EQ(1u, observer()->inserted_count());
EXPECT_EQ(1u, num_toolbar_items()); 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. // Should be a no-op, but still fires the events.
toolbar_model()->MoveExtensionIcon(extension2.get(), 0); toolbar_model()->MoveExtensionIcon(extension2.get(), 0);
EXPECT_EQ(1u, observer()->moved_count()); EXPECT_EQ(1u, observer()->moved_count());
EXPECT_EQ(1u, num_toolbar_items()); EXPECT_EQ(1u, num_toolbar_items());
EXPECT_EQ(extension2, GetExtensionAtIndex(0u)); EXPECT_EQ(extension2.get(), GetExtensionAtIndex(0u));
// Remove the extension and verify. // Remove the extension and verify.
ASSERT_TRUE(RemoveExtension(extension2)); ASSERT_TRUE(RemoveExtension(extension2));
......
...@@ -44,7 +44,7 @@ std::vector<ExtensionAction*> LocationBarController::GetCurrentActions() { ...@@ -44,7 +44,7 @@ std::vector<ExtensionAction*> LocationBarController::GetCurrentActions() {
// one action per extension. If clicking on an active script action ever // one action per extension. If clicking on an active script action ever
// has a response, then we will need to split the actions. // has a response, then we will need to split the actions.
ExtensionAction* action = action_manager_->GetPageAction(**iter); ExtensionAction* action = action_manager_->GetPageAction(**iter);
if (!action && active_script_controller->WantsToRun(*iter)) { if (!action && active_script_controller->WantsToRun(iter->get())) {
ExtensionActionMap::iterator existing = ExtensionActionMap::iterator existing =
active_script_actions_.find((*iter)->id()); active_script_actions_.find((*iter)->id());
if (existing != active_script_actions_.end()) { if (existing != active_script_actions_.end()) {
......
...@@ -80,7 +80,7 @@ class LocationBarControllerUnitTest : public ChromeRenderViewHostTestHarness { ...@@ -80,7 +80,7 @@ class LocationBarControllerUnitTest : public ChromeRenderViewHostTestHarness {
.SetID(crx_file::id_util::GenerateId(name)) .SetID(crx_file::id_util::GenerateId(name))
.Build(); .Build();
extension_service_->AddExtension(extension.get()); extension_service_->AddExtension(extension.get());
return extension; return extension.get();
} }
ExtensionService* extension_service_; ExtensionService* extension_service_;
......
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
QuotaPolicyChannelIDStore::QuotaPolicyChannelIDStore( QuotaPolicyChannelIDStore::QuotaPolicyChannelIDStore(
const base::FilePath& path, const base::FilePath& path,
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, 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), : special_storage_policy_(special_storage_policy),
persistent_store_( persistent_store_(
new net::SQLiteChannelIDStore(path, background_task_runner)) { new net::SQLiteChannelIDStore(path, background_task_runner)) {
DCHECK(background_task_runner); DCHECK(background_task_runner.get());
} }
QuotaPolicyChannelIDStore::~QuotaPolicyChannelIDStore() { QuotaPolicyChannelIDStore::~QuotaPolicyChannelIDStore() {
......
...@@ -38,7 +38,8 @@ class QuotaPolicyChannelIDStore ...@@ -38,7 +38,8 @@ class QuotaPolicyChannelIDStore
QuotaPolicyChannelIDStore( QuotaPolicyChannelIDStore(
const base::FilePath& path, const base::FilePath& path,
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, const scoped_refptr<base::SequencedTaskRunner>& background_task_runner,
storage::SpecialStoragePolicy* special_storage_policy); const scoped_refptr<storage::SpecialStoragePolicy>&
special_storage_policy);
// net::DefaultChannelIDStore::PersistentStore: // net::DefaultChannelIDStore::PersistentStore:
virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
......
...@@ -127,7 +127,7 @@ void HistoryDataStore::Init(base::DictionaryValue* cached_dict) { ...@@ -127,7 +127,7 @@ void HistoryDataStore::Init(base::DictionaryValue* cached_dict) {
void HistoryDataStore::Flush( void HistoryDataStore::Flush(
const DictionaryDataStore::OnFlushedCallback& on_flushed) { const DictionaryDataStore::OnFlushedCallback& on_flushed) {
if (data_store_) if (data_store_.get())
data_store_->Flush(on_flushed); data_store_->Flush(on_flushed);
else else
on_flushed.Run(); on_flushed.Run();
...@@ -135,7 +135,7 @@ void HistoryDataStore::Flush( ...@@ -135,7 +135,7 @@ void HistoryDataStore::Flush(
void HistoryDataStore::Load( void HistoryDataStore::Load(
const HistoryDataStore::OnLoadedCallback& on_loaded) { const HistoryDataStore::OnLoadedCallback& on_loaded) {
if (data_store_) { if (data_store_.get()) {
data_store_->Load(base::Bind(&HistoryDataStore::OnDictionaryLoadedCallback, data_store_->Load(base::Bind(&HistoryDataStore::OnDictionaryLoadedCallback,
this, this,
on_loaded)); on_loaded));
...@@ -150,7 +150,7 @@ void HistoryDataStore::SetPrimary(const std::string& query, ...@@ -150,7 +150,7 @@ void HistoryDataStore::SetPrimary(const std::string& query,
base::DictionaryValue* entry_dict = GetEntryDict(query); base::DictionaryValue* entry_dict = GetEntryDict(query);
entry_dict->SetWithoutPathExpansion(kKeyPrimary, entry_dict->SetWithoutPathExpansion(kKeyPrimary,
new base::StringValue(result)); new base::StringValue(result));
if (data_store_) if (data_store_.get())
data_store_->ScheduleWrite(); data_store_->ScheduleWrite();
} }
...@@ -163,7 +163,7 @@ void HistoryDataStore::SetSecondary( ...@@ -163,7 +163,7 @@ void HistoryDataStore::SetSecondary(
base::DictionaryValue* entry_dict = GetEntryDict(query); base::DictionaryValue* entry_dict = GetEntryDict(query);
entry_dict->SetWithoutPathExpansion(kKeySecondary, results_list.release()); entry_dict->SetWithoutPathExpansion(kKeySecondary, results_list.release());
if (data_store_) if (data_store_.get())
data_store_->ScheduleWrite(); data_store_->ScheduleWrite();
} }
...@@ -173,14 +173,14 @@ void HistoryDataStore::SetUpdateTime(const std::string& query, ...@@ -173,14 +173,14 @@ void HistoryDataStore::SetUpdateTime(const std::string& query,
entry_dict->SetWithoutPathExpansion(kKeyUpdateTime, entry_dict->SetWithoutPathExpansion(kKeyUpdateTime,
new base::StringValue(base::Int64ToString( new base::StringValue(base::Int64ToString(
update_time.ToInternalValue()))); update_time.ToInternalValue())));
if (data_store_) if (data_store_.get())
data_store_->ScheduleWrite(); data_store_->ScheduleWrite();
} }
void HistoryDataStore::Delete(const std::string& query) { void HistoryDataStore::Delete(const std::string& query) {
base::DictionaryValue* assoc_dict = GetAssociationDict(); base::DictionaryValue* assoc_dict = GetAssociationDict();
assoc_dict->RemoveWithoutPathExpansion(query, NULL); assoc_dict->RemoveWithoutPathExpansion(query, NULL);
if (data_store_) if (data_store_.get())
data_store_->ScheduleWrite(); data_store_->ScheduleWrite();
} }
......
...@@ -115,7 +115,7 @@ void VariationsSeedProcessor::CreateTrialFromStudy( ...@@ -115,7 +115,7 @@ void VariationsSeedProcessor::CreateTrialFromStudy(
// different group (e.g. via --force-fieldtrials). Break out of the loop, // 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 // but don't return, so that variation ids and params for the selected
// group will still be picked up. // group will still be picked up.
if (!trial) if (!trial.get())
break; break;
RegisterExperimentParams(study, experiment); RegisterExperimentParams(study, experiment);
......
...@@ -30,11 +30,11 @@ class UsbDeviceHandleTest : public ::testing::Test { ...@@ -30,11 +30,11 @@ class UsbDeviceHandleTest : public ::testing::Test {
ASSERT_TRUE(gadget_->SetType(UsbTestGadget::ECHO)); ASSERT_TRUE(gadget_->SetType(UsbTestGadget::ECHO));
handle_ = gadget_->GetDevice()->Open(); handle_ = gadget_->GetDevice()->Open();
ASSERT_TRUE(handle_); ASSERT_TRUE(handle_.get());
} }
virtual void TearDown() { virtual void TearDown() {
if (handle_) { if (handle_.get()) {
handle_->Close(); handle_->Close();
} }
gadget_.reset(NULL); gadget_.reset(NULL);
...@@ -77,7 +77,7 @@ class TestCompletionCallback { ...@@ -77,7 +77,7 @@ class TestCompletionCallback {
}; };
TEST_F(UsbDeviceHandleTest, InterruptTransfer) { TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
if (!handle_) { if (!handle_.get()) {
return; return;
} }
...@@ -85,7 +85,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) { ...@@ -85,7 +85,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
TestCompletionCallback in_completion; TestCompletionCallback in_completion;
handle_->InterruptTransfer(USB_DIRECTION_INBOUND, handle_->InterruptTransfer(USB_DIRECTION_INBOUND,
0x81, 0x81,
in_buffer, in_buffer.get(),
in_buffer->size(), in_buffer->size(),
5000, // 5 second timeout 5000, // 5 second timeout
in_completion.callback()); in_completion.callback());
...@@ -99,7 +99,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) { ...@@ -99,7 +99,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
handle_->InterruptTransfer(USB_DIRECTION_OUTBOUND, handle_->InterruptTransfer(USB_DIRECTION_OUTBOUND,
0x01, 0x01,
out_buffer, out_buffer.get(),
out_buffer->size(), out_buffer->size(),
5000, // 5 second timeout 5000, // 5 second timeout
out_completion.callback()); out_completion.callback());
...@@ -118,7 +118,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) { ...@@ -118,7 +118,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
} }
TEST_F(UsbDeviceHandleTest, BulkTransfer) { TEST_F(UsbDeviceHandleTest, BulkTransfer) {
if (!handle_) { if (!handle_.get()) {
return; return;
} }
...@@ -127,7 +127,7 @@ TEST_F(UsbDeviceHandleTest, BulkTransfer) { ...@@ -127,7 +127,7 @@ TEST_F(UsbDeviceHandleTest, BulkTransfer) {
TestCompletionCallback in_completion; TestCompletionCallback in_completion;
handle_->BulkTransfer(USB_DIRECTION_INBOUND, handle_->BulkTransfer(USB_DIRECTION_INBOUND,
0x81, 0x81,
in_buffer, in_buffer.get(),
in_buffer->size(), in_buffer->size(),
5000, // 5 second timeout 5000, // 5 second timeout
in_completion.callback()); in_completion.callback());
...@@ -141,7 +141,7 @@ TEST_F(UsbDeviceHandleTest, BulkTransfer) { ...@@ -141,7 +141,7 @@ TEST_F(UsbDeviceHandleTest, BulkTransfer) {
handle_->BulkTransfer(USB_DIRECTION_OUTBOUND, handle_->BulkTransfer(USB_DIRECTION_OUTBOUND,
0x01, 0x01,
out_buffer, out_buffer.get(),
out_buffer->size(), out_buffer->size(),
5000, // 5 second timeout 5000, // 5 second timeout
out_completion.callback()); out_completion.callback());
......
...@@ -268,7 +268,7 @@ bool InProcessCommandBuffer::Initialize( ...@@ -268,7 +268,7 @@ bool InProcessCommandBuffer::Initialize(
gfx::GpuPreference gpu_preference, gfx::GpuPreference gpu_preference,
const base::Closure& context_lost_callback, const base::Closure& context_lost_callback,
InProcessCommandBuffer* share_group) { 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); context_lost_callback_ = WrapCallback(context_lost_callback);
if (surface.get()) { if (surface.get()) {
......
...@@ -26,7 +26,7 @@ ScopedFile::ScopedFile(const base::FilePath& path, ...@@ -26,7 +26,7 @@ ScopedFile::ScopedFile(const base::FilePath& path,
DCHECK(path.empty() || policy != DELETE_ON_SCOPE_OUT || DCHECK(path.empty() || policy != DELETE_ON_SCOPE_OUT ||
file_task_runner.get()) file_task_runner.get())
<< "path:" << path.value() << " policy:" << policy << "path:" << path.value() << " policy:" << policy
<< " runner:" << file_task_runner; << " runner:" << file_task_runner.get();
} }
ScopedFile::ScopedFile(RValue other) { ScopedFile::ScopedFile(RValue other) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment