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

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

Issue 921513002: Disable console.log() dumping to LogMessages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment 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 e77f1b72d098f955335ff40ff3356e274627d62f..05e9633ddcfaf7c339d9278a7f79923299051320 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -641,13 +641,11 @@ void RenderFrameHostImpl::OnAddMessageToConsole(
HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL());
const int32 resolved_level = is_web_ui ? level : ::logging::LOG_INFO;
- // 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())) {
+ // 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) {
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