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

Unified Diff: base/android/java/src/org/chromium/base/ContextUtils.java

Issue 2247143004: Remove app context init from LibraryLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix per review. Created 4 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: base/android/java/src/org/chromium/base/ContextUtils.java
diff --git a/base/android/java/src/org/chromium/base/ContextUtils.java b/base/android/java/src/org/chromium/base/ContextUtils.java
index 252b50bc9bd6c06a72997cd40d60af4ddb3952be..4b615cb3ea93160c5d55ad37905335d1a64c17db 100644
--- a/base/android/java/src/org/chromium/base/ContextUtils.java
+++ b/base/android/java/src/org/chromium/base/ContextUtils.java
@@ -54,14 +54,7 @@ public class ContextUtils {
// Conceding that occasionally in tests, native is loaded before the browser process is
// started, in which case the browser process re-sets the application context.
if (sApplicationContext != null && sApplicationContext != appContext) {
- // For webview, sometimes the client app overrides getApplicationContext in a poor way
- // and fails to make it idempotent. We cannot crash in this scenario, so we ignore new
- // assignments and assume that the first initialized context is the right application
- // object. See http://crbug.com/637389.
- // TODO(wnwen): Add runtime exception back once the underlying issue in LibraryLoader is
- // fixed.
- Log.d(TAG, "Multiple contexts detected, ignoring new application context.");
- return;
+ throw new RuntimeException("Attempting to set multiple global application contexts.");
}
initJavaSideApplicationContext(appContext);
}

Powered by Google App Engine
This is Rietveld 408576698