Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index 035bc113dafa035840a9c437ec24c5246b8cec78..ca81c304bc65f29f7e786d6a694effbe466cd87d 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -768,6 +768,14 @@ WebDragData DropDataToWebDragData(const DropData& drop_data) { |
| return result; |
| } |
| +bool IsSourceFromExtension(const std::string& source) { |
| + static const char schema_delimeter[] = "://"; |
|
Yoyo Zhou
2013/07/10 23:39:10
kStandardSchemeSeparator
Devlin
2013/07/11 00:55:35
Much less cringe-worthy, but not needed if we go w
|
| + static const char extension_url_prefix[] = "chrome-extension://"; |
|
Matt Perry
2013/07/10 23:43:13
This is defined in https://code.google.com/p/chrom
Devlin
2013/07/11 00:55:35
I was wondering about that, but saw other referenc
|
| + return !source.empty() && |
| + (source.find(schema_delimeter) == std::string::npos || |
|
Yoyo Zhou
2013/07/10 23:39:10
Can you document why these are the cases we care a
Devlin
2013/07/11 00:55:35
Done.
|
| + source.find(extension_url_prefix) == 0); |
| +} |
| + |
| } // namespace |
| RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) |
| @@ -2267,6 +2275,20 @@ void RenderViewImpl::didAddMessageToConsole( |
| source_name)); |
| } |
| +bool RenderViewImpl::shouldReportDetailedMessage(const WebString& source) { |
|
Matt Perry
2013/07/10 23:43:13
Why is source a string and not a URL? It would be
Devlin
2013/07/11 00:55:35
Well, it comes from WebKit, and is a String in mos
|
| + return IsSourceFromExtension(source.utf8().data()); |
| +} |
| + |
| +void RenderViewImpl::reportDetailedMessage(const WebString& source, |
| + WebConsoleMessage::Level level, |
| + const WebString& message, |
| + const WebString& jsonStackTrace) { |
| + LOG(WARNING) << "RenderViewImpl::reportDetailedErrorMessage()" |
| + << "\n Source: " << base::string16(source) |
| + << "\n Message: " << base::string16(message) |
| + << "\n Stack: " << base::string16(jsonStackTrace); |
| +} |
| + |
| void RenderViewImpl::printPage(WebFrame* frame) { |
| FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
| PrintPage(frame, handling_input_event_)); |