Chromium Code Reviews| Index: content/browser/download/download_id_factory.h |
| diff --git a/content/browser/download/download_id_factory.h b/content/browser/download/download_id_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8a3b2f9bb15c6aef71466845484d104496036046 |
| --- /dev/null |
| +++ b/content/browser/download/download_id_factory.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ |
| +#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ |
| +#pragma once |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "base/synchronization/lock.h" |
| +#include "content/browser/browser_thread.h" |
| +#include "content/browser/download/download_id.h" |
| + |
| +class DownloadManager; |
| + |
| +class CONTENT_EXPORT DownloadIdFactory |
| + : public base::RefCountedThreadSafe<DownloadIdFactory> { |
| + public: |
| + DownloadIdFactory(DownloadId::Domain domain); |
| + |
| + DownloadId GetNextId(); |
| + |
| + 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
|
| + |
| + private: |
| + DownloadId::Domain domain_; |
| + int next_id_; |
| + base::Lock lock_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DownloadIdFactory); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ |