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

Unified Diff: components/download/internal/client_set.h

Issue 2895953004: Add initial Controller to DownloadService (Closed)
Patch Set: Moved stats out Created 3 years, 7 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: components/download/internal/client_set.h
diff --git a/components/download/internal/client_set.h b/components/download/internal/client_set.h
new file mode 100644
index 0000000000000000000000000000000000000000..2daa5206782f6dc631f99dbee4c461452d5de742
--- /dev/null
+++ b/components/download/internal/client_set.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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 COMPONENTS_DOWNLOAD_INTERNAL_CLIENT_SET_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_CLIENT_SET_H_
+
+#include <map>
+#include <memory>
+#include <set>
+
+#include "base/macros.h"
+#include "components/download/public/clients.h"
+
+namespace download {
+
+// Helper class to hold a list of Clients and associates them with their
+// respective DownloadClient identifier.
+class ClientSet {
+ public:
+ explicit ClientSet(std::unique_ptr<DownloadClientMap> clients);
+ virtual ~ClientSet();
+
+ std::set<DownloadClient> GetRegisteredClients() const;
+ Client* GetClient(DownloadClient id) const;
+
+ private:
+ std::unique_ptr<DownloadClientMap> clients_;
+
+ DISALLOW_COPY_AND_ASSIGN(ClientSet);
+};
+
+} // namespace download
+
+#endif // COMPONENTS_DOWNLOAD_INTERNAL_CLIENT_SET_H_

Powered by Google App Engine
This is Rietveld 408576698