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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java

Issue 1178253005: Use Chromium's logging utility for content files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
Index: content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java b/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java
index 2fe14d0fcc85e83b25a19b6b0abcb02e7d9b320f..b81e87fe97f6b1eb70cb7677bf32766d6463fc00 100644
--- a/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java
@@ -12,10 +12,10 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.ParcelFileDescriptor;
import android.text.TextUtils;
-import android.util.Log;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
+import org.chromium.base.Log;
import org.chromium.base.PathUtils;
import org.chromium.base.VisibleForTesting;
@@ -33,7 +33,7 @@ import java.util.Map;
@JNINamespace("content")
class MediaResourceGetter {
- private static final String TAG = "MediaResourceGetter";
+ private static final String TAG = "cr.MediaResourceGetter";
private static final MediaMetadata EMPTY_METADATA = new MediaMetadata(0, 0, 0, false);
private final MediaMetadataRetriever mRetriever = new MediaMetadataRetriever();
@@ -155,7 +155,7 @@ class MediaResourceGetter {
try {
durationMillis = Integer.parseInt(durationString);
} catch (NumberFormatException e) {
- Log.w(TAG, "non-numeric duration: " + durationString);
+ Log.w(TAG, "non-numeric duration: %s", durationString);
return EMPTY_METADATA;
}
@@ -174,7 +174,7 @@ class MediaResourceGetter {
try {
width = Integer.parseInt(widthString);
} catch (NumberFormatException e) {
- Log.w(TAG, "non-numeric width: " + widthString);
+ Log.w(TAG, "non-numeric width: %s", widthString);
return EMPTY_METADATA;
}
@@ -187,15 +187,15 @@ class MediaResourceGetter {
try {
height = Integer.parseInt(heightString);
} catch (NumberFormatException e) {
- Log.w(TAG, "non-numeric height: " + heightString);
+ Log.w(TAG, "non-numeric height: %s", heightString);
return EMPTY_METADATA;
}
}
MediaMetadata result = new MediaMetadata(durationMillis, width, height, true);
- Log.d(TAG, "extracted valid metadata: " + result.toString());
+ Log.d(TAG, "extracted valid metadata: %s", result);
return result;
} catch (RuntimeException e) {
- Log.e(TAG, "Unable to extract metadata: " + e.getMessage());
+ Log.e(TAG, "Unable to extract metadata: %s", e.getMessage());
return EMPTY_METADATA;
}
}
@@ -206,7 +206,7 @@ class MediaResourceGetter {
try {
uri = URI.create(url);
} catch (IllegalArgumentException e) {
- Log.e(TAG, "Cannot parse uri: " + e.getMessage());
+ Log.e(TAG, "Cannot parse uri: %s", e.getMessage());
return false;
}
String scheme = uri.getScheme();
@@ -224,7 +224,7 @@ class MediaResourceGetter {
configure(file.getAbsolutePath());
return true;
} catch (RuntimeException e) {
- Log.e(TAG, "Error configuring data source: " + e.getMessage());
+ Log.e(TAG, "Error configuring data source: %s", e.getMessage());
return false;
}
}
@@ -248,7 +248,7 @@ class MediaResourceGetter {
configure(url, headersMap);
return true;
} catch (RuntimeException e) {
- Log.e(TAG, "Error configuring data source: " + e.getMessage());
+ Log.e(TAG, "Error configuring data source: %s", e.getMessage());
return false;
}
}
@@ -312,7 +312,7 @@ class MediaResourceGetter {
// Note that canonicalized directory paths always end with '/'.
List<String> acceptablePaths = canonicalize(getRawAcceptableDirectories(context));
acceptablePaths.add(getExternalStorageDirectory());
- Log.d(TAG, "canonicalized file path: " + path);
+ Log.d(TAG, "canonicalized file path: %s", path);
for (String acceptablePath : acceptablePaths) {
if (path.startsWith(acceptablePath)) {
return true;
@@ -382,7 +382,7 @@ class MediaResourceGetter {
try {
parcelFd.close();
} catch (IOException e) {
- Log.e(TAG, "Failed to close file descriptor: " + e);
+ Log.e(TAG, "Failed to close file descriptor: %s", e);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698