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

Unified Diff: components/cast_channel/keep_alive_delegate.cc

Issue 2913033003: [cast_channel] Move cast_channel related files from //extensions to //components (Closed)
Patch Set: fix buildbot compile errors 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
Index: components/cast_channel/keep_alive_delegate.cc
diff --git a/extensions/browser/api/cast_channel/keep_alive_delegate.cc b/components/cast_channel/keep_alive_delegate.cc
similarity index 90%
rename from extensions/browser/api/cast_channel/keep_alive_delegate.cc
rename to components/cast_channel/keep_alive_delegate.cc
index c6803ebc9919cd1a9ba21586acfec881e408b95b..6bcfbeab142dc7e66a17e20ad02d80163eb3c2ab 100644
--- a/extensions/browser/api/cast_channel/keep_alive_delegate.cc
+++ b/components/cast_channel/keep_alive_delegate.cc
@@ -2,21 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "extensions/browser/api/cast_channel/keep_alive_delegate.h"
+#include "components/cast_channel/keep_alive_delegate.h"
#include <string>
#include <utility>
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
-#include "extensions/browser/api/cast_channel/cast_socket.h"
-#include "extensions/browser/api/cast_channel/logger.h"
-#include "extensions/common/api/cast_channel/cast_channel.pb.h"
-#include "extensions/common/api/cast_channel/logging.pb.h"
+#include "base/values.h"
+#include "components/cast_channel/cast_socket.h"
+#include "components/cast_channel/logger.h"
+#include "components/cast_channel/proto/cast_channel.pb.h"
+#include "components/cast_channel/proto/logging.pb.h"
#include "net/base/net_errors.h"
-namespace extensions {
-namespace api {
namespace cast_channel {
namespace {
@@ -88,8 +87,7 @@ KeepAliveDelegate::KeepAliveDelegate(
pong_message_ = CreateKeepAliveMessage(kHeartbeatPongType);
}
-KeepAliveDelegate::~KeepAliveDelegate() {
-}
+KeepAliveDelegate::~KeepAliveDelegate() {}
void KeepAliveDelegate::SetTimersForTest(
std::unique_ptr<base::Timer> injected_ping_timer,
@@ -99,7 +97,7 @@ void KeepAliveDelegate::SetTimersForTest(
}
void KeepAliveDelegate::Start() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!started_);
VLOG(1) << "Starting keep-alive timers.";
@@ -134,7 +132,7 @@ void KeepAliveDelegate::ResetTimers() {
void KeepAliveDelegate::SendKeepAliveMessage(const CastMessage& message,
const char* message_type) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
VLOG(2) << "Sending " << message_type;
socket_->transport()->SendMessage(
message, base::Bind(&KeepAliveDelegate::SendKeepAliveMessageComplete,
@@ -159,7 +157,7 @@ void KeepAliveDelegate::LivenessTimeout() {
// CastTransport::Delegate interface.
void KeepAliveDelegate::OnError(ChannelError error_state) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
VLOG(1) << "KeepAlive::OnError: "
<< ::cast_channel::ChannelErrorToString(error_state);
inner_delegate_->OnError(error_state);
@@ -167,7 +165,7 @@ void KeepAliveDelegate::OnError(ChannelError error_state) {
}
void KeepAliveDelegate::OnMessage(const CastMessage& message) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
VLOG(2) << "KeepAlive::OnMessage : " << message.payload_utf8();
if (started_)
@@ -196,5 +194,3 @@ void KeepAliveDelegate::Stop() {
}
} // namespace cast_channel
-} // namespace api
-} // namespace extensions
« no previous file with comments | « components/cast_channel/keep_alive_delegate.h ('k') | components/cast_channel/keep_alive_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698