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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivityTab.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/webapps/FullScreenActivityTab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivityTab.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivityTab.java
index b56263eb1815623e7f0394a73eaade0107b3163d..74ebf39fded3976ddeb09fac277e16e92f73b658 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivityTab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivityTab.java
@@ -8,6 +8,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.os.StrictMode;
import android.text.TextUtils;
import android.util.Log;
import android.view.ContextMenu;
@@ -141,6 +142,9 @@ public class FullScreenActivityTab extends ChromeTab {
File tabFile = getTabFile(activityDirectory, getId());
FileOutputStream foutput = null;
+ // Temporarily allowing disk access while fixing. TODO: http://crbug.com/525781
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ StrictMode.allowThreadDiskWrites();
try {
foutput = new FileOutputStream(tabFile);
TabState.saveState(foutput, getState(), false);
@@ -150,6 +154,7 @@ public class FullScreenActivityTab extends ChromeTab {
Log.e(TAG, "Failed to save out tab state.", exception);
} finally {
StreamUtil.closeQuietly(foutput);
+ StrictMode.setThreadPolicy(oldPolicy);
}
}

Powered by Google App Engine
This is Rietveld 408576698