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

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

Issue 8401001: Fix history importing by delaying DownloadManager creation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments 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
Index: content/browser/download/download_id_factory.cc
diff --git a/content/browser/download/download_id_factory.cc b/content/browser/download/download_id_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6b0797f88c4a9f559c60b96f147082cca8a48ef1
--- /dev/null
+++ b/content/browser/download/download_id_factory.cc
@@ -0,0 +1,17 @@
+// 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.
+
+#include "content/browser/download/download_id_factory.h"
+
+#include "content/browser/download/download_id.h"
+
+DownloadIdFactory::DownloadIdFactory(DownloadId::Domain domain)
+ : domain_(domain),
+ next_id_(0) {
+}
+
+DownloadId DownloadIdFactory::GetNextId() {
+ base::AutoLock lock(lock_);
+ return DownloadId(domain_, next_id_++);
Randy Smith (Not in Mondays) 2011/10/28 13:35:44 Nit's nit: For complex data types (i.e. most itera
benjhayden 2011/10/28 14:37:55 Yeah, but I'd rather initialize the counter to the
+}

Powered by Google App Engine
This is Rietveld 408576698