diff --git a/BUILD.gn b/BUILD.gn index 28437fe4ec..6a58719f3c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1279,8 +1279,9 @@ group("devtools_closure_compile") { "//testing/scripts/common.py", "//testing/scripts/run_devtools_check.py", "//testing/xvfb.py", - "//third_party/blink/renderer/core/inspector/browser_protocol.json", - "//v8/src/inspector/js_protocol.json", + "//third_party/blink/renderer/core/inspector/browser_protocol.pdl", + "//third_party/inspector_protocol/pdl.py", + "//v8/src/inspector/js_protocol.pdl", ] } diff --git a/protocol.json b/protocol.json index 47697fe171..906fe0d57d 100644 --- a/protocol.json +++ b/protocol.json @@ -1,12 +1,12 @@ The protocol.json has split into separate files. https://crbug.com/580337 One for the browser, one for a V8 javascript environment: - src/third_party/blink/renderer/core/inspector/browser_protocol.json - src/v8/src/inspector/js_protocol.json + src/third_party/blink/renderer/core/inspector/browser_protocol.pdl + src/v8/src/inspector/js_protocol.pdl Browsable here: - https://chromium.googlesource.com/chromium/src/+/master/third_party/blink/renderer/core/inspector/browser_protocol.json - https://chromium.googlesource.com/v8/v8/+/master/src/inspector/js_protocol.json + https://chromium.googlesource.com/chromium/src/+/master/third_party/blink/renderer/core/inspector/browser_protocol.pdl + https://chromium.googlesource.com/v8/v8/+/master/src/inspector/js_protocol.pdl More details on the protocol: https://developer.chrome.com/devtools/docs/debugger-protocol diff --git a/scripts/build/generate_protocol_externs.py b/scripts/build/generate_protocol_externs.py index 418361ba70..1725fa048b 100755 --- a/scripts/build/generate_protocol_externs.py +++ b/scripts/build/generate_protocol_externs.py @@ -28,12 +28,21 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os +import os.path as path import re +import sys try: import json except ImportError: import simplejson as json +sys.path.append( + path.normpath( + path.join( + path.dirname(path.abspath(__file__)), + os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, 'inspector_protocol'))) +import pdl # pylint: disable=F0401 + type_traits = { "any": "*", "string": "string", @@ -97,8 +106,8 @@ def param_name(param): def load_schema(file, domains): input_file = open(file, "r") - json_string = input_file.read() - parsed_json = json.loads(json_string) + parsed_json = pdl.loads(input_file.read(), file) + input_file.close() domains.extend(parsed_json["domains"]) diff --git a/scripts/compile_frontend.py b/scripts/compile_frontend.py index 1c45aa09ed..223b014226 100755 --- a/scripts/compile_frontend.py +++ b/scripts/compile_frontend.py @@ -334,8 +334,8 @@ def main(): protocol_externs_file = args.protocol_externs_file else: generate_protocol_externs.generate_protocol_externs(protocol_externs_file, - path.join(inspector_path, 'browser_protocol.json'), - path.join(v8_inspector_path, 'js_protocol.json')) + path.join(inspector_path, 'browser_protocol.pdl'), + path.join(v8_inspector_path, 'js_protocol.pdl')) loader = modular_build.DescriptorLoader(devtools_frontend_path) descriptors = loader.load_applications(application_descriptors) modules_by_name = descriptors.modules