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

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: " 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.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_

Powered by Google App Engine
This is Rietveld 408576698