From 6b1f4d303b10beed6c050de98b7e262d4bc0a5e0 Mon Sep 17 00:00:00 2001 From: Benjamin Lerman Date: Mon, 20 Jul 2015 21:56:32 +0200 Subject: [PATCH] Update to mojo 5561fc7ae1717f8013a873f744fdae116d046e74 --- mojo/devtools/common/README.md | 68 ++++++++++++++----- .../interfaces/network/url_request.mojom | 27 +++++--- mojo/public/tools/NETWORK_SERVICE_VERSION | 2 +- 3 files changed, 69 insertions(+), 28 deletions(-) diff --git a/mojo/devtools/common/README.md b/mojo/devtools/common/README.md index 7db9cb1f32948..e02fe32818f56 100644 --- a/mojo/devtools/common/README.md +++ b/mojo/devtools/common/README.md @@ -2,36 +2,68 @@ Unopinionated tools for **running**, **debugging** and **testing** Mojo apps. -## Repo contents +## Install + +``` +git clone https://github.com/domokit/devtools.git +``` -Devtools offer the following tools: +## Contents - - **mojo_shell** - universall shell runner - - **debugger** - supports interactive tracing and debugging of a running mojo shell - - **remote_adb_setup** - configures adb on a remote machine to communicate with +Devtools offers the following tools: + + - `mojo_shell` - universal shell runner + - `debugger` - supports interactive tracing and debugging of a running mojo + shell + - `remote_adb_setup` - configures adb on a remote machine to communicate with a device attached to the local machine -and a Python scripting library designed for being embedded (devtoolslib). +and a Python scripting library designed for being embedded (`devtoolslib`). -### Devtoolslib +### debugger -**devtoolslib** is a Python module containing the core scripting functionality -for running Mojo apps: shell abstraction with implementations for Android and -Linux and support for apptest frameworks. The executable scripts in devtools -are based on this module. +The `debugger` script allows you to interactively inspect a running shell, +collect performance traces and attach a gdb debugger. -As devtools carry no assumptions about build system or file layout being used, -one can choose to embed the functionality provided by **devtoolslib** in their -own wrapper, instead of relying on the provided scripts. For examples, one can -refer to mojo's [apptest -runner](https://github.com/domokit/mojo/blob/master/mojo/tools/apptest_runner.py). +#### Tracing +To collect [performance +traces](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) +and retrieve the result: -## Install +```sh +debugger tracing start +debugger tracing stop [result.json] +``` +The trace file can be then loaded using the trace viewer in Chrome available at +`about://tracing`. + +#### GDB +It is possible to inspect a Mojo Shell process using GDB. The `debugger` script +can be used to launch GDB and attach it to a running shell process (android +only): + +```sh +debugger gdb attach ``` -git clone https://github.com/domokit/devtools.git + +#### Android crash stacks +When Mojo shell crashes on Android ("Unfortunately, Mojo shell has stopped.") +due to a crash in native code, `debugger` can be used to find and symbolize the +stack trace present in the device log: + +```sh +debugger device stack ``` +### devtoolslib + +**devtoolslib** is a Python module containing the core scripting functionality +for running Mojo apps: shell abstraction with implementations for Android and +Linux and support for apptest frameworks. The executable scripts in devtools are +based on this module. One can also choose to embed the functionality provided by +**devtoolslib** in their own wrapper. + ## Development The library is canonically developed [in the mojo diff --git a/mojo/public/interfaces/network/url_request.mojom b/mojo/public/interfaces/network/url_request.mojom index a249cb297a8f2..86ecd13c31498 100644 --- a/mojo/public/interfaces/network/url_request.mojom +++ b/mojo/public/interfaces/network/url_request.mojom @@ -7,6 +7,22 @@ module mojo; import "mojo/public/interfaces/network/http_header.mojom"; struct URLRequest { + // Specify the cache behavior of the request. + enum CacheMode { + // Default behavior. + DEFAULT, + + // The HTTP request will bypass the local cache and will have a + // 'Cache-Control: nocache' header added in that causes any proxy servers + // to also not satisfy the request from their cache. This has the effect + // of forcing a full end-to-end fetch. + BYPASS_CACHE, + + // The HTTP request will fail if it cannot serve the requested resource + // from the cache (or some equivalent local store). + ONLY_FROM_CACHE, + }; + // The URL to load. string url; @@ -29,13 +45,6 @@ struct URLRequest { // when a redirect is encounterd, FollowRedirect must be called to proceed. bool auto_follow_redirects = false; - // If set to true, then the HTTP request will bypass the local cache and will - // have a 'Cache-Control: nocache' header added in that causes any proxy - // servers to also not satisfy the request from their cache. This has the - // effect of forcing a full end-to-end fetch. - bool bypass_cache = false; - - // If set to true, then the HTTP request will fail if it cannot serve the - // requested resource from the cache (or some equivalent local store). - bool only_from_cache = false; + // The cache behavior for the request. + CacheMode cache_mode = DEFAULT; }; diff --git a/mojo/public/tools/NETWORK_SERVICE_VERSION b/mojo/public/tools/NETWORK_SERVICE_VERSION index 1b66d0c5a5bf7..68dac8c1c70bf 100644 --- a/mojo/public/tools/NETWORK_SERVICE_VERSION +++ b/mojo/public/tools/NETWORK_SERVICE_VERSION @@ -1 +1 @@ -7adc0c0aea71c83932625072af90d87cfe0fd132 +custom_build_base_7adc0c0aea71c83932625072af90d87cfe0fd132_issue_1241553003_patchset_1