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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastRouteController.java

Issue 1419663009: Cast Media Router: add Debug Log messages and mark some error messages as such. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastRouteController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastRouteController.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastRouteController.java
index f9a24a0bdaab4759b59798024827a9c09c0c0224..e776aebaf2a5099029dcf3ebffda21ae4b1be5c4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastRouteController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastRouteController.java
@@ -81,6 +81,9 @@ public class CastRouteController implements RouteController, MediaNotificationLi
@Override
public void onMessageReceived(CastDevice castDevice, String namespace, String message) {
+ Log.d(TAG, "Received message from Cast device: namespace=\"" + namespace
+ + "\" message=\"" + message + "\"");
+
if (MEDIA_NAMESPACE.equals(namespace) || RECEIVER_NAMESPACE.equals(namespace)) {
mSession.onMessage("v2_message", message);
} else {
@@ -339,7 +342,7 @@ public class CastRouteController implements RouteController, MediaNotificationLi
jsonMessage.put("message", message);
onMessage("app_message", jsonMessage.toString());
} catch (JSONException e) {
- Log.d(TAG, "Failed to create the message wrapper", e);
+ Log.e(TAG, "Failed to create the message wrapper", e);
}
}
@@ -386,7 +389,7 @@ public class CastRouteController implements RouteController, MediaNotificationLi
} else if ("app_message".equals(messageType)) {
success = handleAppMessage(message, jsonMessage);
} else {
- Log.d(TAG, "Unsupported message: %s", message);
+ Log.e(TAG, "Unsupported message: %s", message);
return false;
}
} catch (JSONException e) {
@@ -425,6 +428,8 @@ public class CastRouteController implements RouteController, MediaNotificationLi
throws JSONException {
assert "v2_message".equals(jsonMessage.getString("type"));
+ Log.d(TAG, "Received message from client: " + jsonMessage);
+
String clientId = jsonMessage.getString("clientId");
if (!mClients.contains(clientId)) return false;
@@ -517,6 +522,8 @@ public class CastRouteController implements RouteController, MediaNotificationLi
// See: https://crbug.com/548822
if (!message.has("requestId")) message.put("requestId", 0);
+ Log.d(TAG, "Sending message to Cast device: " + message);
+
try {
Cast.CastApi.sendMessage(mApiClient, namespace, message.toString())
.setResultCallback(
@@ -583,6 +590,8 @@ public class CastRouteController implements RouteController, MediaNotificationLi
Log.e(TAG, "Failed to build the reply: " + e);
}
+ Log.d(TAG, "Sending message to client: " + json);
+
return json.toString();
}
@@ -598,7 +607,7 @@ public class CastRouteController implements RouteController, MediaNotificationLi
"update_session", buildSessionMessage(), clientId, -1));
}
} catch (IllegalStateException e) {
- Log.d(TAG, "Can't get application status", e);
+ Log.e(TAG, "Can't get application status", e);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698