summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 20:15:57 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 20:15:57 +0000
commit00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1 (patch)
treeeb61d6402a5e967e5eb1d41dfde730af48dfa55f /chrome/browser
parentd9b888cdf9ad654a3f2e5c22b935e68db77a71ef (diff)
downloadchromium_src-00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1.zip
chromium_src-00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1.tar.gz
chromium_src-00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1.tar.bz2
Convert implicit scoped_refptr constructor calls to explicit ones, part 2
This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2826041 I then did quite a bit of manual editing to fix style issues. BUG=28083 TEST=None Review URL: http://codereview.chromium.org/4291001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc5
-rw-r--r--chrome/browser/extensions/extension_cookies_api.cc2
-rw-r--r--chrome/browser/extensions/extension_toolbar_model.cc11
-rw-r--r--chrome/browser/extensions/extensions_service.cc4
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc2
-rw-r--r--chrome/browser/memory_purger.cc12
-rw-r--r--chrome/browser/printing/print_job_manager.cc4
-rw-r--r--chrome/browser/sync/engine/apply_updates_command_unittest.cc3
-rw-r--r--chrome/browser/sync/engine/process_commit_response_command_unittest.cc6
-rw-r--r--chrome/browser/sync/engine/verify_updates_command_unittest.cc4
10 files changed, 28 insertions, 25 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 241a4b1..c3c8f14 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -562,8 +562,9 @@ void TestingAutomationProvider::DeleteCookie(const GURL& url,
NavigationController* tab = tab_tracker_->GetResource(handle);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- new DeleteCookieTask(url, cookie_name,
- tab->profile()->GetRequestContext()));
+ new DeleteCookieTask(
+ url, cookie_name,
+ make_scoped_refptr(tab->profile()->GetRequestContext())));
*success = true;
}
}
diff --git a/chrome/browser/extensions/extension_cookies_api.cc b/chrome/browser/extensions/extension_cookies_api.cc
index b97c74d..e66c4b3 100644
--- a/chrome/browser/extensions/extension_cookies_api.cc
+++ b/chrome/browser/extensions/extension_cookies_api.cc
@@ -409,7 +409,7 @@ bool RemoveCookieFunction::RunImpl() {
// should happen after this.
bool rv = BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- new RemoveCookieTask(url, name, store_context));
+ new RemoveCookieTask(url, name, make_scoped_refptr(store_context)));
DCHECK(rv);
return true;
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 4b55442..9b36825 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -58,7 +58,7 @@ void ExtensionToolbarModel::MoveBrowserAction(const Extension* extension,
bool inserted = false;
for (ExtensionList::iterator iter = begin(); iter != end(); ++iter, ++i) {
if (i == index) {
- toolitems_.insert(iter, extension);
+ toolitems_.insert(iter, make_scoped_refptr(extension));
inserted = true;
break;
}
@@ -68,7 +68,7 @@ void ExtensionToolbarModel::MoveBrowserAction(const Extension* extension,
DCHECK_EQ(index, static_cast<int>(toolitems_.size()));
index = toolitems_.size();
- toolitems_.push_back(extension);
+ toolitems_.push_back(make_scoped_refptr(extension));
}
FOR_EACH_OBSERVER(Observer, observers_, BrowserActionMoved(extension, index));
@@ -111,11 +111,12 @@ void ExtensionToolbarModel::AddExtension(const Extension* extension) {
if (extension->id() == last_extension_removed_ &&
last_extension_removed_index_ < toolitems_.size()) {
- toolitems_.insert(begin() + last_extension_removed_index_, extension);
+ toolitems_.insert(begin() + last_extension_removed_index_,
+ make_scoped_refptr(extension));
FOR_EACH_OBSERVER(Observer, observers_,
BrowserActionAdded(extension, last_extension_removed_index_));
} else {
- toolitems_.push_back(extension);
+ toolitems_.push_back(make_scoped_refptr(extension));
FOR_EACH_OBSERVER(Observer, observers_,
BrowserActionAdded(extension, toolitems_.size() - 1));
}
@@ -172,7 +173,7 @@ void ExtensionToolbarModel::InitializeExtensionList() {
int index = std::distance(pref_order.begin(), pos);
sorted[index] = extension;
} else {
- unsorted.push_back(extension);
+ unsorted.push_back(make_scoped_refptr(extension));
}
}
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 1591eb2..98681de 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -891,7 +891,7 @@ void ExtensionsService::EnableExtension(const std::string& extension_id) {
extension_prefs_->SetExtensionState(extension, Extension::ENABLED);
// Move it over to the enabled list.
- extensions_.push_back(extension);
+ extensions_.push_back(make_scoped_refptr(extension));
ExtensionList::iterator iter = std::find(disabled_extensions_.begin(),
disabled_extensions_.end(),
extension);
@@ -916,7 +916,7 @@ void ExtensionsService::DisableExtension(const std::string& extension_id) {
extension_prefs_->SetExtensionState(extension, Extension::DISABLED);
// Move it over to the disabled list.
- disabled_extensions_.push_back(extension);
+ disabled_extensions_.push_back(make_scoped_refptr(extension));
ExtensionList::iterator iter = std::find(extensions_.begin(),
extensions_.end(),
extension);
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index dab980d..ee979f33 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -422,7 +422,7 @@ class ExtensionsServiceTest
switch (type.value) {
case NotificationType::EXTENSION_LOADED: {
const Extension* extension = Details<const Extension>(details).ptr();
- loaded_.push_back(extension);
+ loaded_.push_back(make_scoped_refptr(extension));
// The tests rely on the errors being in a certain order, which can vary
// depending on how filesystem iteration works.
std::stable_sort(loaded_.begin(), loaded_.end(), ExtensionsOrder());
diff --git a/chrome/browser/memory_purger.cc b/chrome/browser/memory_purger.cc
index d1431da..3543ee5 100644
--- a/chrome/browser/memory_purger.cc
+++ b/chrome/browser/memory_purger.cc
@@ -37,7 +37,8 @@ class PurgeMemoryIOHelper
: safe_browsing_service_(safe_browsing_service) {
}
- void AddRequestContextGetter(URLRequestContextGetter* request_context_getter);
+ void AddRequestContextGetter(
+ scoped_refptr<URLRequestContextGetter> request_context_getter);
void PurgeMemoryOnIOThread();
@@ -52,11 +53,8 @@ class PurgeMemoryIOHelper
};
void PurgeMemoryIOHelper::AddRequestContextGetter(
- URLRequestContextGetter* request_context_getter) {
- if (!request_context_getters_.count(request_context_getter)) {
- request_context_getters_.insert(
- RequestContextGetter(request_context_getter));
- }
+ scoped_refptr<URLRequestContextGetter> request_context_getter) {
+ request_context_getters_.insert(request_context_getter);
}
void PurgeMemoryIOHelper::PurgeMemoryOnIOThread() {
@@ -104,7 +102,7 @@ void MemoryPurger::PurgeBrowser() {
i != profile_manager->end(); ++i) {
Profile* profile = *i;
purge_memory_io_helper->AddRequestContextGetter(
- profile->GetRequestContext());
+ make_scoped_refptr(profile->GetRequestContext()));
// NOTE: Some objects below may be duplicates across profiles. We could
// conceivably put all these in sets and then iterate over the sets.
diff --git a/chrome/browser/printing/print_job_manager.cc b/chrome/browser/printing/print_job_manager.cc
index 91b27ee..25f4791 100644
--- a/chrome/browser/printing/print_job_manager.cc
+++ b/chrome/browser/printing/print_job_manager.cc
@@ -61,7 +61,7 @@ void PrintJobManager::StopJobs(bool wait_for_finish) {
void PrintJobManager::QueuePrinterQuery(PrinterQuery* job) {
AutoLock lock(lock_);
DCHECK(job);
- queued_queries_.push_back(job);
+ queued_queries_.push_back(make_scoped_refptr(job));
DCHECK(job->is_valid());
}
@@ -116,7 +116,7 @@ void PrintJobManager::OnPrintJobEvent(
current_jobs_.end(),
print_job));
// Causes a AddRef().
- current_jobs_.push_back(print_job);
+ current_jobs_.push_back(make_scoped_refptr(print_job));
break;
}
case JobEventDetails::JOB_DONE: {
diff --git a/chrome/browser/sync/engine/apply_updates_command_unittest.cc b/chrome/browser/sync/engine/apply_updates_command_unittest.cc
index 2cf2825..b3ca18c 100644
--- a/chrome/browser/sync/engine/apply_updates_command_unittest.cc
+++ b/chrome/browser/sync/engine/apply_updates_command_unittest.cc
@@ -33,7 +33,8 @@ class ApplyUpdatesCommandTest : public SyncerCommandTest {
virtual void SetUp() {
workers()->clear();
mutable_routing_info()->clear();
- workers()->push_back(new ModelSafeWorker()); // GROUP_PASSIVE worker.
+ // GROUP_PASSIVE worker.
+ workers()->push_back(make_scoped_refptr(new ModelSafeWorker()));
(*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_PASSIVE;
(*mutable_routing_info())[syncable::PASSWORDS] = GROUP_PASSIVE;
(*mutable_routing_info())[syncable::NIGORI] = GROUP_PASSIVE;
diff --git a/chrome/browser/sync/engine/process_commit_response_command_unittest.cc b/chrome/browser/sync/engine/process_commit_response_command_unittest.cc
index b6afab8..b80a3cd 100644
--- a/chrome/browser/sync/engine/process_commit_response_command_unittest.cc
+++ b/chrome/browser/sync/engine/process_commit_response_command_unittest.cc
@@ -42,8 +42,10 @@ class ProcessCommitResponseCommandTestWithParam
workers()->clear();
mutable_routing_info()->clear();
- workers()->push_back(new ModelSafeWorker()); // GROUP_PASSIVE worker.
- workers()->push_back(new MockUIModelWorker()); // GROUP_UI worker.
+ // GROUP_PASSIVE worker.
+ workers()->push_back(make_scoped_refptr(new ModelSafeWorker()));
+ // GROUP_UI worker.
+ workers()->push_back(make_scoped_refptr(new MockUIModelWorker()));
(*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI;
(*mutable_routing_info())[syncable::PREFERENCES] = GROUP_UI;
(*mutable_routing_info())[syncable::AUTOFILL] = GROUP_PASSIVE;
diff --git a/chrome/browser/sync/engine/verify_updates_command_unittest.cc b/chrome/browser/sync/engine/verify_updates_command_unittest.cc
index 3ac4bf2..0c27b99 100644
--- a/chrome/browser/sync/engine/verify_updates_command_unittest.cc
+++ b/chrome/browser/sync/engine/verify_updates_command_unittest.cc
@@ -30,8 +30,8 @@ class VerifyUpdatesCommandTest : public SyncerCommandTest {
virtual void SetUp() {
workers()->clear();
mutable_routing_info()->clear();
- workers()->push_back(new MockDBModelWorker());
- workers()->push_back(new MockUIModelWorker());
+ workers()->push_back(make_scoped_refptr(new MockDBModelWorker()));
+ workers()->push_back(make_scoped_refptr(new MockUIModelWorker()));
(*mutable_routing_info())[syncable::PREFERENCES] = GROUP_UI;
(*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI;
(*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB;