Index: extensions/browser/api/cast_channel/cast_channel_api.cc |
diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc |
index b645aed0b39b543552800d0eff72b56a75aa7125..24bc55159f4e3f4073317cd413d6e7411cd81354 100644 |
--- a/extensions/browser/api/cast_channel/cast_channel_api.cc |
+++ b/extensions/browser/api/cast_channel/cast_channel_api.cc |
@@ -18,14 +18,15 @@ |
#include "base/memory/ptr_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/values.h" |
+#include "components/cast_channel/cast_message_util.h" |
+#include "components/cast_channel/cast_socket.h" |
+#include "components/cast_channel/cast_socket_service.h" |
+#include "components/cast_channel/cast_socket_service_factory.h" |
+#include "components/cast_channel/keep_alive_delegate.h" |
+#include "components/cast_channel/logger.h" |
#include "content/public/browser/browser_thread.h" |
#include "extensions/browser/api/cast_channel/cast_channel_enum_util.h" |
#include "extensions/browser/api/cast_channel/cast_message_util.h" |
-#include "extensions/browser/api/cast_channel/cast_socket.h" |
-#include "extensions/browser/api/cast_channel/cast_socket_service.h" |
-#include "extensions/browser/api/cast_channel/cast_socket_service_factory.h" |
-#include "extensions/browser/api/cast_channel/keep_alive_delegate.h" |
-#include "extensions/browser/api/cast_channel/logger.h" |
#include "extensions/browser/event_router.h" |
#include "extensions/common/api/cast_channel/cast_channel.pb.h" |
#include "extensions/common/api/cast_channel/logging.pb.h" |
@@ -39,23 +40,24 @@ const int kDefaultConnectTimeoutMillis = 5000; // 5 seconds. |
namespace extensions { |
+namespace cast_channel = api::cast_channel; |
mark a. foltz
2017/06/01 21:26:35
I think this ends up being very similar to ::cast_
zhaobin
2017/06/01 22:00:38
Done.
|
namespace Close = cast_channel::Close; |
namespace OnError = cast_channel::OnError; |
namespace OnMessage = cast_channel::OnMessage; |
namespace Open = cast_channel::Open; |
namespace Send = cast_channel::Send; |
using ::cast_channel::ChannelError; |
-using cast_channel::CastDeviceCapability; |
-using cast_channel::CastMessage; |
-using cast_channel::CastSocket; |
-using cast_channel::CastSocketImpl; |
-using cast_channel::CastTransport; |
+using ::cast_channel::CastDeviceCapability; |
+using ::cast_channel::CastMessage; |
+using ::cast_channel::CastSocket; |
+using ::cast_channel::CastSocketImpl; |
+using ::cast_channel::CastTransport; |
+using ::cast_channel::KeepAliveDelegate; |
+using ::cast_channel::LastErrors; |
+using ::cast_channel::Logger; |
using cast_channel::ChannelInfo; |
using cast_channel::ConnectInfo; |
using cast_channel::ErrorInfo; |
-using cast_channel::KeepAliveDelegate; |
-using cast_channel::LastErrors; |
-using cast_channel::Logger; |
using cast_channel::MessageInfo; |
using content::BrowserThread; |
@@ -91,10 +93,10 @@ void FillErrorInfo(cast_channel::ChannelError error_state, |
const LastErrors& last_errors, |
ErrorInfo* error_info) { |
error_info->error_state = error_state; |
- if (last_errors.event_type != cast_channel::proto::EVENT_TYPE_UNKNOWN) |
+ if (last_errors.event_type != ::cast_channel::proto::EVENT_TYPE_UNKNOWN) |
error_info->event_type.reset(new int(last_errors.event_type)); |
if (last_errors.challenge_reply_error_type != |
- cast_channel::proto::CHALLENGE_REPLY_ERROR_NONE) { |
+ ::cast_channel::proto::CHALLENGE_REPLY_ERROR_NONE) { |
error_info->challenge_reply_error_type.reset( |
new int(last_errors.challenge_reply_error_type)); |
} |
@@ -177,9 +179,8 @@ CastChannelAsyncApiFunction::CastChannelAsyncApiFunction() |
CastChannelAsyncApiFunction::~CastChannelAsyncApiFunction() { } |
bool CastChannelAsyncApiFunction::PrePrepare() { |
- cast_socket_service_ = |
- api::cast_channel::CastSocketServiceFactory::GetInstance() |
- ->GetForBrowserContext(browser_context()); |
+ cast_socket_service_ = ::cast_channel::CastSocketServiceFactory::GetInstance() |
+ ->GetForBrowserContext(browser_context()); |
DCHECK(cast_socket_service_); |
return true; |
} |