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

Unified Diff: extensions/browser/api/cast_channel/cast_channel_api.h

Issue 2913033003: [cast_channel] Move cast_channel related files from //extensions to //components (Closed)
Patch Set: 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: extensions/browser/api/cast_channel/cast_channel_api.h
diff --git a/extensions/browser/api/cast_channel/cast_channel_api.h b/extensions/browser/api/cast_channel/cast_channel_api.h
index b97faea16966143992f36916e49706bcde05c421..989a1bf5dac300b260c43171a027418f8404d4d8 100644
--- a/extensions/browser/api/cast_channel/cast_channel_api.h
+++ b/extensions/browser/api/cast_channel/cast_channel_api.h
@@ -13,9 +13,9 @@
#include "base/memory/ref_counted.h"
#include "base/threading/thread_checker.h"
#include "components/cast_channel/cast_channel_enum.h"
-#include "extensions/browser/api/api_resource_manager.h"
+#include "components/cast_channel/cast_socket.h"
+#include "components/cast_channel/proto/logging.pb.h"
#include "extensions/browser/api/async_api_function.h"
-#include "extensions/browser/api/cast_channel/cast_socket.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/common/api/cast_channel.h"
@@ -29,16 +29,14 @@ namespace net {
class IPEndPoint;
}
-namespace extensions {
-
-struct Event;
-
-namespace api {
namespace cast_channel {
class CastSocketService;
class Logger;
} // namespace cast_channel
-} // namespace api
+
+namespace extensions {
+
+struct Event;
namespace cast_channel = api::cast_channel;
@@ -58,15 +56,15 @@ class CastChannelAPI : public BrowserContextKeyedAPI,
// Alternatively,
// consider making Logger not ref-counted by passing a weak
// reference of Logger to the CastSockets instead.
- scoped_refptr<cast_channel::Logger> GetLogger();
+ scoped_refptr<::cast_channel::Logger> GetLogger();
// Sets the CastSocket instance to be used for testing.
void SetSocketForTest(
- std::unique_ptr<cast_channel::CastSocket> socket_for_test);
+ std::unique_ptr<::cast_channel::CastSocket> socket_for_test);
// Returns a test CastSocket instance, if it is defined.
// Otherwise returns a scoped_ptr with a nullptr value.
- std::unique_ptr<cast_channel::CastSocket> GetSocketForTest();
+ std::unique_ptr<::cast_channel::CastSocket> GetSocketForTest();
// Returns the API browser context.
content::BrowserContext* GetBrowserContext() const;
@@ -92,8 +90,8 @@ class CastChannelAPI : public BrowserContextKeyedAPI,
static const char* service_name() { return "CastChannelAPI"; }
content::BrowserContext* const browser_context_;
- scoped_refptr<cast_channel::Logger> logger_;
- std::unique_ptr<cast_channel::CastSocket> socket_for_test_;
+ scoped_refptr<::cast_channel::Logger> logger_;
+ std::unique_ptr<::cast_channel::CastSocket> socket_for_test_;
std::unique_ptr<base::Timer> injected_timeout_timer_;
DISALLOW_COPY_AND_ASSIGN(CastChannelAPI);
@@ -113,11 +111,11 @@ class CastChannelAsyncApiFunction : public AsyncApiFunction {
// Returns the socket corresponding to |channel_id| if one exists. Otherwise,
// sets the function result with CHANNEL_ERROR_INVALID_CHANNEL_ID, completes
// the function, and returns null.
- cast_channel::CastSocket* GetSocketOrCompleteWithError(int channel_id);
+ ::cast_channel::CastSocket* GetSocketOrCompleteWithError(int channel_id);
// Adds |socket| to |manager_| and returns the new channel_id. |manager_|
// assumes ownership of |socket|.
- int AddSocket(std::unique_ptr<cast_channel::CastSocket> socket);
+ int AddSocket(std::unique_ptr<::cast_channel::CastSocket> socket);
// Removes the CastSocket corresponding to |channel_id| from the resource
// manager.
@@ -125,7 +123,7 @@ class CastChannelAsyncApiFunction : public AsyncApiFunction {
// Sets the function result to a ChannelInfo obtained from the state of
// |socket|.
- void SetResultFromSocket(const cast_channel::CastSocket& socket);
+ void SetResultFromSocket(const ::cast_channel::CastSocket& socket);
// Sets the function result to a ChannelInfo populated with |channel_id| and
// |error|.
@@ -133,14 +131,14 @@ class CastChannelAsyncApiFunction : public AsyncApiFunction {
// Returns the socket corresponding to |channel_id| if one exists, or null
// otherwise.
- cast_channel::CastSocket* GetSocket(int channel_id) const;
+ ::cast_channel::CastSocket* GetSocket(int channel_id) const;
private:
// Sets the function result from |channel_info|.
void SetResultFromChannelInfo(const cast_channel::ChannelInfo& channel_info);
// Manages creating and removing cast sockets.
- api::cast_channel::CastSocketService* cast_socket_service_;
+ ::cast_channel::CastSocketService* cast_socket_service_;
};
class CastChannelOpenFunction : public CastChannelAsyncApiFunction {
@@ -165,16 +163,16 @@ class CastChannelOpenFunction : public CastChannelAsyncApiFunction {
// Receives incoming messages and errors and provides additional API and
// origin socket context.
- class CastMessageHandler : public cast_channel::CastTransport::Delegate {
+ class CastMessageHandler : public ::cast_channel::CastTransport::Delegate {
public:
CastMessageHandler(const EventDispatchCallback& ui_dispatch_cb,
- cast_channel::CastSocket* socket,
- scoped_refptr<api::cast_channel::Logger> logger);
+ ::cast_channel::CastSocket* socket,
+ scoped_refptr<::cast_channel::Logger> logger);
~CastMessageHandler() override;
// CastTransport::Delegate implementation.
void OnError(::cast_channel::ChannelError error_state) override;
- void OnMessage(const cast_channel::CastMessage& message) override;
+ void OnMessage(const ::cast_channel::CastMessage& message) override;
void Start() override;
private:
@@ -182,9 +180,9 @@ class CastChannelOpenFunction : public CastChannelAsyncApiFunction {
// Should be bound to a weak pointer, to prevent any use-after-free
// conditions.
EventDispatchCallback const ui_dispatch_cb_;
- cast_channel::CastSocket* const socket_;
+ ::cast_channel::CastSocket* const socket_;
// Logger object for reporting error details.
- scoped_refptr<api::cast_channel::Logger> logger_;
+ scoped_refptr<::cast_channel::Logger> logger_;
DISALLOW_COPY_AND_ASSIGN(CastMessageHandler);
};

Powered by Google App Engine
This is Rietveld 408576698