Chromium Code Reviews| Index: components/drive/job_scheduler.cc |
| diff --git a/components/drive/job_scheduler.cc b/components/drive/job_scheduler.cc |
| index a6568d9aa934ce348aaeeae7842a4839eb11e9a4..9b7c37435f25b3b7162e330f5684469dc5214a73 100644 |
| --- a/components/drive/job_scheduler.cc |
| +++ b/components/drive/job_scheduler.cc |
| @@ -721,9 +721,11 @@ void JobScheduler::AddPermission( |
| } |
| JobScheduler::JobEntry* JobScheduler::CreateNewJob(JobType type) { |
| - JobEntry* job = new JobEntry(type); |
| - job->job_info.job_id = job_map_.Add(job); // Takes the ownership of |job|. |
| - return job; |
| + std::unique_ptr<JobEntry> job = base::MakeUnique<JobEntry>(type); |
|
danakj
2016/11/30 00:34:00
can use auto
|
| + JobEntry* job_raw = job.get(); |
| + int32_t job_key = job_map_.Add(std::move(job)); |
| + job_raw->job_info.job_id = job_key; |
| + return job_raw; |
| } |
| void JobScheduler::StartJob(JobEntry* job) { |