summaryrefslogtreecommitdiff
path: root/utils/ipc/tools
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-09-08 20:47:19 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-11-11 19:22:37 +0900
commit82ba73535c0966e8ae8fb50db1ea23534d827717 (patch)
treef75b0d7f3933369872157105f1e467b71430e8cf /utils/ipc/tools
parent3d624b745b31383dbcd94d96246fab865820085f (diff)
utils: ipc: import mojo
Import mojo from the Chromium repository, so that we can use it for generating code for the IPC mechanism. The commit from which this was taken is: a079161ec8c6907b883f9cb84fc8c4e7896cb1d0 "Add PPAPI constructs for sending focus object to PdfAccessibilityTree" This tree has been pruned to remove directories that didn't have any necessary code: - mojo/* except for mojo/public - mojo core, docs, and misc files - mojo/public/* except for mojo/public/{tools,LICENSE} - language bindings for IPC, tests, and some mojo internals - mojo/public/tools/{fuzzers,chrome_ipc} - mojo/public/tools/bindings/generators - code generation for other languages No files were modified. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'utils/ipc/tools')
-rw-r--r--utils/ipc/tools/diagnosis/crbug_1001171.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/utils/ipc/tools/diagnosis/crbug_1001171.py b/utils/ipc/tools/diagnosis/crbug_1001171.py
new file mode 100644
index 00000000..478fb8c1
--- /dev/null
+++ b/utils/ipc/tools/diagnosis/crbug_1001171.py
@@ -0,0 +1,51 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Helper context wrapper for diagnosing crbug.com/1001171.
+
+This module and all uses thereof can and should be removed once
+crbug.com/1001171 has been resolved.
+"""
+
+from __future__ import print_function
+
+import contextlib
+import os
+import sys
+
+
+@contextlib.contextmanager
+def DumpStateOnLookupError():
+ """Prints potentially useful state info in the event of a LookupError."""
+ try:
+ yield
+ except LookupError:
+ print('LookupError diagnosis for crbug.com/1001171:')
+ for path_index, path_entry in enumerate(sys.path):
+ desc = 'unknown'
+ if not os.path.exists(path_entry):
+ desc = 'missing'
+ elif os.path.islink(path_entry):
+ desc = 'link -> %s' % os.path.realpath(path_entry)
+ elif os.path.isfile(path_entry):
+ desc = 'file'
+ elif os.path.isdir(path_entry):
+ desc = 'dir'
+ print(' sys.path[%d]: %s (%s)' % (path_index, path_entry, desc))
+
+ real_path_entry = os.path.realpath(path_entry)
+ if (path_entry.endswith(os.path.join('lib', 'python2.7'))
+ and os.path.isdir(real_path_entry)):
+ encodings_dir = os.path.realpath(
+ os.path.join(real_path_entry, 'encodings'))
+ if os.path.exists(encodings_dir):
+ if os.path.isdir(encodings_dir):
+ print(' %s contents: %s' % (encodings_dir,
+ str(os.listdir(encodings_dir))))
+ else:
+ print(' %s exists but is not a directory' % encodings_dir)
+ else:
+ print(' %s missing' % encodings_dir)
+
+ raise