Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: content/browser/download/download_id_factory.h

Issue 8401001: Fix history importing by delaying DownloadManager creation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merge Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_id.cc ('k') | content/browser/download/download_id_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6c7d30a8cf0a9f35ead4200a2cf2e7be5ceacbfd
--- /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_
jam 2011/10/28 22:24:56 nit: CONTENT
benjhayden 2011/10/28 22:39:08 Done.
+#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_
+#pragma once
+
+#include "base/memory/ref_counted.h"
+#include "base/synchronization/lock.h"
+#include "content/browser/download/download_id.h"
+#include "content/public/browser/browser_thread.h"
+
+class DownloadManager;
+
+class CONTENT_EXPORT DownloadIdFactory
+ : public base::RefCountedThreadSafe<DownloadIdFactory> {
+ public:
+ // TODO(benjhayden): Instantiate with an explicit next id counter read from
+ // persistent storage.
+ DownloadIdFactory(DownloadId::Domain domain);
+
+ DownloadId GetNextId();
+
+ private:
+ DownloadId::Domain domain_;
+ int next_id_;
+ base::Lock lock_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadIdFactory);
+};
+
+#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_
« no previous file with comments | « content/browser/download/download_id.cc ('k') | content/browser/download/download_id_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698