commit | 59551d8869a7ac08fd934b7e4ebe35fc0f9b51a6 | [log] [tgz] |
---|---|---|
author | Devlin Cronin <[email protected]> | Tue Mar 05 01:28:59 2019 |
committer | Commit Bot <[email protected]> | Tue Mar 05 01:28:59 2019 |
tree | afe9a7e57fbf86704a41ac81acd1ea815fbaf99f | |
parent | ed5e015888839709941dfa948ff66e0383c6fb55 [diff] |
[Extensions + Blink] Log messages from extension bindings in SWs Extension bindings use a custom console object so that untrusted script can't intercept any calls. This custom console reports messages via RenderFrame::AddMessageToConsole(), which reports the messages to the developer console and the browser process, which also logs them to the terminal if appropriate (e.g., in debug mode or with --enable-logging). These logs are both important for developers (when something goes wrong so they can see it in the console) and to browser tests (so that we get detailed errors and can debug). Unfortunately, these aren't currently logged for ServiceWorker contexts, because there is no RenderFrame to log the message with. Fix this by adding a new WebConsoleMessage::LogWebConsoleMessage() static method that takes a v8::Context and logs the message in the execution context associated with that context. This works for both frame-based and worker-based contexts. Additionally, expose a OnReportConsoleMessage() virtual method on ServiceWorkerContextObserver to allow extensions code to observe console messages. This allows us to test this behavior, and could also be used to hook into recording error messages in extensions (e.g. for the extensions::ErrorConsole). Bug: 933941 Change-Id: Ic67ed46a608c3b4340e25fe695689d2cfeca30aa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1495045 Commit-Queue: Devlin <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Matt Falkenhagen <[email protected]> Reviewed-by: Kinuko Yasuda <[email protected]> Cr-Commit-Position: refs/heads/master@{#637525}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .