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

Side by Side Diff: extensions/browser/api/cast_channel/logger.h

Issue 456213002: Cast channel: Add cast.channel.getLogs extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years, 4 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
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 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // For AUTH_CHALLENGE_REPLY event. 63 // For AUTH_CHALLENGE_REPLY event.
64 void LogSocketChallengeReplyEvent(int channel_id, 64 void LogSocketChallengeReplyEvent(int channel_id,
65 const AuthResult& auth_result); 65 const AuthResult& auth_result);
66 66
67 void LogSocketEventForMessage(int channel_id, 67 void LogSocketEventForMessage(int channel_id,
68 proto::EventType event_type, 68 proto::EventType event_type,
69 const std::string& message_namespace, 69 const std::string& message_namespace,
70 const std::string& details); 70 const std::string& details);
71 71
72 // Assembles logs collected so far and return it as a serialized Log proto. 72 // Assembles logs collected so far and return it as a serialized Log proto,
73 // |output|: Where serialized contents will be assigned to. 73 // compressed in gzip format.
74 // Returns true if serialization is successful. 74 // If serialization or compression failed, returns a NULL pointer.
75 // Contents in |output| is valid only if function returns true. 75 // |length|: If successful, assigned with size of compressed content.
76 // TODO(imcheng): Add compression. 76 scoped_ptr<char[]> GetLogs(int* length) const;
77 bool LogToString(std::string* output) const;
78 77
79 // Clears the internal map. 78 // Clears the internal map.
80 void Reset(); 79 void Reset();
81 80
82 private: 81 private:
83 friend class base::RefCounted<Logger>; 82 friend class base::RefCounted<Logger>;
84 ~Logger(); 83 ~Logger();
85 84
86 struct AggregatedSocketEventLog { 85 struct AggregatedSocketEventLog {
87 public: 86 public:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 122
124 base::ThreadChecker thread_checker_; 123 base::ThreadChecker thread_checker_;
125 124
126 DISALLOW_COPY_AND_ASSIGN(Logger); 125 DISALLOW_COPY_AND_ASSIGN(Logger);
127 }; 126 };
128 } // namespace cast_channel 127 } // namespace cast_channel
129 } // namespace api 128 } // namespace api
130 } // namespace extensions 129 } // namespace extensions
131 130
132 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ 131 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698