Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/download/download_id_factory.h" | |
| 6 | |
| 7 #include "content/browser/download/download_id.h" | |
| 8 | |
| 9 DownloadIdFactory::DownloadIdFactory(DownloadId::Domain domain) | |
| 10 : domain_(domain), | |
| 11 next_id_(0) { | |
| 12 } | |
| 13 | |
| 14 DownloadId DownloadIdFactory::GetNextId() { | |
| 15 base::AutoLock lock(lock_); | |
|
Randy Smith (Not in Mondays)
2011/10/27 18:01:44
Is there a reason to use AutoLock rather than atom
benjhayden
2011/10/27 19:04:41
We're planning on initializing next_id_ to somethi
| |
| 16 return DownloadId(domain_, next_id_++); | |
| 17 } | |
| 18 | |
| 19 void DownloadIdFactory::SetNextId(int next_id) { | |
| 20 base::AutoLock lock(lock_); | |
| 21 next_id_ += next_id; | |
|
Randy Smith (Not in Mondays)
2011/10/27 18:01:44
The += is strange enough that it deserves a commen
benjhayden
2011/10/27 19:04:41
We were thinking at one point that DM could alloca
| |
| 22 } | |
| OLD | NEW |