OLD | NEW |
---|---|
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
956 } | 956 } |
957 | 957 |
958 void RenderFrameHostImpl::OnDidAddMessageToConsole( | 958 void RenderFrameHostImpl::OnDidAddMessageToConsole( |
959 int32_t level, | 959 int32_t level, |
960 const base::string16& message, | 960 const base::string16& message, |
961 int32_t line_no, | 961 int32_t line_no, |
962 const base::string16& source_id) { | 962 const base::string16& source_id) { |
963 if (delegate_->DidAddMessageToConsole(level, message, line_no, source_id)) | 963 if (delegate_->DidAddMessageToConsole(level, message, line_no, source_id)) |
964 return; | 964 return; |
965 | 965 |
966 // In order for CSP violation detections in the tests to work, console | |
wychen
2016/11/18 21:14:00
This comment should probably move to https://crrev
| |
967 // messages must be forwarded to logging::LogMessage(). | |
968 // Ref: https://crbug.com/638050 | |
969 | |
966 // Pass through log level only on WebUI pages to limit console spew. | 970 // Pass through log level only on WebUI pages to limit console spew. |
967 const bool is_web_ui = | 971 const bool is_web_ui = |
968 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()); | 972 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()); |
969 const int32_t resolved_level = is_web_ui ? level : ::logging::LOG_INFO; | 973 const int32_t resolved_level = is_web_ui ? level : ::logging::LOG_INFO; |
970 | 974 |
971 // LogMessages can be persisted so this shouldn't be logged in incognito mode. | 975 // LogMessages can be persisted so this shouldn't be logged in incognito mode. |
972 // This rule is not applied to WebUI pages, because source code of WebUI is a | 976 // This rule is not applied to WebUI pages, because source code of WebUI is a |
973 // part of Chrome source code, and we want to treat messages from WebUI the | 977 // part of Chrome source code, and we want to treat messages from WebUI the |
974 // same way as we treat log messages from native code. | 978 // same way as we treat log messages from native code. |
975 if (::logging::GetMinLogLevel() <= resolved_level && | 979 if (::logging::GetMinLogLevel() <= resolved_level && |
(...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3266 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3270 // There is no pending NavigationEntry in these cases, so pass 0 as the |
3267 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3271 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
3268 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3272 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
3269 return NavigationHandleImpl::Create( | 3273 return NavigationHandleImpl::Create( |
3270 params.url, frame_tree_node_, is_renderer_initiated, | 3274 params.url, frame_tree_node_, is_renderer_initiated, |
3271 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), | 3275 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), |
3272 entry_id_for_data_nav, false); // started_from_context_menu | 3276 entry_id_for_data_nav, false); // started_from_context_menu |
3273 } | 3277 } |
3274 | 3278 |
3275 } // namespace content | 3279 } // namespace content |
OLD | NEW |