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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/WebappAuthenticator.java

Issue 1334533004: Hide existing StrictMode violations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes per review. Created 5 years, 3 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: chrome/android/java/src/org/chromium/chrome/browser/WebappAuthenticator.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WebappAuthenticator.java b/chrome/android/java/src/org/chromium/chrome/browser/WebappAuthenticator.java
index 480f946a3e7d3e045867463a2fadd42c07c1d3c8..3c7a00e85e6d5e027f2b4e91661bfeda33b0b22f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/WebappAuthenticator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/WebappAuthenticator.java
@@ -7,6 +7,7 @@ package org.chromium.chrome.browser;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.AsyncTask;
+import android.os.StrictMode;
import android.util.Log;
import org.chromium.base.SecureRandomInitializer;
@@ -54,7 +55,14 @@ public class WebappAuthenticator {
* @return true if the MAC is a valid MAC for the URL, false otherwise.
*/
public static boolean isUrlValid(Context context, String url, byte[] mac) {
- byte[] goodMac = getMacForUrl(context, url);
+ byte[] goodMac = null;
+ // Temporarily allowing disk access while fixing. TODO: http://crbug.com/525785
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ try {
+ goodMac = getMacForUrl(context, url);
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy);
+ }
if (goodMac == null) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698