summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-09-04 22:28:13 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-05 05:30:03 +0000
commit37fac505ffd432f088abbc5056e7c72ca59ff017 (patch)
tree0adc58a695df4a8a2b006b4222d08cef2c17bc50
parentd098906547cc70f8626709ae1243be7f8c1e0e22 (diff)
downloadchromium_src-37fac505ffd432f088abbc5056e7c72ca59ff017.zip
chromium_src-37fac505ffd432f088abbc5056e7c72ca59ff017.tar.gz
chromium_src-37fac505ffd432f088abbc5056e7c72ca59ff017.tar.bz2
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}
-rw-r--r--base/test/test_pending_task.cc2
-rw-r--r--chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc2
-rw-r--r--chrome/browser/extensions/extension_toolbar_model_unittest.cc4
-rw-r--r--chrome/browser/extensions/location_bar_controller.cc2
-rw-r--r--chrome/browser/extensions/location_bar_controller_unittest.cc2
-rw-r--r--chrome/browser/net/quota_policy_channel_id_store.cc4
-rw-r--r--chrome/browser/net/quota_policy_channel_id_store.h3
-rw-r--r--chrome/browser/ui/app_list/search/history_data_store.cc12
-rw-r--r--components/variations/variations_seed_processor.cc2
-rw-r--r--device/usb/usb_device_handle_unittest.cc16
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.cc2
-rw-r--r--storage/common/blob/scoped_file.cc2
12 files changed, 27 insertions, 26 deletions
diff --git a/base/test/test_pending_task.cc b/base/test/test_pending_task.cc
index f5ae5a1..94989de 100644
--- a/base/test/test_pending_task.cc
+++ b/base/test/test_pending_task.cc
@@ -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;
}
diff --git a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
index e68cd96..d546d2a 100644
--- a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
+++ b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
@@ -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,
diff --git a/chrome/browser/extensions/extension_toolbar_model_unittest.cc b/chrome/browser/extensions/extension_toolbar_model_unittest.cc
index 9b90bb5..8883632 100644
--- a/chrome/browser/extensions/extension_toolbar_model_unittest.cc
+++ b/chrome/browser/extensions/extension_toolbar_model_unittest.cc
@@ -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));
diff --git a/chrome/browser/extensions/location_bar_controller.cc b/chrome/browser/extensions/location_bar_controller.cc
index dcb8a11..bbb6e8d 100644
--- a/chrome/browser/extensions/location_bar_controller.cc
+++ b/chrome/browser/extensions/location_bar_controller.cc
@@ -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()) {
diff --git a/chrome/browser/extensions/location_bar_controller_unittest.cc b/chrome/browser/extensions/location_bar_controller_unittest.cc
index b2e1b89..2cbc4da 100644
--- a/chrome/browser/extensions/location_bar_controller_unittest.cc
+++ b/chrome/browser/extensions/location_bar_controller_unittest.cc
@@ -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_;
diff --git a/chrome/browser/net/quota_policy_channel_id_store.cc b/chrome/browser/net/quota_policy_channel_id_store.cc
index c88d979..cd69e97 100644
--- a/chrome/browser/net/quota_policy_channel_id_store.cc
+++ b/chrome/browser/net/quota_policy_channel_id_store.cc
@@ -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() {
diff --git a/chrome/browser/net/quota_policy_channel_id_store.h b/chrome/browser/net/quota_policy_channel_id_store.h
index f1455ca..9ec173f 100644
--- a/chrome/browser/net/quota_policy_channel_id_store.h
+++ b/chrome/browser/net/quota_policy_channel_id_store.h
@@ -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;
diff --git a/chrome/browser/ui/app_list/search/history_data_store.cc b/chrome/browser/ui/app_list/search/history_data_store.cc
index 4478036..de4ce78 100644
--- a/chrome/browser/ui/app_list/search/history_data_store.cc
+++ b/chrome/browser/ui/app_list/search/history_data_store.cc
@@ -127,7 +127,7 @@ 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();
@@ -135,7 +135,7 @@ void HistoryDataStore::Flush(
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));
@@ -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();
}
@@ -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();
}
@@ -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();
}
diff --git a/components/variations/variations_seed_processor.cc b/components/variations/variations_seed_processor.cc
index e60db0d..9d2057f3 100644
--- a/components/variations/variations_seed_processor.cc
+++ b/components/variations/variations_seed_processor.cc
@@ -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);
diff --git a/device/usb/usb_device_handle_unittest.cc b/device/usb/usb_device_handle_unittest.cc
index f24f210..98523b9 100644
--- a/device/usb/usb_device_handle_unittest.cc
+++ b/device/usb/usb_device_handle_unittest.cc
@@ -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);
@@ -77,7 +77,7 @@ class TestCompletionCallback {
};
TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
- if (!handle_) {
+ if (!handle_.get()) {
return;
}
@@ -85,7 +85,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
TestCompletionCallback in_completion;
handle_->InterruptTransfer(USB_DIRECTION_INBOUND,
0x81,
- in_buffer,
+ in_buffer.get(),
in_buffer->size(),
5000, // 5 second timeout
in_completion.callback());
@@ -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());
@@ -118,7 +118,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
}
TEST_F(UsbDeviceHandleTest, BulkTransfer) {
- if (!handle_) {
+ if (!handle_.get()) {
return;
}
@@ -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());
@@ -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());
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 49e74fa..8886f09 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -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()) {
diff --git a/storage/common/blob/scoped_file.cc b/storage/common/blob/scoped_file.cc
index 9cfb1a8..408e187 100644
--- a/storage/common/blob/scoped_file.cc
+++ b/storage/common/blob/scoped_file.cc
@@ -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) {