Skip to content

Commit

Permalink
Revert "Move browser_protocol.pdl to third_party/blink/public/devtool…
Browse files Browse the repository at this point in the history
…s_protocol"

This reverts commit 3e9d66e.

Reason for revert: Widespread bot failures for Step "isolate tests"

error like:

isolate: isolate /b/s/w/ir/cache/builder/src/out/Release/devtools_type_check.isolate: partitioning deps: lstat /b/s/w/ir/cache/builder/src/third_party/blink/renderer/core/inspector/browser_protocol.pdl: no such file or directory

Bug: 1028446

Original change's description:
> Move browser_protocol.pdl to third_party/blink/public/devtools_protocol
> 
> Bug: 1018108
> 
> This still retains a copy of protocol.json for compatibility with
> devtools front_end.
> Also, remove a presubmit for front-end compilation upon a change to PDL
> since the front-end is in another repository now.
> 
> Change-Id: I2faea62feca80776d2fc0a0b4ea00a90439ae005
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1898538
> Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#718903}

TBR=dgozman@chromium.org,caseq@chromium.org,pfeldman@chromium.org,jochen@chromium.org

Change-Id: I39435e4be7dde62ffd48d1f72a0ecbbac9165ae1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1018108
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935479
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718977}
  • Loading branch information
tapted authored and Commit Bot committed Nov 26, 2019
1 parent 8aeceec commit ec3649f
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 79 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/devtools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ if (!is_android) {
script = _inspector_protocol + "/concatenate_protocols.py"

deps = [
"//third_party/blink/public/devtools_protocol:protocol_version",
"//third_party/blink/renderer/core/inspector:protocol_version",
]

_blink_protocol_path =
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json"
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json"
inputs = [
_blink_protocol_path,
]
Expand Down
4 changes: 2 additions & 2 deletions components/autofill_assistant/browser/devtools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ foreach(domain, devtools_domains) {
action("gen_devtools_client_api") {
script = "devtools_api/client_api_generator.py"
deps = [
"//third_party/blink/public/devtools_protocol:protocol_version",
"//third_party/blink/renderer/core/inspector:protocol_version",
]
inputs = [
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json",
]

outputs = generated_devtools_api
Expand Down
10 changes: 5 additions & 5 deletions content/browser/devtools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ grit("devtools_resources") {
grit_flags = [
"-E",
"protocol_file=" + rebase_path(
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json",
root_build_dir),
]

defines =
[ "SHARED_INTERMEDIATE_DIR=" + rebase_path(root_gen_dir, root_build_dir) ]

deps = [
"//third_party/blink/public/devtools_protocol:protocol_version",
"//third_party/blink/renderer/core/inspector:protocol_version",

# This is the action that generates out .grd input file.
"//third_party/blink/public:blink_generate_devtools_grd",
Expand All @@ -47,10 +47,10 @@ grit("devtools_resources") {
inspector_protocol_generate("protocol_sources") {
visibility = [ "//content/browser" ]
deps = [
"//third_party/blink/public/devtools_protocol:protocol_version",
"//third_party/blink/renderer/core/inspector:protocol_version",
]
_blink_protocol_path = rebase_path(
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json",
root_build_dir)

inspector_protocol_dir = "//third_party/inspector_protocol"
Expand All @@ -59,7 +59,7 @@ inspector_protocol_generate("protocol_sources") {
config_values = [ "protocol.path=$_blink_protocol_path" ]

inputs = [
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json",
config_file,
]

Expand Down
10 changes: 5 additions & 5 deletions headless/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ foreach(domain, devtools_domains) {
action("gen_devtools_client_api") {
script = "lib/browser/devtools_api/client_api_generator.py"
deps = [
"//third_party/blink/public/devtools_protocol:protocol_version",
"//third_party/blink/renderer/core/inspector:protocol_version",
]
inputs = [
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json",
]

outputs = generated_devtools_api
Expand Down Expand Up @@ -213,10 +213,10 @@ if (headless_fontconfig_utils && !is_fuchsia) {
inspector_protocol_generate("protocol_sources") {
visibility = [ "//headless:headless_shared_sources" ]
deps = [
"//third_party/blink/public/devtools_protocol:protocol_version",
"//third_party/blink/renderer/core/inspector:protocol_version",
]
_blink_protocol_path = rebase_path(
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json",
root_build_dir)

inspector_protocol_dir = "//third_party/inspector_protocol"
Expand All @@ -225,7 +225,7 @@ inspector_protocol_generate("protocol_sources") {
config_values = [ "protocol.path=$_blink_protocol_path" ]

inputs = [
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
"$root_gen_dir/third_party/blink/renderer/core/inspector/protocol.json",
config_file,
]

Expand Down
48 changes: 0 additions & 48 deletions third_party/blink/public/devtools_protocol/BUILD.gn

This file was deleted.

6 changes: 0 additions & 6 deletions third_party/blink/public/devtools_protocol/OWNERS

This file was deleted.

46 changes: 36 additions & 10 deletions third_party/blink/renderer/core/inspector/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,15 @@ blink_core_sources("inspector") {

inspector_protocol_generate("protocol_sources") {
inspector_protocol_dir = _inspector_protocol_dir
browser_protocol =
"//third_party/blink/public/devtools_protocol/browser_protocol.pdl"
out_dir = blink_core_output_dir

config_file = "inspector_protocol_config.json"
_imported = rebase_path(v8_inspector_js_protocol, root_build_dir)
config_values = [ "imported.path=$_imported" ]

inputs = [
"browser_protocol.pdl",
v8_inspector_js_protocol,
browser_protocol,
"inspector_protocol_config.json",
]

Expand Down Expand Up @@ -219,17 +217,45 @@ jumbo_source_set("generated") {
]
}

# TODO(caseq): remove once devtools-frontend is updated to use the
# correct location.
copy("protocol_version") {
sources = [
"$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
action("protocol_compatibility_check") {
script = _inspector_protocol_dir + "/check_protocol_compatibility.py"

inputs = [
"browser_protocol.pdl",
"browser_protocol-1.3.json",
v8_inspector_js_protocol,
]
_stamp = "$blink_core_output_dir/inspector/browser_protocol.stamp"
outputs = [
_stamp,
]

args = [
"--stamp",
rebase_path(_stamp, root_build_dir),
rebase_path("browser_protocol.pdl", root_build_dir),
rebase_path(v8_inspector_js_protocol, root_build_dir),
]
}

action("protocol_version") {
deps = [
":protocol_compatibility_check",
]
script = _inspector_protocol_dir + "/concatenate_protocols.py"

inputs = [
"browser_protocol.pdl",
v8_inspector_js_protocol,
]
output_file = "$blink_core_output_dir/inspector/protocol.json"
outputs = [
output_file,
]
deps = [
"//third_party/blink/public/devtools_protocol:protocol_version",

args = [
rebase_path("browser_protocol.pdl", root_build_dir),
rebase_path(v8_inspector_js_protocol, root_build_dir),
rebase_path(output_file, root_build_dir),
]
}
8 changes: 8 additions & 0 deletions third_party/blink/renderer/core/inspector/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ dgozman@chromium.org
pfeldman@chromium.org
yangguo@chromium.org

# Changes to remote debugging protocol require devtools review to
# ensure backwards compatibility and committment to maintain.
per-file browser_protocol.pdl=set noparent
per-file browser_protocol.pdl=alph@chromium.org
per-file browser_protocol.pdl=dgozman@chromium.org
per-file browser_protocol.pdl=caseq@chromium.org
per-file browser_protocol.pdl=pfeldman@chromium.org

# COMPONENT: Platform>DevTools
35 changes: 35 additions & 0 deletions third_party/blink/renderer/core/inspector/PRESUBMIT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2017 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.


def _CompileDevtoolsFrontend(input_api, output_api):
# Need to get all affected files from change (not just within this subtree)
local_paths = [f.AbsoluteLocalPath() for f in input_api.change.AffectedFiles()]
devtools = input_api.os_path.realpath(
input_api.os_path.join(input_api.PresubmitLocalPath(), "..", "..", "..", "..", "devtools-frontend", "src"))

# If a devtools file is changed, the PRESUBMIT hook in Source/devtools
# will run closure compiler
if (any("browser_protocol.pdl" in path for path in local_paths) and
all(devtools not in path for path in local_paths)):
compile_path = input_api.os_path.join(
input_api.PresubmitLocalPath(), "..", "..", "..", "..", "devtools-frontend", "src", "scripts", "test", "run_type_check.py")
out, _ = input_api.subprocess.Popen(
[input_api.python_executable, compile_path], stdout=input_api.subprocess.PIPE,
stderr=input_api.subprocess.STDOUT).communicate()
if "ERROR" in out or "WARNING" in out:
return [output_api.PresubmitError(out)]
if "NOTE" in out:
return [output_api.PresubmitPromptWarning(out)]
return []


def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CompileDevtoolsFrontend(input_api, output_api))
return results


def CheckChangeOnCommit(input_api, output_api):
return []
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"protocol": {
"path": "../../../public/devtools_protocol/browser_protocol.pdl",
"path": "browser_protocol.pdl",
"package": "third_party/blink/renderer/core/inspector/protocol",
"output": "inspector/protocol",
"namespace": ["blink", "protocol"],
Expand Down

0 comments on commit ec3649f

Please sign in to comment.