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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 int32 line_no, 634 int32 line_no,
635 const base::string16& source_id) { 635 const base::string16& source_id) {
636 if (delegate_->AddMessageToConsole(level, message, line_no, source_id)) 636 if (delegate_->AddMessageToConsole(level, message, line_no, source_id))
637 return; 637 return;
638 638
639 // Pass through log level only on WebUI pages to limit console spew. 639 // Pass through log level only on WebUI pages to limit console spew.
640 const bool is_web_ui = 640 const bool is_web_ui =
641 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()); 641 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL());
642 const int32 resolved_level = is_web_ui ? level : ::logging::LOG_INFO; 642 const int32 resolved_level = is_web_ui ? level : ::logging::LOG_INFO;
643 643
644 // LogMessages shouldn't be created for console messages because of privacy 644 // LogMessages can be persisted so this shouldn't be logged in incognito mode.
645 // reasons (on some platforms these get persisted to disk). However because 645 // This rule is not applied to WebUI pages, because source code of WebUI is a
646 // WebUI pages are a part of Chrome's source code, we want to treat messages 646 // part of Chrome source code, and we want to treat messages from WebUI the
647 // from WebUI the same way as we treat log messages from native code. 647 // same way as we treat log messages from native code.
648 if (::logging::GetMinLogLevel() <= resolved_level && is_web_ui) { 648 if (::logging::GetMinLogLevel() <= resolved_level &&
649 (is_web_ui ||
650 !GetSiteInstance()->GetBrowserContext()->IsOffTheRecord())) {
649 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() 651 logging::LogMessage("CONSOLE", line_no, resolved_level).stream()
650 << "\"" << message << "\", source: " << source_id << " (" << line_no 652 << "\"" << message << "\", source: " << source_id << " (" << line_no
651 << ")"; 653 << ")";
652 } 654 }
653 } 655 }
654 656
655 void RenderFrameHostImpl::OnCreateChildFrame(int new_routing_id, 657 void RenderFrameHostImpl::OnCreateChildFrame(int new_routing_id,
656 const std::string& frame_name, 658 const std::string& frame_name,
657 SandboxFlags sandbox_flags) { 659 SandboxFlags sandbox_flags) {
658 // It is possible that while a new RenderFrameHost was committed, the 660 // It is possible that while a new RenderFrameHost was committed, the
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1886 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1885 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1887 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1886 GetContentClient()->browser()->RegisterPermissionUsage( 1888 GetContentClient()->browser()->RegisterPermissionUsage(
1887 PERMISSION_GEOLOCATION, 1889 PERMISSION_GEOLOCATION,
1888 delegate_->GetAsWebContents(), 1890 delegate_->GetAsWebContents(),
1889 GetLastCommittedURL().GetOrigin(), 1891 GetLastCommittedURL().GetOrigin(),
1890 top_frame->GetLastCommittedURL().GetOrigin()); 1892 top_frame->GetLastCommittedURL().GetOrigin());
1891 } 1893 }
1892 1894
1893 } // namespace content 1895 } // namespace content
OLDNEW
« 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