commit | 5fb6477979e1ff87938c3f592d10d9f7a2b65ec3 | [log] [tgz] |
---|---|---|
author | Ian Clelland <iclelland@chromium.org> | Wed Jul 11 14:17:57 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Jul 11 14:17:57 2018 |
tree | d0587a9d99a6b66ab9ce78a73c08efd1404c34ed | |
parent | ca00af373d1cedda85aa03a039fff991f03ccb5d [diff] |
Add stream printer for WebSandboxFlags This allows debug messages to print sandbox flags in a convenient binary format, rather than outputting them as decimal numbers or 4-byte arrays. This means that you can easily add debug statements for sandboxing code like: DLOG(INFO) << "The sandbox flags here look like " << sandbox_flags_; rather than having to cast: DLOG(INFO) << "The sandbox flags here look like " << std::bitset<32>(static_cast<int>(sandbox_flags_)); It also changes the test output from EXPECT_EQ failures from looking like: ../../content/browser/some_browsertest.cc:12345: Failure Expected: blink::WebSandboxFlags::kAll & ~blink::WebSandboxFlags::kScripts & ~blink::WebSandboxFlags::kAutomaticFeatures Which is: 4-byte object <6F-FF FF-FF> To be equal to: root->child_at(1)->effective_frame_policy().sandbox_flags Which is: 4-byte object <FF-FA FF-FF> to the more reasonable: ../../content/browser/some_browsertest.cc:12345: Failure Expected: blink::WebSandboxFlags::kAll & ~blink::WebSandboxFlags::kScripts & ~blink::WebSandboxFlags::kAutomaticFeatures Which is: 11111111111111111111111101101111 To be equal to: root->child_at(1)->effective_frame_policy().sandbox_flags Which is: 11111111111111111111101011111111 in which single bit errors can easily be spotted. Change-Id: Ibc9020d67654c555e1c70dcb99829e2eb29d0b3c Reviewed-on: https://chromium-review.googlesource.com/772320 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Ian Clelland <iclelland@chromium.org> Cr-Commit-Position: refs/heads/master@{#574151}
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 .