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

Side by Side Diff: Source/core/page/PageConsole.cpp

Issue 18822004: Extension Error Piping - Blink: WebKit Side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Pass in plain text, per Pavel's suggestion Created 7 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return; 84 return;
85 85
86 if (callStack) 86 if (callStack)
87 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, callStack, requestIdentifier); 87 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, callStack, requestIdentifier);
88 else 88 else
89 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, url, lineNumber, columnNumber, state, requestIdentifier); 89 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, url, lineNumber, columnNumber, state, requestIdentifier);
90 90
91 if (source == CSSMessageSource) 91 if (source == CSSMessageSource)
92 return; 92 return;
93 93
94 page->chrome().client()->addMessageToConsole(source, level, message, lineNum ber, url); 94 String chromeMessage = message;
95 if (page->chrome().client()->shouldReportDetailedMessageForSource(url)) {
96 if (callStack) {
97 for (size_t i = 0; i < callStack->size(); ++i) {
pfeldman 2013/08/12 16:15:34 Can you extract this formatter and use it from Con
Devlin 2013/08/12 19:38:17 Done.
98 const ScriptCallFrame& frame = callStack->at(i);
99 chromeMessage.append("\n at " + (frame.functionName().length( ) ? frame.functionName() : String("(anonymous function)")) + " (" + frame.source URL() + ":" + String::number(frame.lineNumber()) + ":" + String::number(frame.co lumnNumber()) + ")");
100 }
101 } else {
102 chromeMessage.append("\n at (anonymous function) (" + url + ":" + String::number(lineNumber) + ":" + String::number(columnNumber) + ")");
103 }
104 }
105 page->chrome().client()->addMessageToConsole(source, level, chromeMessage, l ineNumber, url);
95 } 106 }
96 107
97 // static 108 // static
98 void PageConsole::mute() 109 void PageConsole::mute()
99 { 110 {
100 muteCount++; 111 muteCount++;
101 } 112 }
102 113
103 // static 114 // static
104 void PageConsole::unmute() 115 void PageConsole::unmute()
105 { 116 {
106 ASSERT(muteCount > 0); 117 ASSERT(muteCount > 0);
107 muteCount--; 118 muteCount--;
108 } 119 }
109 120
110 } // namespace WebCore 121 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698