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

Unified Diff: components/cast_channel/cast_socket_service.h

Issue 2926313002: Revert of [cast_channel] Move cast_channel related files from //extensions to //components (Closed)
Patch Set: Created 3 years, 6 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 | « components/cast_channel/cast_socket.cc ('k') | components/cast_channel/cast_socket_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cast_channel/cast_socket_service.h
diff --git a/components/cast_channel/cast_socket_service.h b/components/cast_channel/cast_socket_service.h
deleted file mode 100644
index d7d016ba41806bc6f48babb97d43c1526b83308f..0000000000000000000000000000000000000000
--- a/components/cast_channel/cast_socket_service.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// 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_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_
-#define COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_
-
-#include <map>
-#include <memory>
-
-#include "base/macros.h"
-#include "base/threading/thread_checker.h"
-#include "components/cast_channel/cast_socket.h"
-#include "components/keyed_service/core/refcounted_keyed_service.h"
-#include "content/public/browser/browser_thread.h"
-
-namespace cast_channel {
-
-// This class adds, removes, and returns cast sockets created by CastChannelAPI
-// to underlying storage.
-// Instance of this class is created on the UI thread and destroyed on the IO
-// thread. All public API must be called from the IO thread.
-class CastSocketService : public RefcountedKeyedService {
- public:
- CastSocketService();
-
- // Adds |socket| to |sockets_| and returns the new channel_id. Takes ownership
- // of |socket|.
- int AddSocket(std::unique_ptr<CastSocket> socket);
-
- // Removes the CastSocket corresponding to |channel_id| from the
- // CastSocketRegistry. Returns nullptr if no such CastSocket exists.
- std::unique_ptr<CastSocket> RemoveSocket(int channel_id);
-
- // Returns the socket corresponding to |channel_id| if one exists, or nullptr
- // otherwise.
- CastSocket* GetSocket(int channel_id) const;
-
- private:
- ~CastSocketService() override;
-
- // RefcountedKeyedService implementation.
- void ShutdownOnUIThread() override;
-
- // Used to generate CastSocket id.
- static int last_channel_id_;
-
- // The collection of CastSocket keyed by channel_id.
- std::map<int, std::unique_ptr<CastSocket>> sockets_;
-
- THREAD_CHECKER(thread_checker_);
-
- DISALLOW_COPY_AND_ASSIGN(CastSocketService);
-};
-
-} // namespace cast_channel
-
-#endif // COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_
« no previous file with comments | « components/cast_channel/cast_socket.cc ('k') | components/cast_channel/cast_socket_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698