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

Unified Diff: mojo/spy/websocket_server.cc

Issue 354043003: Add support for logging information about mojo messages retrieved by the mojo debugger (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed indentation Created 6 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 | « mojo/spy/websocket_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/spy/websocket_server.cc
diff --git a/mojo/spy/websocket_server.cc b/mojo/spy/websocket_server.cc
index 649a135c13e81fb363db3b878ad8833343ce515c..4bea133d6da87f66852f65dd52a25281b55a4bb0 100644
--- a/mojo/spy/websocket_server.cc
+++ b/mojo/spy/websocket_server.cc
@@ -5,12 +5,15 @@
#include "mojo/spy/websocket_server.h"
#include "base/bind.h"
+#include "base/logging.h"
#include "base/strings/stringprintf.h"
+#include "base/time/time.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/server/http_server_request_info.h"
#include "net/server/http_server_response_info.h"
#include "net/socket/tcp_listen_socket.h"
+#include "url/gurl.h"
namespace spy {
@@ -32,6 +35,33 @@ bool WebSocketServer::Start() {
return (error == net::OK);
}
+void WebSocketServer::LogMessageInfo(
+ const mojo::MojoMessageHeader& message_header,
+ const GURL& url,
+ const base::Time& message_time) {
+ base::Time::Exploded exploded;
+ message_time.LocalExplode(&exploded);
+
cpu_(ooo_6.6-7.5) 2014/06/27 01:44:06 assume you have: bool WebSocketServer::connected(
ananta 2014/07/03 00:04:40 Done.
+ DLOG(INFO) << "\n\nStart of message for url :" << url.spec();
+ DLOG(INFO) << "Message Time Hours :" << exploded.hour;
+ DLOG(INFO) << "Message Time Mins :" << exploded.minute;
+ DLOG(INFO) << "Message Time Secs :" << exploded.second;
+ DLOG(INFO) << "Message Bytes : " << message_header.num_bytes;
+ DLOG(INFO) << "Message Fields : " << message_header.num_fields;
+ DLOG(INFO) << "Message name : " << message_header.name;
+ if (message_header.num_fields == 3) {
+ DLOG(INFO) << "Message has request id";
+ DLOG(INFO) << "Message Request ID : "
+ << message_header.request_id;
+ }
+ if (message_header.flags & mojo::kMessageExpectsResponse) {
+ DLOG(INFO) << "Message expects response";
+ } else if (message_header.flags & mojo::kMessageIsResponse) {
+ DLOG(INFO) << "Message is response";
+ }
+ DLOG(INFO) << "End of message : ";
+}
+
void WebSocketServer::OnHttpRequest(
int connection_id,
const net::HttpServerRequestInfo& info) {
« no previous file with comments | « mojo/spy/websocket_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698