| 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
|
| << ")";
|
|
|