Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1163)

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 927613003: Revert of Disable console.log() dumping to LogMessages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 05e9633ddcfaf7c339d9278a7f79923299051320..e77f1b72d098f955335ff40ff3356e274627d62f 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -641,11 +641,13 @@
HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL());
const int32 resolved_level = is_web_ui ? level : ::logging::LOG_INFO;
- // LogMessages shouldn't be created for console messages because of privacy
- // reasons (on some platforms these get persisted to disk). However because
- // WebUI pages are a part of Chrome's source code, we want to treat messages
- // from WebUI the same way as we treat log messages from native code.
- if (::logging::GetMinLogLevel() <= resolved_level && is_web_ui) {
+ // LogMessages can be persisted so this shouldn't be logged in incognito mode.
+ // This rule is not applied to WebUI pages, because source code of WebUI is a
+ // part of Chrome source code, and we want to treat messages from WebUI the
+ // same way as we treat log messages from native code.
+ if (::logging::GetMinLogLevel() <= resolved_level &&
+ (is_web_ui ||
+ !GetSiteInstance()->GetBrowserContext()->IsOffTheRecord())) {
logging::LogMessage("CONSOLE", line_no, resolved_level).stream()
<< "\"" << message << "\", source: " << source_id << " (" << line_no
<< ")";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698