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

Side by Side Diff: extensions/browser/api/cast_channel/logger_util.cc

Issue 2688463003: [chrome.cast.channel] Remove event logging. (Closed)
Patch Set: Remove errors object when socket is closed Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "extensions/browser/api/cast_channel/logger_util.h"
6 #include "extensions/common/api/cast_channel/logging.pb.h"
7 #include "net/base/net_errors.h"
8
9 namespace extensions {
10 namespace api {
11 namespace cast_channel {
12 LastErrors::LastErrors()
13 : event_type(proto::EVENT_TYPE_UNKNOWN),
14 challenge_reply_error_type(proto::CHALLENGE_REPLY_ERROR_NONE),
15 net_return_value(net::OK) {}
16
17 LastErrors::~LastErrors() {
18 }
19
20 proto::ErrorState ErrorStateToProto(ChannelError state) {
21 switch (state) {
22 case CHANNEL_ERROR_NONE:
23 return proto::CHANNEL_ERROR_NONE;
24 case CHANNEL_ERROR_CHANNEL_NOT_OPEN:
25 return proto::CHANNEL_ERROR_CHANNEL_NOT_OPEN;
26 case CHANNEL_ERROR_AUTHENTICATION_ERROR:
27 return proto::CHANNEL_ERROR_AUTHENTICATION_ERROR;
28 case CHANNEL_ERROR_CONNECT_ERROR:
29 return proto::CHANNEL_ERROR_CONNECT_ERROR;
30 case CHANNEL_ERROR_SOCKET_ERROR:
31 return proto::CHANNEL_ERROR_SOCKET_ERROR;
32 case CHANNEL_ERROR_TRANSPORT_ERROR:
33 return proto::CHANNEL_ERROR_TRANSPORT_ERROR;
34 case CHANNEL_ERROR_INVALID_MESSAGE:
35 return proto::CHANNEL_ERROR_INVALID_MESSAGE;
36 case CHANNEL_ERROR_INVALID_CHANNEL_ID:
37 return proto::CHANNEL_ERROR_INVALID_CHANNEL_ID;
38 case CHANNEL_ERROR_CONNECT_TIMEOUT:
39 return proto::CHANNEL_ERROR_CONNECT_TIMEOUT;
40 case CHANNEL_ERROR_UNKNOWN:
41 return proto::CHANNEL_ERROR_UNKNOWN;
42 default:
43 NOTREACHED();
44 return proto::CHANNEL_ERROR_NONE;
45 }
46 }
47
48 proto::ReadyState ReadyStateToProto(ReadyState state) {
49 switch (state) {
50 case READY_STATE_NONE:
51 return proto::READY_STATE_NONE;
52 case READY_STATE_CONNECTING:
53 return proto::READY_STATE_CONNECTING;
54 case READY_STATE_OPEN:
55 return proto::READY_STATE_OPEN;
56 case READY_STATE_CLOSING:
57 return proto::READY_STATE_CLOSING;
58 case READY_STATE_CLOSED:
59 return proto::READY_STATE_CLOSED;
60 default:
61 NOTREACHED();
62 return proto::READY_STATE_NONE;
63 }
64 }
65 } // namespace cast_channel
66 } // namespace api
67 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698