OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/api/cast_channel/cast_transport.h" | 5 #include "extensions/browser/api/cast_channel/cast_transport.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
11 #include "base/numerics/safe_conversions.h" | 11 #include "base/numerics/safe_conversions.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "extensions/browser/api/cast_channel/cast_framer.h" | 13 #include "extensions/browser/api/cast_channel/cast_framer.h" |
14 #include "extensions/browser/api/cast_channel/cast_message_util.h" | 14 #include "extensions/browser/api/cast_channel/cast_message_util.h" |
15 #include "extensions/browser/api/cast_channel/logger.h" | 15 #include "extensions/browser/api/cast_channel/logger.h" |
16 #include "extensions/browser/api/cast_channel/logger_util.h" | 16 #include "extensions/browser/api/cast_channel/logger_util.h" |
17 #include "extensions/common/api/cast_channel/cast_channel.pb.h" | 17 #include "extensions/common/api/cast_channel/cast_channel.pb.h" |
18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
19 #include "net/socket/socket.h" | 19 #include "net/socket/socket.h" |
20 | 20 |
21 #define VLOG_WITH_CONNECTION(level) \ | 21 #define VLOG_WITH_CONNECTION(level) \ |
22 VLOG(level) << "[" << ip_endpoint_.ToString() << ", auth=" << channel_auth_ \ | 22 VLOG(level) << "[" << ip_endpoint_.ToString() << ", auth=" << channel_auth_ \ |
23 << "] " | 23 << "] " |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 namespace core_api { | 26 namespace api { |
27 namespace cast_channel { | 27 namespace cast_channel { |
28 | 28 |
29 CastTransportImpl::CastTransportImpl(net::Socket* socket, | 29 CastTransportImpl::CastTransportImpl(net::Socket* socket, |
30 int channel_id, | 30 int channel_id, |
31 const net::IPEndPoint& ip_endpoint, | 31 const net::IPEndPoint& ip_endpoint, |
32 ChannelAuthType channel_auth, | 32 ChannelAuthType channel_auth, |
33 scoped_refptr<Logger> logger) | 33 scoped_refptr<Logger> logger) |
34 : started_(false), | 34 : started_(false), |
35 socket_(socket), | 35 socket_(socket), |
36 write_state_(WRITE_STATE_NONE), | 36 write_state_(WRITE_STATE_NONE), |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 | 443 |
444 int CastTransportImpl::DoReadError(int result) { | 444 int CastTransportImpl::DoReadError(int result) { |
445 VLOG_WITH_CONNECTION(2) << "DoReadError"; | 445 VLOG_WITH_CONNECTION(2) << "DoReadError"; |
446 DCHECK_NE(CHANNEL_ERROR_NONE, error_state_); | 446 DCHECK_NE(CHANNEL_ERROR_NONE, error_state_); |
447 DCHECK_LE(result, 0); | 447 DCHECK_LE(result, 0); |
448 return net::ERR_FAILED; | 448 return net::ERR_FAILED; |
449 } | 449 } |
450 | 450 |
451 } // namespace cast_channel | 451 } // namespace cast_channel |
452 } // namespace core_api | 452 } // namespace api |
453 } // namespace extensions | 453 } // namespace extensions |
OLD | NEW |