Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ba949fd

Browse files
committed
Merge pull request #140 from qsr/roll_mojo
Update to mojo 5561fc7ae1717f8013a873f744fdae116d046e74
2 parents 65c8822 + 6b1f4d3 commit ba949fd

File tree

3 files changed

+69
-28
lines changed

3 files changed

+69
-28
lines changed

mojo/devtools/common/README.md

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,68 @@
22

33
Unopinionated tools for **running**, **debugging** and **testing** Mojo apps.
44

5-
## Repo contents
5+
## Install
6+
7+
```
8+
git clone https://github.com/domokit/devtools.git
9+
```
610

7-
Devtools offer the following tools:
11+
## Contents
812

9-
- **mojo_shell** - universall shell runner
10-
- **debugger** - supports interactive tracing and debugging of a running mojo shell
11-
- **remote_adb_setup** - configures adb on a remote machine to communicate with
13+
Devtools offers the following tools:
14+
15+
- `mojo_shell` - universal shell runner
16+
- `debugger` - supports interactive tracing and debugging of a running mojo
17+
shell
18+
- `remote_adb_setup` - configures adb on a remote machine to communicate with
1219
a device attached to the local machine
1320

14-
and a Python scripting library designed for being embedded (devtoolslib).
21+
and a Python scripting library designed for being embedded (`devtoolslib`).
1522

16-
### Devtoolslib
23+
### debugger
1724

18-
**devtoolslib** is a Python module containing the core scripting functionality
19-
for running Mojo apps: shell abstraction with implementations for Android and
20-
Linux and support for apptest frameworks. The executable scripts in devtools
21-
are based on this module.
25+
The `debugger` script allows you to interactively inspect a running shell,
26+
collect performance traces and attach a gdb debugger.
2227

23-
As devtools carry no assumptions about build system or file layout being used,
24-
one can choose to embed the functionality provided by **devtoolslib** in their
25-
own wrapper, instead of relying on the provided scripts. For examples, one can
26-
refer to mojo's [apptest
27-
runner](https://github.com/domokit/mojo/blob/master/mojo/tools/apptest_runner.py).
28+
#### Tracing
29+
To collect [performance
30+
traces](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
31+
and retrieve the result:
2832

29-
## Install
33+
```sh
34+
debugger tracing start
35+
debugger tracing stop [result.json]
36+
```
3037

38+
The trace file can be then loaded using the trace viewer in Chrome available at
39+
`about://tracing`.
40+
41+
#### GDB
42+
It is possible to inspect a Mojo Shell process using GDB. The `debugger` script
43+
can be used to launch GDB and attach it to a running shell process (android
44+
only):
45+
46+
```sh
47+
debugger gdb attach
3148
```
32-
git clone https://github.com/domokit/devtools.git
49+
50+
#### Android crash stacks
51+
When Mojo shell crashes on Android ("Unfortunately, Mojo shell has stopped.")
52+
due to a crash in native code, `debugger` can be used to find and symbolize the
53+
stack trace present in the device log:
54+
55+
```sh
56+
debugger device stack
3357
```
3458

59+
### devtoolslib
60+
61+
**devtoolslib** is a Python module containing the core scripting functionality
62+
for running Mojo apps: shell abstraction with implementations for Android and
63+
Linux and support for apptest frameworks. The executable scripts in devtools are
64+
based on this module. One can also choose to embed the functionality provided by
65+
**devtoolslib** in their own wrapper.
66+
3567
## Development
3668

3769
The library is canonically developed [in the mojo

mojo/public/interfaces/network/url_request.mojom

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ module mojo;
77
import "mojo/public/interfaces/network/http_header.mojom";
88

99
struct URLRequest {
10+
// Specify the cache behavior of the request.
11+
enum CacheMode {
12+
// Default behavior.
13+
DEFAULT,
14+
15+
// The HTTP request will bypass the local cache and will have a
16+
// 'Cache-Control: nocache' header added in that causes any proxy servers
17+
// to also not satisfy the request from their cache. This has the effect
18+
// of forcing a full end-to-end fetch.
19+
BYPASS_CACHE,
20+
21+
// The HTTP request will fail if it cannot serve the requested resource
22+
// from the cache (or some equivalent local store).
23+
ONLY_FROM_CACHE,
24+
};
25+
1026
// The URL to load.
1127
string url;
1228

@@ -29,13 +45,6 @@ struct URLRequest {
2945
// when a redirect is encounterd, FollowRedirect must be called to proceed.
3046
bool auto_follow_redirects = false;
3147

32-
// If set to true, then the HTTP request will bypass the local cache and will
33-
// have a 'Cache-Control: nocache' header added in that causes any proxy
34-
// servers to also not satisfy the request from their cache. This has the
35-
// effect of forcing a full end-to-end fetch.
36-
bool bypass_cache = false;
37-
38-
// If set to true, then the HTTP request will fail if it cannot serve the
39-
// requested resource from the cache (or some equivalent local store).
40-
bool only_from_cache = false;
48+
// The cache behavior for the request.
49+
CacheMode cache_mode = DEFAULT;
4150
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7adc0c0aea71c83932625072af90d87cfe0fd132
1+
custom_build_base_7adc0c0aea71c83932625072af90d87cfe0fd132_issue_1241553003_patchset_1

0 commit comments

Comments
 (0)