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

Unified Diff: extensions/browser/api/cast_channel/cast_socket.cc

Issue 555283002: Create new class "CastTransport", which encapsulates the message read and write event loops. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback addressed. Created 6 years, 3 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_socket.cc
diff --git a/extensions/browser/api/cast_channel/cast_socket.cc b/extensions/browser/api/cast_channel/cast_socket.cc
index 163fdb0a885f7816e3bb285ca6e5c33db2712d08..e661dbc04bef775159829a0f9fc3300b7bfb45ad 100644
--- a/extensions/browser/api/cast_channel/cast_socket.cc
+++ b/extensions/browser/api/cast_channel/cast_socket.cc
@@ -209,9 +209,8 @@ void CastSocket::Connect(const net::CompletionCallback& callback) {
void CastSocket::PostTaskToStartConnectLoop(int result) {
DCHECK(CalledOnValidThread());
DCHECK(connect_loop_callback_.IsCancelled());
- connect_loop_callback_.Reset(base::Bind(&CastSocket::DoConnectLoop,
- base::Unretained(this),
- result));
+ connect_loop_callback_.Reset(
+ base::Bind(&CastSocket::DoConnectLoop, base::Unretained(this), result));
base::MessageLoop::current()->PostTask(FROM_HERE,
connect_loop_callback_.callback());
}
@@ -647,8 +646,8 @@ int CastSocket::DoWriteError(int result) {
void CastSocket::PostTaskToStartReadLoop() {
DCHECK(CalledOnValidThread());
DCHECK(read_loop_callback_.IsCancelled());
- read_loop_callback_.Reset(base::Bind(&CastSocket::StartReadLoop,
- base::Unretained(this)));
+ read_loop_callback_.Reset(
+ base::Bind(&CastSocket::StartReadLoop, base::Unretained(this)));
base::MessageLoop::current()->PostTask(FROM_HERE,
read_loop_callback_.callback());
}
@@ -862,7 +861,8 @@ void CastSocket::SetWriteState(proto::WriteState write_state) {
}
CastSocket::WriteRequest::WriteRequest(const net::CompletionCallback& callback)
- : callback(callback) { }
+ : callback(callback) {
+}
bool CastSocket::WriteRequest::SetContent(const CastMessage& message_proto) {
DCHECK(!io_buffer.get());
@@ -876,7 +876,8 @@ bool CastSocket::WriteRequest::SetContent(const CastMessage& message_proto) {
return true;
}
-CastSocket::WriteRequest::~WriteRequest() { }
+CastSocket::WriteRequest::~WriteRequest() {
+}
Wez 2014/09/25 02:09:15 nit: Blank between this closing brace and the firs
Kevin M 2014/09/25 17:53:04 Done.
} // namespace cast_channel
} // namespace core_api
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698