make_scoped_refptr --> WrapRefCounted

This commit is contained in:
Samuel Attard 2017-12-18 11:23:02 +11:00 committed by Aleksei Kuzmin
parent 4666879f94
commit 12066a60f3
11 changed files with 26 additions and 26 deletions

View file

@ -126,7 +126,7 @@ void PrintJob::StartPrinting() {
// Real work is done in PrintJobWorker::StartPrinting().
worker_->PostTask(FROM_HERE,
base::Bind(&HoldRefCallback, make_scoped_refptr(this),
base::Bind(&HoldRefCallback, WrapRefCounted(this),
base::Bind(&PrintJobWorker::StartPrinting,
base::Unretained(worker_.get()),
base::RetainedRef(document_))));
@ -349,7 +349,7 @@ void PrintJob::UpdatePrintedDocument(PrintedDocument* new_document) {
DCHECK(!is_job_pending_);
// Sync the document with the worker.
worker_->PostTask(FROM_HERE,
base::Bind(&HoldRefCallback, make_scoped_refptr(this),
base::Bind(&HoldRefCallback, WrapRefCounted(this),
base::Bind(&PrintJobWorker::OnDocumentChanged,
base::Unretained(worker_.get()),
base::RetainedRef(document_))));

View file

@ -25,7 +25,7 @@ PrintQueriesQueue::~PrintQueriesQueue() {
void PrintQueriesQueue::QueuePrinterQuery(PrinterQuery* job) {
base::AutoLock lock(lock_);
DCHECK(job);
queued_queries_.push_back(make_scoped_refptr(job));
queued_queries_.push_back(WrapRefCounted(job));
DCHECK(job->is_valid());
}
@ -47,7 +47,7 @@ scoped_refptr<PrinterQuery> PrintQueriesQueue::PopPrinterQuery(
scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery(
int render_process_id,
int render_frame_id) {
return make_scoped_refptr(
return WrapRefCounted(
new PrinterQuery(render_process_id, render_frame_id));
}

View file

@ -242,7 +242,7 @@ void PrintJobWorker::GetSettings(bool ask_user_for_settings,
if (ask_user_for_settings) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&HoldRefCallback, make_scoped_refptr(owner_),
base::Bind(&HoldRefCallback, WrapRefCounted(owner_),
base::Bind(&PrintJobWorker::GetSettingsWithUI,
base::Unretained(this),
document_page_count,
@ -251,14 +251,14 @@ void PrintJobWorker::GetSettings(bool ask_user_for_settings,
} else if (!device_name.empty()) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&HoldRefCallback, make_scoped_refptr(owner_),
base::Bind(&HoldRefCallback, WrapRefCounted(owner_),
base::Bind(&PrintJobWorker::InitWithDeviceName,
base::Unretained(this),
device_name)));
} else {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&HoldRefCallback, make_scoped_refptr(owner_),
base::Bind(&HoldRefCallback, WrapRefCounted(owner_),
base::Bind(&PrintJobWorker::UseDefaultSettings,
base::Unretained(this))));
}
@ -272,7 +272,7 @@ void PrintJobWorker::SetSettings(
BrowserThread::UI,
FROM_HERE,
base::Bind(&HoldRefCallback,
make_scoped_refptr(owner_),
WrapRefCounted(owner_),
base::Bind(&PrintJobWorker::UpdatePrintSettings,
base::Unretained(this),
base::Passed(&new_settings))));
@ -299,7 +299,7 @@ void PrintJobWorker::GetSettingsDone(PrintingContext::Result result) {
// PrintJob will create the new PrintedDocument.
owner_->PostTask(FROM_HERE,
base::Bind(&PrintJobWorkerOwner::GetSettingsDone,
make_scoped_refptr(owner_),
WrapRefCounted(owner_),
printing_context_->settings(),
result));
}
@ -313,7 +313,7 @@ void PrintJobWorker::GetSettingsWithUI(
// weak_factory_ creates pointers valid only on owner_ thread.
printing_context_->AskUserForSettings(
document_page_count, has_selection, is_scripted,
base::Bind(&PostOnOwnerThread, make_scoped_refptr(owner_),
base::Bind(&PostOnOwnerThread, WrapRefCounted(owner_),
base::Bind(&PrintJobWorker::GetSettingsDone,
weak_factory_.GetWeakPtr())));
}