Skip to content

Commit 301c634

Browse files
committed
docs: Update inspector documentation
Some of the paths need to be updated. The JSON file is now generated, not checked in to V8. So in order to edit the protocol we need to modify the PDL file, which is the source of the JSON file.
1 parent 521e56d commit 301c634

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/extending-inspector.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This step involves fetching and building the V8 projectory, explanation for whic
1212

1313
> Note: When passing arguments to gn to have a project generate, make sure to include the inspector sources. For an overview of all available gn arguments run `gn args project-dir --list`
1414
15-
1. Modify `v8/src/inspector/js_protocol.json` to only contain the domains that will be used in the runtime project. The right way to go about this is to copy-paste the `js_protocol` from the runtime project, and add on top of it. For a complete list of all protocol domains supported by the Chrome browser refer to [browser_protocol.json](https://chromium.googlesource.com/chromium/src/+log/master/third_party/WebKit/Source/core/inspector/browser_protocol.json) in the Chromium project. Example browser_protocol.json file can be found [here](https://chromedevtools.github.io/devtools-protocol/tot/).
15+
1. Modify `v8/include/js_protocol.pdl` to only contain the domains that will be used in the runtime project. The right way to go about this is to copy-paste the `js_protocol` from the runtime project, and add on top of it. For a complete list of all protocol domains supported by the Chrome browser refer to [browser_protocol.json](https://chromium.googlesource.com/chromium/src/+log/master/third_party/WebKit/Source/core/inspector/browser_protocol.json) in the Chromium project. Example browser_protocol.json file can be found [here](https://chromedevtools.github.io/devtools-protocol/tot/).
1616
2. Modify `v8/src/inspector/inspector_protocol_config.json` and include the names for the additional protocol domain definitions that would need to be generated.
1717
```json
1818
{
@@ -47,9 +47,9 @@ This step involves fetching and building the V8 projectory, explanation for whic
4747
```
4848
3. Figure out which parts of the big `js_inspector.json` protocol you will want to keep for the inspector implementation. It is likely that a lot of it will be browser-specific, so you don't need to spend extra time doing stub implementations for methods and events the application will not be making notifications for.
4949

50-
4. Run the ninja build. Upon completion, the inspector protocol files would be at `project-dir/arch.release/gen/src/inspector/protocol`.
50+
4. Run the ninja build. Upon completion, the inspector protocol files would be at `outgn/$ARCH-release/gen/src/inspector/protocol`.
5151

52-
5. Copy-Paste all `.cpp` and `.h` files in the runtime project at `runtime/src/main/cpp/v8_inspector/src/inspector/protocol`
52+
5. Copy-Paste all `.cpp` and `.h` files in the runtime project at `test-app/runtime/src/main/cpp/v8_inspector/src/inspector/protocol`
5353

5454
6. Create a new C++ class extending the desired Domain (e.g. DOM). Name it according to the convention already established by the V8 team - `v8-<domain>-agent-impl.h/cpp` - See [v8-dom-agent-impl.h](https://github.com/NativeScript/android-runtime/blob/5a04e09439e2bc6a201577895b9ac6538441e758/test-app/runtime/src/main/cpp/v8_inspector/src/inspector/v8-dom-agent-impl.h#L18). Implement the Backend::<Domain>'s methods in the `.cpp` file.
5555

0 commit comments

Comments
 (0)