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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ | |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/synchronization/lock.h" | |
| 11 #include "content/browser/browser_thread.h" | |
| 12 #include "content/browser/download/download_id.h" | |
| 13 | |
| 14 class DownloadManager; | |
| 15 | |
| 16 class CONTENT_EXPORT DownloadIdFactory | |
| 17 : public base::RefCountedThreadSafe<DownloadIdFactory> { | |
| 18 public: | |
| 19 DownloadIdFactory(DownloadId::Domain domain); | |
| 20 | |
| 21 DownloadId GetNextId(); | |
| 22 | |
| 23 void SetNextId(int next_id); | |
|
Randy Smith (Not in Mondays)
2011/10/27 18:01:44
Remind me what the constraints are on our use of t
benjhayden
2011/10/27 19:04:41
We'd been thinking at one point that, until the id
Randy Smith (Not in Mondays)
2011/10/28 13:35:43
That's what I was thinking of--I wish I remembered
benjhayden
2011/10/28 14:37:54
We want to set next_id_ = next_id_from_history, bu
| |
| 24 | |
| 25 private: | |
| 26 DownloadId::Domain domain_; | |
| 27 int next_id_; | |
| 28 base::Lock lock_; | |
| 29 | |
| 30 DISALLOW_COPY_AND_ASSIGN(DownloadIdFactory); | |
| 31 }; | |
| 32 | |
| 33 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ | |
| OLD | NEW |