Roll src/third_party/WebKit a3b4a2e:7441784 (svn 202551:202552)
[chromium-blink-merge.git] / extensions / browser / api / cast_channel / logger_util.h
blob2a9f29355b45270f29361a4c60d47b33d51bdf27
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.
5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_
8 #include "extensions/common/api/cast_channel.h"
9 #include "extensions/common/api/cast_channel/logging.pb.h"
11 namespace extensions {
12 namespace api {
13 namespace cast_channel {
14 // Converts an IDL "ChannelError" to a proto enum "ErrorState".
15 proto::ErrorState ErrorStateToProto(ChannelError state);
17 // Converts an IDL "ReadyState" to a proto enum "ReadyState".
18 proto::ReadyState ReadyStateToProto(ReadyState state);
20 // Holds the most recent errors encountered by a CastSocket.
21 struct LastErrors {
22 public:
23 LastErrors();
24 ~LastErrors();
26 // The most recent event that occurred at the time of the error.
27 proto::EventType event_type;
29 // The most recent ChallengeReplyErrorType logged for the socket.
30 proto::ChallengeReplyErrorType challenge_reply_error_type;
32 // The most recent net_return_value logged for the socket.
33 int net_return_value;
35 // The most recent NSS error logged for the socket.
36 int nss_error_code;
39 } // namespace cast_channel
40 } // namespace api
41 } // namespace extensions
43 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_