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

Unified Diff: components/cast_channel/logger.h

Issue 2926313002: Revert of [cast_channel] Move cast_channel related files from //extensions to //components (Closed)
Patch Set: 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
« no previous file with comments | « components/cast_channel/keep_alive_delegate_unittest.cc ('k') | components/cast_channel/logger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cast_channel/logger.h
diff --git a/components/cast_channel/logger.h b/components/cast_channel/logger.h
deleted file mode 100644
index 7c4c37ed81d8b5f912ec75d73e95a511a92cd6da..0000000000000000000000000000000000000000
--- a/components/cast_channel/logger.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_CAST_CHANNEL_LOGGER_H_
-#define COMPONENTS_CAST_CHANNEL_LOGGER_H_
-
-#include <stddef.h>
-
-#include <deque>
-#include <map>
-#include <memory>
-#include <string>
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/threading/thread_checker.h"
-#include "components/cast_channel/proto/logging.pb.h"
-
-namespace cast_channel {
-
-struct AuthResult;
-
-// Holds the most recent errors encountered by a CastSocket.
-struct LastErrors {
- public:
- LastErrors();
- ~LastErrors();
-
- // The most recent event that occurred at the time of the error.
- proto::EventType event_type;
-
- // The most recent ChallengeReplyErrorType logged for the socket.
- proto::ChallengeReplyErrorType challenge_reply_error_type;
-
- // The most recent net_return_value logged for the socket.
- int net_return_value;
-};
-
-// Called with events that occur on a Cast Channel and remembers any that
-// warrant reporting to the caller in LastErrors.
-class Logger : public base::RefCountedThreadSafe<Logger> {
- public:
- Logger();
-
- // For events that involves socket / crypto operations that returns a value.
- void LogSocketEventWithRv(int channel_id,
- proto::EventType event_type,
- int rv);
-
- // For AUTH_CHALLENGE_REPLY event.
- void LogSocketChallengeReplyEvent(int channel_id,
- const AuthResult& auth_result);
-
- // Returns the last errors logged for |channel_id|.
- LastErrors GetLastErrors(int channel_id) const;
-
- // Removes a LastErrors entry for |channel_id| if one exists.
- void ClearLastErrors(int channel_id);
-
- private:
- friend class base::RefCountedThreadSafe<Logger>;
- ~Logger();
-
- using LastErrorsMap = std::map<int, LastErrors>;
-
- // Returns a SocketEvent proto with common fields (EventType, timestamp)
- // populated.
- proto::SocketEvent CreateEvent(proto::EventType event_type);
-
- // Uses |event| associated with |channel_id| to update its LastErrors.
- void LogSocketEvent(int channel_id, const proto::SocketEvent& socket_event);
-
- LastErrorsMap last_errors_;
-
- THREAD_CHECKER(thread_checker_);
-
- DISALLOW_COPY_AND_ASSIGN(Logger);
-};
-} // namespace cast_channel
-
-#endif // COMPONENTS_CAST_CHANNEL_LOGGER_H_
« no previous file with comments | « components/cast_channel/keep_alive_delegate_unittest.cc ('k') | components/cast_channel/logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698