xref: /aosp_15_r20/external/libchrome/libchrome_tools/patch/mojo.patch (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker# Local patches for libmojo.
2*635a8641SAndroid Build Coastguard Worker
3*635a8641SAndroid Build Coastguard Worker--- a/base/android/jni_android.cc
4*635a8641SAndroid Build Coastguard Worker+++ b/base/android/jni_android.cc
5*635a8641SAndroid Build Coastguard Worker@@ -253,7 +253,11 @@ void CheckException(JNIEnv* env) {
6*635a8641SAndroid Build Coastguard Worker   }
7*635a8641SAndroid Build Coastguard Worker
8*635a8641SAndroid Build Coastguard Worker   // Now, feel good about it and die.
9*635a8641SAndroid Build Coastguard Worker-  LOG(FATAL) << "Please include Java exception stack in crash report";
10*635a8641SAndroid Build Coastguard Worker+  // TODO(lhchavez): Remove this hack. See b/28814913 for details.
11*635a8641SAndroid Build Coastguard Worker+  if (java_throwable)
12*635a8641SAndroid Build Coastguard Worker+    LOG(FATAL) << GetJavaExceptionInfo(env, java_throwable);
13*635a8641SAndroid Build Coastguard Worker+  else
14*635a8641SAndroid Build Coastguard Worker+    LOG(FATAL) << "Unhandled exception";
15*635a8641SAndroid Build Coastguard Worker }
16*635a8641SAndroid Build Coastguard Worker
17*635a8641SAndroid Build Coastguard Worker std::string GetJavaExceptionInfo(JNIEnv* env, jthrowable java_throwable) {
18*635a8641SAndroid Build Coastguard Worker--- a/build/android/gyp/util/build_utils.py
19*635a8641SAndroid Build Coastguard Worker+++ b/build/android/gyp/util/build_utils.py
20*635a8641SAndroid Build Coastguard Worker@@ -25,8 +25,16 @@ import zipfile
21*635a8641SAndroid Build Coastguard Worker # Some clients do not add //build/android/gyp to PYTHONPATH.
22*635a8641SAndroid Build Coastguard Worker import md5_check  # pylint: disable=relative-import
23*635a8641SAndroid Build Coastguard Worker
24*635a8641SAndroid Build Coastguard Worker-sys.path.append(os.path.join(os.path.dirname(__file__),
25*635a8641SAndroid Build Coastguard Worker-                             os.pardir, os.pardir, os.pardir))
26*635a8641SAndroid Build Coastguard Worker+# pylib conflicts with mojo/public/tools/bindings/pylib. Prioritize
27*635a8641SAndroid Build Coastguard Worker+# build/android/pylib.
28*635a8641SAndroid Build Coastguard Worker+# PYTHONPATH wouldn't help in this case, because soong put source files under
29*635a8641SAndroid Build Coastguard Worker+# temp directory for each build, so the abspath is unknown until the
30*635a8641SAndroid Build Coastguard Worker+# execution.
31*635a8641SAndroid Build Coastguard Worker+#sys.path.append(os.path.join(os.path.dirname(__file__),
32*635a8641SAndroid Build Coastguard Worker+#                             os.pardir, os.pardir, os.pardir))
33*635a8641SAndroid Build Coastguard Worker+sys.path.insert(0, os.path.join(os.path.dirname(__file__),
34*635a8641SAndroid Build Coastguard Worker+                                os.pardir, os.pardir))
35*635a8641SAndroid Build Coastguard Worker+
36*635a8641SAndroid Build Coastguard Worker import gn_helpers
37*635a8641SAndroid Build Coastguard Worker
38*635a8641SAndroid Build Coastguard Worker # Definition copied from pylib/constants/__init__.py to avoid adding
39